Switch from poetry to uv

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 355dfd993f
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
6 changed files with 3811 additions and 5637 deletions

View file

@ -47,18 +47,16 @@ jobs:
r-cran-zoo \ r-cran-zoo \
-y -y
- name: Install development tool chain (Python, uv, poetry) - name: Install development tool chain (Python, uv)
run: | run: |
curl -LsSf https://astral.sh/uv/install.sh | sh curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH" echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/uv" python install 3.13 "$HOME/.local/bin/uv" python install 3.13
"$HOME/.local/bin/uv" tool install --python 3.13 'poetry>=2'
- name: Install the project - name: Install the project
run: | run: |
uv venv --python 3.13 --seed .venv uv sync --locked --python-preference only-managed
poetry sync --no-interaction
# `TESTING=true` comes from `pyproject.toml` # `TESTING=true` comes from `pyproject.toml`
- name: Run the test suite - 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 install the contained `velofy` package
and all its dependencies and all its dependencies
in a [virtual environment](https://docs.python.org/3/tutorial/venv.html) 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` `git clone ssh://git@git.webartifex.de/alexander/velofy.git`
and 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 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 into dependencies related to only the `velofy` source code package
and dependencies used to run the [Jupyter](https://jupyter.org/) environment and dependencies used to run the [Jupyter](https://jupyter.org/) environment

View file

@ -68,8 +68,8 @@ PYTHON = '3.13'
# Use a unified .cache/ folder for all tools. # Use a unified .cache/ folder for all tools.
nox.options.envdir = '.cache/nox' nox.options.envdir = '.cache/nox'
# All tools except git and poetry are project dependencies. # All tools except `git` and `uv` are project dependencies
# Avoid accidental successes if the environment is not set up properly. # => Avoid accidental successes if the environment is not set up properly
nox.options.error_on_external_run = True nox.options.error_on_external_run = True
# Run only local checks by default. # Run only local checks by default.

5590
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
[build-system] [build-system]
build-backend = "poetry.core.masonry.api" build-backend = "uv_build"
requires = ["poetry-core>=2.0.0,<3.0.0"] 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] [tool.black]
target-version = ["py313"] 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] [tool.pytest.ini_options]
# Source: https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref # 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", "e2e: non-db and non-r integration tests",
"r: (integration) tests using rpy2", "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