Skip to content

Commit 3b1132a

Browse files
committed
Migrate to uv
1 parent e9e6363 commit 3b1132a

File tree

6 files changed

+632
-385
lines changed

6 files changed

+632
-385
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI
22

33
env:
44
RUFF_UNRELEASED_REF: "main"
5+
UV_SYSTEM_PYTHON: "true"
56

67
on:
78
push:
@@ -21,13 +22,9 @@ jobs:
2122
- uses: actions/setup-python@v4
2223
with:
2324
python-version: "3.11"
24-
cache: "pip"
25-
cache-dependency-path: |
26-
pyproject.toml
27-
requirements.txt
28-
requirements-dev.txt
25+
- uses: hynek/setup-cached-uv@v1
2926
- name: Install dependencies
30-
run: just install
27+
run: just sync
3128
- name: Run checks
3229
run: just check
3330
ruff-versions:
@@ -89,28 +86,21 @@ jobs:
8986
- uses: actions/setup-python@v4
9087
with:
9188
python-version: ${{ matrix.python-version }}
92-
cache: "pip"
93-
cache-dependency-path: |
94-
pyproject.toml
95-
requirements.txt
96-
requirements-dev.txt
89+
- uses: hynek/setup-cached-uv@v1
9790

9891
- name: Install dependencies
99-
run: |
100-
pip install -U pip
101-
just install
92+
run: just sync
10293

10394
- name: Install test Ruff version from PyPI
10495
if: ${{ matrix.ruff-version != env.RUFF_UNRELEASED_REF }}
10596
run: |
106-
pip install ruff==${{ matrix.ruff-version }}
97+
uv pip install --reinstall ruff==${{ matrix.ruff-version }}
10798
ruff --version
10899
109100
- name: "Install test Ruff version from GitHub"
110101
if: ${{ matrix.ruff-version == env.RUFF_UNRELEASED_REF }}
111102
run: |
112-
pip install --force-reinstall git+https://github.com/astral-sh/ruff@${{ matrix.ruff-version }}
113-
pip show ruff
103+
uv pip install --reinstall "ruff @ git+https://github.com/astral-sh/ruff@${{ matrix.ruff-version }}"
114104
ruff version
115105
116106
- 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)