Switch from poetry to uv
All checks were successful
CI / Tests (Python 3.13) (push) Successful in 1m8s

Use the PEP 735 "[dependency-groups]" (here: "dev", "test", "docs")
instead of Poetry's "dev" group, and `uv_build` as the build backend.

Replace poetry.lock with uv.lock.

Also, adapt CI and the README.
This commit is contained in:
Alexander Hess 2026-11-25 15:54:16 +01:00
commit e2d117e303
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
5 changed files with 3809 additions and 5635 deletions

View file

@ -47,18 +47,16 @@ jobs:
r-cran-zoo \
-y
- name: Install development tool chain (Python, uv, poetry)
- name: Install development tool chain (Python, uv)
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/uv" python install 3.13
"$HOME/.local/bin/uv" tool install --python 3.13 'poetry>=2'
- name: Install the project
run: |
uv venv --python 3.13 --seed .venv
poetry sync --no-interaction
uv sync --locked --python-preference only-managed
# `TESTING=true` comes from `pyproject.toml`
- name: Run the test suite
run: poetry run pytest -q
run: uv run pytest -q

View file

@ -62,15 +62,15 @@ you can clone the project with [git](https://git-scm.com/)
and install the contained `velofy` package
and all its dependencies
in a [virtual environment](https://docs.python.org/3/tutorial/venv.html)
with [poetry](https://python-poetry.org/docs/):
with [uv](https://docs.astral.sh/uv/):
`git clone ssh://git@git.webartifex.de/alexander/velofy.git`
and
`poetry install --extras research`
`uv sync --extra research`
The `--extras` option is necessary as the non-develop dependencies
The `--extra` option is necessary as the non-develop dependencies
are structured in the [pyproject.toml](https://code.webartifex.de/alexander/velofy/src/branch/develop/pyproject.toml) file
into dependencies related to only the `velofy` source code package
and dependencies used to run the [Jupyter](https://jupyter.org/) environment

5590
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "uv_build"
requires = ["uv_build>=0.12.20,<0.13"]
@ -68,6 +68,45 @@ repository = "https://code.webartifex.de/alexander/velofy"
[dependency-groups]
dev = [
# Task Runners
"nox>=2026.10.20",
"pre-commit>=4.7.0,<5",
# Code Formatters
"autoflake>=2.4.0,<3",
"black>=25.12.0,<26",
"isort>=9.0.2,<10",
# Code Analyzers
"flake8>=7.5.0,<8",
"flake8-annotations>=3.3.1,<4",
"flake8-black>=0.5.0,<0.6",
"flake8-pyproject>=1.2.4,<2",
"flake8-pytest-style>=2.2.0,<3",
"mypy>=2.4.1,<3",
]
test = [
"factory-boy>=3.3.3,<4",
"Faker>=40.63.0,<41",
"packaging>=26.4", # Used to test the packaged version
"pytest-cov>=7.1.0,<8",
"pytest-env>=1.8.8,<2",
"pytest-mock>=3.17.0,<4",
"pytest>=9.2.0,<10",
"xdoctest[optional]>=1.3.2,<2",
]
docs = [
"sphinx>=9.2.0,<10",
"sphinx-autodoc-typehints>=3.17.7,<4",
]
[tool.black]
target-version = ["py313"]
@ -387,41 +426,6 @@ ignore_missing_imports = true
[tool.poetry.group.dev.dependencies]
# Task Runners
nox = ">=2026.10.20"
pre-commit = ">=4.7.0,<5"
# Code Formatters
autoflake = ">=2.4.0,<3"
black = ">=25.12.0,<26"
isort = ">=9.0.2,<10"
# Code Analyzers
flake8 = ">=7.5.0,<8"
flake8-annotations = ">=3.3.1,<4"
flake8-black = ">=0.5.0,<0.6"
flake8-pyproject = ">=1.2.4,<2"
flake8-pytest-style = ">=2.2.0,<3"
mypy = ">=2.4.1,<3"
# Test Suite
Faker = ">=40.63.0,<41"
factory-boy = ">=3.3.3,<4"
packaging = ">=26.4" # Used to test the packaged version
pytest = ">=9.2.0,<10"
pytest-cov = ">=7.1.0,<8"
pytest-env = ">=1.8.8,<2"
pytest-mock = ">=3.17.0,<4"
xdoctest = { version=">=1.3.2,<2", extras=["optional"] }
# Documentation
sphinx = ">=9.2.0,<10"
sphinx-autodoc-typehints = ">=3.17.7,<4"
[tool.pytest.ini_options]
# Source: https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
@ -444,3 +448,12 @@ markers = [
"e2e: non-db and non-r integration tests",
"r: (integration) tests using rpy2",
]
[tool.uv]
# Source: https://docs.astral.sh/uv/reference/settings/
# `uv sync` installs all [dependency-groups] into the local develop environment
# whereas the `nox` sessions install only the groups they need
default-groups = "all"

3753
uv.lock generated Normal file

File diff suppressed because it is too large Load diff