Skip to content

Commit 4c0602d

Browse files
authored
Use uv, update actions (#516)
1 parent 4636c86 commit 4c0602d

File tree

16 files changed

+2083
-282
lines changed

16 files changed

+2083
-282
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,45 @@ on:
88
- '**'
99
pull_request: {}
1010

11+
env:
12+
COLUMNS: 150
13+
FORCE_COLOR: 1
14+
1115
jobs:
1216
lint:
1317
runs-on: ubuntu-latest
1418

1519
steps:
16-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
1721

18-
- name: set up python
19-
uses: actions/setup-python@v5
22+
- uses: astral-sh/setup-uv@v7
2023
with:
21-
python-version: '3.11'
24+
python-version: '3.13'
2225

23-
- run: pip install -r requirements/linting.txt -r requirements/pyproject.txt pre-commit
26+
- run: |
27+
uv sync --group linting --extra watch
28+
uv pip install pre-commit
2429
25-
- run: pre-commit run -a --verbose
30+
- run: uv run pre-commit run -a --verbose
2631
env:
2732
SKIP: no-commit-to-branch
2833

2934
docs:
3035
runs-on: ubuntu-latest
3136

3237
steps:
33-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3439

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

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

4346
- run: make docs
4447

4548
- name: Store docs site
46-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@v6
4750
with:
4851
name: docs
4952
path: docs/_build/
@@ -72,20 +75,19 @@ jobs:
7275
runs-on: ${{ matrix.os }}-latest
7376

7477
steps:
75-
- uses: actions/checkout@v4
78+
- uses: actions/checkout@v6
7679

77-
- name: set up python
78-
uses: actions/setup-python@v5
80+
- uses: astral-sh/setup-uv@v7
7981
with:
8082
python-version: ${{ matrix.python }}
8183

82-
- run: pip install -r requirements/testing.txt -r requirements/pyproject.txt
84+
- run: uv sync --group testing --extra watch
8385

8486
- run: make test
8587

86-
- run: coverage xml
88+
- run: uv run coverage xml
8789

88-
- uses: codecov/codecov-action@v4
90+
- uses: codecov/codecov-action@v5
8991
with:
9092
file: ./coverage.xml
9193
env_vars: PYTHON,OS
@@ -113,25 +115,25 @@ jobs:
113115
id-token: write
114116

115117
steps:
116-
- uses: actions/checkout@v4
118+
- uses: actions/checkout@v6
117119

118120
- name: get docs
119-
uses: actions/download-artifact@v4
121+
uses: actions/download-artifact@v6
120122
with:
121123
name: docs
122124
path: docs/_build/
123125

124126
- name: set up python
125-
uses: actions/setup-python@v5
127+
uses: actions/setup-python@v6
126128
with:
127-
python-version: '3.11'
129+
python-version: '3.13'
128130

129131
- name: install
130132
run: pip install -U build
131133

132134
- name: check version
133135
id: check-version
134-
uses: samuelcolvin/check-python-version@v3.2
136+
uses: samuelcolvin/check-python-version@v5
135137
with:
136138
version_file_path: 'arq/version.py'
137139

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

docs/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ clean:
2525
.PHONY: html
2626
html:
2727
mkdir -p $(STATICDIR)
28-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
28+
uv run $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
2929
@echo
3030
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3131

3232
.PHONY: linkcheck
3333
linkcheck:
3434
mkdir -p $(STATICDIR)
35-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
35+
uv run $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
3636
@echo
3737
@echo "Link check complete; look for any errors in the above output " \
3838
"or in $(BUILDDIR)/linkcheck/output.txt."
3939

4040
.PHONY: doctest
4141
doctest:
4242
mkdir -p $(STATICDIR)
43-
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
43+
uv run $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
4444
@echo "Testing of doctests in the sources finished, look at the " \
4545
"results in $(BUILDDIR)/doctest/output.txt."
4646

4747
.PHONY: coverage
4848
coverage:
4949
mkdir -p $(STATICDIR)
50-
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
50+
uv run $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
5151
@echo "Testing of coverage in the sources finished, look at the " \
5252
"results in $(BUILDDIR)/coverage/python.txt."

pyproject.toml

Lines changed: 36 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,38 @@ 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+
'tzdata',
72+
'testcontainers',
73+
]
74+
75+
linting = [
76+
'ruff',
77+
'mypy',
78+
'types-pytz',
79+
'types-redis',
80+
]
81+
82+
docs = [
83+
'sphinx',
84+
]
85+
86+
87+
[tool.uv]
88+
default-groups = ['testing']
89+
required-version = '>=0.8.4'
90+
5791
[tool.pytest.ini_options]
5892
testpaths = 'tests'
5993
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.

0 commit comments

Comments
 (0)