Skip to content

Commit 722a779

Browse files
committed
Use uv, update actions
1 parent 4636c86 commit 722a779

12 files changed

Lines changed: 2117 additions & 266 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,36 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717

18-
- name: set up python
19-
uses: actions/setup-python@v5
18+
- uses: astral-sh/setup-uv@v7
2019
with:
21-
python-version: '3.11'
20+
python-version: '3.13'
2221

23-
- run: pip install -r requirements/linting.txt -r requirements/pyproject.txt pre-commit
22+
- run: |
23+
uv sync --group linting
24+
uv pip install pre-commit
2425
25-
- run: pre-commit run -a --verbose
26+
- run: uv run pre-commit run -a --verbose
2627
env:
2728
SKIP: no-commit-to-branch
2829

2930
docs:
3031
runs-on: ubuntu-latest
3132

3233
steps:
33-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
3435

35-
- name: set up python
36-
uses: actions/setup-python@v5
36+
- uses: astral-sh/setup-uv@v7
3737
with:
38-
python-version: '3.11'
38+
python-version: '3.13'
3939

40-
- run: pip install -r requirements/docs.txt -r requirements/pyproject.txt
41-
- run: pip install .
40+
- run: uv sync --group docs
4241

4342
- run: make docs
4443

4544
- name: Store docs site
46-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@v6
4746
with:
4847
name: docs
4948
path: docs/_build/
@@ -72,20 +71,19 @@ jobs:
7271
runs-on: ${{ matrix.os }}-latest
7372

7473
steps:
75-
- uses: actions/checkout@v4
74+
- uses: actions/checkout@v6
7675

77-
- name: set up python
78-
uses: actions/setup-python@v5
76+
- uses: astral-sh/setup-uv@v7
7977
with:
8078
python-version: ${{ matrix.python }}
8179

82-
- run: pip install -r requirements/testing.txt -r requirements/pyproject.txt
80+
- run: uv sync --group testing
8381

8482
- run: make test
8583

8684
- run: coverage xml
8785

88-
- uses: codecov/codecov-action@v4
86+
- uses: codecov/codecov-action@v5
8987
with:
9088
file: ./coverage.xml
9189
env_vars: PYTHON,OS
@@ -113,25 +111,25 @@ jobs:
113111
id-token: write
114112

115113
steps:
116-
- uses: actions/checkout@v4
114+
- uses: actions/checkout@v6
117115

118116
- name: get docs
119-
uses: actions/download-artifact@v4
117+
uses: actions/download-artifact@v6
120118
with:
121119
name: docs
122120
path: docs/_build/
123121

124122
- name: set up python
125-
uses: actions/setup-python@v5
123+
uses: actions/setup-python@v6
126124
with:
127-
python-version: '3.11'
125+
python-version: '3.13'
128126

129127
- name: install
130128
run: pip install -U build
131129

132130
- name: check version
133131
id: check-version
134-
uses: samuelcolvin/check-python-version@v3.2
132+
uses: samuelcolvin/check-python-version@v5
135133
with:
136134
version_file_path: 'arq/version.py'
137135

Makefile

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
11
.DEFAULT_GOAL := all
22
sources = arq tests
33

4+
.PHONY: .uv ## Check that uv is installed
5+
.uv:
6+
@uv -V || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
7+
48
.PHONY: install
59
install:
6-
pip install -U pip pre-commit pip-tools
7-
pip install -r requirements/all.txt
8-
pip install -e .[watch]
9-
pre-commit install
10-
11-
.PHONY: refresh-lockfiles
12-
refresh-lockfiles:
13-
find requirements/ -name '*.txt' ! -name 'all.txt' -type f -delete
14-
make update-lockfiles
15-
16-
.PHONY: update-lockfiles
17-
update-lockfiles:
18-
@echo "Updating requirements/*.txt files using pip-compile"
19-
pip-compile -q --strip-extras -o requirements/linting.txt requirements/linting.in
20-
pip-compile -q --strip-extras -o requirements/testing.txt requirements/testing.in
21-
pip-compile -q --strip-extras -o requirements/docs.txt requirements/docs.in
22-
pip-compile -q --strip-extras -o requirements/pyproject.txt pyproject.toml --all-extras
23-
pip install --dry-run -r requirements/all.txt
10+
uv sync --frozen --all-groups --all-packages --all-extras
11+
uv pip install pre-commit
12+
uv run pre-commit install
2413

2514
.PHONY: format
2615
format:
27-
ruff check --fix $(sources)
28-
ruff format $(sources)
16+
uv run ruff check --fix $(sources)
17+
uv run ruff format $(sources)
2918

3019
.PHONY: lint
3120
lint:
32-
ruff check $(sources)
33-
ruff format --check $(sources)
21+
uv run ruff check $(sources)
22+
uv run ruff format --check $(sources)
3423

3524
.PHONY: test
3625
test:
37-
coverage run -m pytest
26+
uv run coverage run -m pytest
3827

3928
.PHONY: testcov
4029
testcov: test
@@ -43,7 +32,7 @@ testcov: test
4332

4433
.PHONY: mypy
4534
mypy:
46-
mypy arq
35+
uv run mypy arq
4736

4837
.PHONY: all
4938
all: lint mypy testcov

pyproject.toml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ classifiers = [
3636
'Topic :: System :: Monitoring',
3737
'Topic :: System :: Systems Administration',
3838
]
39-
requires-python = '>=3.8'
39+
requires-python = '>=3.9'
4040
dependencies = [
4141
'redis[hiredis]>=4.2.0,<6',
4242
'click>=8.0',
4343
]
44-
optional-dependencies = {watch = ['watchfiles>=0.16'] }
4544
dynamic = ['version']
4645

46+
[project.optional-dependencies]
47+
watch = ['watchfiles>=0.16']
48+
4749
[project.scripts]
4850
arq = 'arq.cli:cli'
4951

@@ -54,6 +56,37 @@ Funding = 'https://github.com/sponsors/samuelcolvin'
5456
Source = 'https://github.com/samuelcolvin/arq'
5557
Changelog = 'https://github.com/samuelcolvin/arq/releases'
5658

59+
[dependency-groups]
60+
testing = [
61+
'coverage[toml]',
62+
'dirty-equals',
63+
'msgpack',
64+
'pydantic',
65+
'pytest',
66+
'pytest-asyncio',
67+
'pytest-mock',
68+
'pytest-pretty',
69+
'pytest-timeout',
70+
'pytz',
71+
'testcontainers',
72+
]
73+
74+
linting = [
75+
'ruff',
76+
'mypy',
77+
'types-pytz',
78+
'types-redis',
79+
]
80+
81+
docs = [
82+
'sphinx>=5,<6',
83+
]
84+
85+
86+
[tool.uv]
87+
default-groups = ['testing']
88+
required-version = '>=0.8.4'
89+
5790
[tool.pytest.ini_options]
5891
testpaths = 'tests'
5992
filterwarnings = ['error']

requirements/all.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements/docs.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements/docs.txt

Lines changed: 0 additions & 52 deletions
This file was deleted.

requirements/linting.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements/linting.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

requirements/pyproject.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

requirements/testing.in

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)