Skip to content

Commit 212e5ef

Browse files
authored
Switch from Poetry and nox to uv (and Hatcling) and tox (and tox-uv) (#118)
* Remove .tool-versions This will be redundant with the switch to uv and tox-uv. * Bump copyright years * Fix pyproject.toml indentation * Remove explicit pyright venv config pyright works better in tox without this. * Add newlines between pyproject tool sections * Switch from Poetry to uv and Hatchling * Switch from nox to tox and tox-uv * Use uv to install deps for ReadTheDocs build * Use uv and tox-uv in CI workflow
2 parents 4a8fce0 + 73688a4 commit 212e5ef

9 files changed

Lines changed: 187 additions & 170 deletions

File tree

.github/workflows/ci.yml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111
name: Build
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: hynek/build-and-inspect-python-package@v2
@@ -18,17 +18,53 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22-
name: Python ${{ matrix.python-version }}
23-
runs-on: ubuntu-latest
21+
include:
22+
- name: "pytest (3.9)"
23+
python: "3.9"
24+
tox: "3.9"
25+
- name: "pytest (3.10)"
26+
python: "3.10"
27+
tox: "3.10"
28+
- name: "pytest (3.11)"
29+
python: "3.11"
30+
tox: "3.11"
31+
- name: "pytest (3.12)"
32+
python: "3.12"
33+
tox: "3.12"
34+
- name: "pytest (3.13)"
35+
python: "3.13"
36+
tox: "3.13"
37+
coverage: true
38+
- name: "mypy"
39+
python: "3.13"
40+
tox: mypy
41+
- name: "pyright"
42+
python: "3.13"
43+
tox: pyright
44+
- name: "ruff format"
45+
python: "3.13"
46+
tox: ruff-format
47+
- name: "ruff lint"
48+
python: "3.13"
49+
tox: ruff-lint
50+
- name: "Docs"
51+
python: "3.13"
52+
tox: docs
53+
54+
name: ${{ matrix.name }}
55+
runs-on: ubuntu-24.04
56+
2457
steps:
2558
- uses: actions/checkout@v4
26-
- uses: actions/setup-python@v5
59+
- uses: astral-sh/setup-uv@v5
2760
with:
28-
python-version: ${{ matrix.python-version }}
29-
allow-prereleases: true
30-
- run: python -Im pip install nox==2024.10.9 poetry==1.8.4
31-
- run: python -Im nox --python ${{ matrix.python-version }}
61+
python-version: ${{ matrix.python }}
62+
- run: uv pip install tox tox-uv
63+
- run: tox -e ${{ matrix.tox }}
64+
if: ${{ ! matrix.coverage }}
65+
- run: tox -e ${{ matrix.tox }} -- --cov-report=xml
66+
if: ${{ matrix.coverage }}
3267
- uses: codecov/codecov-action@v5
68+
if: ${{ matrix.coverage }}
3369
with:
3470
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.egg-info/
2+
/*.lock
23
/.*_cache/
34
/.coverage
45
/.dmypy.json
@@ -8,5 +9,4 @@
89
/coverage.xml
910
/dist/
1011
/docs/_build/
11-
/poetry.lock
1212
__pycache__/

.readthedocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ version: 2
33
build:
44
os: "ubuntu-24.04"
55
tools:
6-
python: "3.12"
6+
python: "3.13"
77
jobs:
88
post_create_environment:
9-
- pip install poetry
9+
- pip install uv
1010
post_install:
11-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --all-extras --only=main,docs
11+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --all-extras --group docs --link-mode copys
1212

1313
sphinx:
1414
configuration: docs/conf.py

.tool-versions

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ the parts of the API that there is an actual demand for.
7272

7373
Copyright
7474
2019 [Otovo ASA](https://www.otovo.com/),
75-
2023-2024 [Cardboard AS](https://cardboard.inc/).
75+
2023-2025 [Cardboard AS](https://cardboard.inc/).
7676

7777
Licensed under the
7878
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
project = "python-brreg"
44
author = "Cardboard AS"
5-
copyright = f"2019 Otovo ASA, 2023-2024 {author}" # noqa: A001
5+
copyright = f"2019 Otovo ASA, 2023-2025 {author}" # noqa: A001
66

77
extensions = [
88
"sphinx.ext.autodoc",

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ License
4646

4747
Copyright
4848
2019 `Otovo ASA <https://www.otovo.com/>`_,
49-
2023-2024 `Cardboard AS <https://cardboard.inc/>`_.
49+
2023-2025 `Cardboard AS <https://cardboard.inc/>`_.
5050

5151
Licensed under the
5252
`Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>`_.

noxfile.py

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

0 commit comments

Comments
 (0)