Skip to content

Commit 558c68b

Browse files
committed
Migrate to uv
1 parent fa328bf commit 558c68b

File tree

6 files changed

+617
-378
lines changed

6 files changed

+617
-378
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
requirements.txt
2828
requirements-dev.txt
2929
- name: Install dependencies
30-
run: just install
30+
run: just sync
3131
- name: Run checks
3232
run: just check
3333
ruff-versions:
@@ -89,28 +89,22 @@ jobs:
8989
- uses: actions/setup-python@v4
9090
with:
9191
python-version: ${{ matrix.python-version }}
92-
cache: 'pip'
93-
cache-dependency-path: |
94-
pyproject.toml
95-
requirements.txt
96-
requirements-dev.txt
9792

9893
- name: Install dependencies
9994
run: |
100-
pip install -U pip
95+
pip install -U uv
10196
just install
10297
10398
- name: Install test Ruff version from PyPI
10499
if: ${{ matrix.ruff-version != env.RUFF_UNRELEASED_REF }}
105100
run: |
106-
pip install ruff==${{ matrix.ruff-version }}
101+
uv pip install --reinstall ruff==${{ matrix.ruff-version }}
107102
ruff --version
108103
109104
- name: "Install test Ruff version from GitHub"
110105
if: ${{ matrix.ruff-version == env.RUFF_UNRELEASED_REF }}
111106
run: |
112-
pip install --force-reinstall git+https://github.com/astral-sh/ruff@${{ matrix.ruff-version }}
113-
pip show ruff
107+
uv pip install --reinstall "ruff @ git+https://github.com/astral-sh/ruff@${{ matrix.ruff-version }}"
114108
ruff version
115109
116110
- name: Run tests

justfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
default: fmt check
22

33
lock:
4-
pip-compile --resolver=backtracking --generate-hashes --upgrade -o requirements.txt pyproject.toml
5-
pip-compile --resolver=backtracking --generate-hashes --upgrade --extra dev -o requirements-dev.txt pyproject.toml
4+
uv lock
65

7-
install:
8-
pip install --no-deps -r requirements.txt
9-
pip install --no-deps -r requirements-dev.txt
6+
upgrade:
7+
uv lock --upgrade
8+
9+
sync:
10+
uv sync --dev
1011

1112
fmt:
12-
ruff check --fix-only ./ruff_lsp ./tests
13-
ruff format ./ruff_lsp ./tests
13+
uv run --dev -- ruff check --fix-only ./ruff_lsp ./tests
14+
uv run --dev -- ruff format ./ruff_lsp ./tests
1415

1516
check:
16-
ruff check ./ruff_lsp ./tests
17-
ruff format --check ./ruff_lsp ./tests
18-
mypy ./ruff_lsp ./tests
17+
uv run --dev -- ruff check ./ruff_lsp ./tests
18+
uv run --dev -- ruff format --check ./ruff_lsp ./tests
19+
uv run --dev -- mypy ./ruff_lsp ./tests
1920

2021
test:
21-
pytest
22+
uv run --dev -- pytest

pyproject.toml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "ruff-lsp"
7-
dynamic = ["version"]
7+
version = "0.0.53"
88
description = "A Language Server Protocol implementation for Ruff."
99
authors = [
1010
{ name = "Charlie Marsh", email = "[email protected]" },
1111
]
1212
maintainers = [
1313
{ name = "Charlie Marsh", email = "[email protected]" },
1414
]
15-
requires-python = ">=3.7"
15+
requires-python = ">=3.7.9"
1616
license = "MIT"
1717
keywords = ["ruff", "lsp", "language-server", "language-server-protocol", "python"]
1818
classifiers = [
@@ -34,6 +34,7 @@ classifiers = [
3434
"Topic :: Utilities",
3535
]
3636
urls = { repository = "https://github.com/astral-sh/ruff-lsp" }
37+
scripts = { ruff-lsp = "ruff_lsp.__main__:main" }
3738
dependencies = [
3839
"packaging>=23.1",
3940
"pygls>=1.1.0",
@@ -42,21 +43,15 @@ dependencies = [
4243
"typing_extensions",
4344
]
4445

45-
[project.optional-dependencies]
46-
dev = [
46+
[tool.uv]
47+
dev-dependencies = [
4748
"mypy==1.4.1",
4849
"pip-tools>=6.13.0,<7.0.0",
4950
"pytest>=7.3.1,<8.0.0",
5051
"pytest-asyncio==0.21.2",
5152
"python-lsp-jsonrpc==1.0.0",
5253
]
5354

54-
[project.scripts]
55-
ruff-lsp = "ruff_lsp.__main__:main"
56-
57-
[tool.hatch.version]
58-
path = "ruff_lsp/__init__.py"
59-
6055
[tool.ruff]
6156
line-length = 88
6257
target-version = "py37"

0 commit comments

Comments
 (0)