Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 44 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,54 @@

name: Language Server Package Distribution

on:
push:
tags: ["*"]

tags:
- "*"

jobs:
language-server-tests:
build:
name: Build Python distribution
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Setup environment
# Actions use only the folder name (with an action.yml inside)
# https://github.com/orgs/community/discussions/26245#discussioncomment-5962450
# https://docs.github.com/en/actions/tutorials/creating-a-composite-action#creating-an-action-metadata-file
uses: ./.github/actions/py-setup
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user

- name: Build package
run: uv build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish package
run: uv publish
secrets:
UV_PUBLISH_TOKEN: ${{secrets.PYPI_API_TOKEN}}
publish-to-pypi:
name: Publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mal-language-server
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# MAL Language Server
`mal-ls` is a language server for [MAL](https://github.com/mal-lang).
`mal-language-server` is a language server for [MAL](https://github.com/mal-lang).

## PyPi

[mal-language-server](https://pypi.org/project/mal-language-server/) is available on PyPI and can be installed with `pip install mal-language-server`.


## General
The project uses [`uv`](https://docs.astral.sh/uv/) as the main project manager and [`ruff`](https://docs.astral.sh/ruff/) for linting/formatting. `ruff` can be installed via uv as native via `uv tool install ruff` or use it as the dev-dependency its specified as via `uv run ruff <command>`.
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "malls"
name = "mal-language-server"
version = "0.1.0"
description = "Language server for MAL"
readme = "README.md"
requires-python = ">=3.11"

authors = [{ name = "Tobiky", email = "me@tobiky.dev" }]
urls = { github = "https://github.com/Tobiky/mal-ls" }
urls = { github = "https://github.com/mal-lang/mal-ls" }

dependencies = [
"pydantic>=2.11.7",
Expand Down Expand Up @@ -35,6 +35,9 @@ exclude = [
"mise.toml",
]

[tool.hatch.build.targets.wheel]
packages = ["src/malls"]

[tool.pytest.ini_options]
addopts = [
"-rA",
Expand Down
2 changes: 1 addition & 1 deletion src/malls/mal_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def m_initialize(self, **params: dict | None) -> dict:

return {
"capabilities": self.capabilities(parameters.capabilities),
"serverInfo": {"name": "mal-ls"},
"serverInfo": {"name": "mal-language-server"},
}
except MALLSPException as e:
return MALLSPServer.__respond_with_error(e.error_msg, e.code)
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/lsp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def initalize_response(
"hoverProvider": True,
},
# TODO: Replace with values from an actual server instance (e.g. via instance.server_info()) # noqa: E501
"serverInfo": {"name": "mal-ls"},
"serverInfo": {"name": "mal-language-server"},
},
}
server_responses.append(message)
Expand Down
Loading