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
50 changes: 26 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,45 @@ on:
- '**'
pull_request: {}

env:
COLUMNS: 150
FORCE_COLOR: 1

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: set up python
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: '3.11'
python-version: '3.13'

- run: pip install -r requirements/linting.txt -r requirements/pyproject.txt pre-commit
- run: |
uv sync --group linting --extra watch
uv pip install pre-commit

- run: pre-commit run -a --verbose
- run: uv run pre-commit run -a --verbose
env:
SKIP: no-commit-to-branch

docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: set up python
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: '3.11'
python-version: '3.13'

- run: pip install -r requirements/docs.txt -r requirements/pyproject.txt
- run: pip install .
- run: uv sync --group docs

- run: make docs

- name: Store docs site
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: docs
path: docs/_build/
Expand Down Expand Up @@ -72,20 +75,19 @@ jobs:
runs-on: ${{ matrix.os }}-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: set up python
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python }}

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

- run: make test

- run: coverage xml
- run: uv run coverage xml

- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
env_vars: PYTHON,OS
Expand Down Expand Up @@ -113,25 +115,25 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: get docs
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: docs
path: docs/_build/

- name: set up python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
python-version: '3.13'

- name: install
run: pip install -U build

- name: check version
id: check-version
uses: samuelcolvin/check-python-version@v3.2
uses: samuelcolvin/check-python-version@v5
with:
version_file_path: 'arq/version.py'

Expand Down
37 changes: 13 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
.DEFAULT_GOAL := all
sources = arq tests

.PHONY: .uv ## Check that uv is installed
.uv:
@uv -V || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'

.PHONY: install
install:
pip install -U pip pre-commit pip-tools
pip install -r requirements/all.txt
pip install -e .[watch]
pre-commit install

.PHONY: refresh-lockfiles
refresh-lockfiles:
find requirements/ -name '*.txt' ! -name 'all.txt' -type f -delete
make update-lockfiles

.PHONY: update-lockfiles
update-lockfiles:
@echo "Updating requirements/*.txt files using pip-compile"
pip-compile -q --strip-extras -o requirements/linting.txt requirements/linting.in
pip-compile -q --strip-extras -o requirements/testing.txt requirements/testing.in
pip-compile -q --strip-extras -o requirements/docs.txt requirements/docs.in
pip-compile -q --strip-extras -o requirements/pyproject.txt pyproject.toml --all-extras
pip install --dry-run -r requirements/all.txt
uv sync --frozen --all-groups --all-packages --all-extras
uv pip install pre-commit
uv run pre-commit install

.PHONY: format
format:
ruff check --fix $(sources)
ruff format $(sources)
uv run ruff check --fix $(sources)
uv run ruff format $(sources)

.PHONY: lint
lint:
ruff check $(sources)
ruff format --check $(sources)
uv run ruff check $(sources)
uv run ruff format --check $(sources)

.PHONY: test
test:
coverage run -m pytest
uv run coverage run -m pytest

.PHONY: testcov
testcov: test
Expand All @@ -43,7 +32,7 @@ testcov: test

.PHONY: mypy
mypy:
mypy arq
uv run mypy arq

.PHONY: all
all: lint mypy testcov
Expand Down
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ clean:
.PHONY: html
html:
mkdir -p $(STATICDIR)
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
uv run $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

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

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

.PHONY: coverage
coverage:
mkdir -p $(STATICDIR)
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
uv run $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
38 changes: 36 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ classifiers = [
'Topic :: System :: Monitoring',
'Topic :: System :: Systems Administration',
]
requires-python = '>=3.8'
requires-python = '>=3.9'
dependencies = [
'redis[hiredis]>=4.2.0,<6',
'click>=8.0',
]
optional-dependencies = {watch = ['watchfiles>=0.16'] }
dynamic = ['version']

[project.optional-dependencies]
watch = ['watchfiles>=0.16']

[project.scripts]
arq = 'arq.cli:cli'

Expand All @@ -54,6 +56,38 @@ Funding = 'https://github.com/sponsors/samuelcolvin'
Source = 'https://github.com/samuelcolvin/arq'
Changelog = 'https://github.com/samuelcolvin/arq/releases'

[dependency-groups]
testing = [
'coverage[toml]',
'dirty-equals',
'msgpack',
'pydantic',
'pytest',
'pytest-asyncio',
'pytest-mock',
'pytest-pretty',
'pytest-timeout',
'pytz',
'tzdata',
'testcontainers',
]

linting = [
'ruff',
'mypy',
'types-pytz',
'types-redis',
]

docs = [
'sphinx',
]


[tool.uv]
default-groups = ['testing']
required-version = '>=0.8.4'

[tool.pytest.ini_options]
testpaths = 'tests'
filterwarnings = ['error']
Expand Down
4 changes: 0 additions & 4 deletions requirements/all.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements/docs.in

This file was deleted.

52 changes: 0 additions & 52 deletions requirements/docs.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements/linting.in

This file was deleted.

30 changes: 0 additions & 30 deletions requirements/linting.txt

This file was deleted.

28 changes: 0 additions & 28 deletions requirements/pyproject.txt

This file was deleted.

Loading
Loading