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:
parent
afb17b61da
commit
355dfd993f
6 changed files with 3811 additions and 5637 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ PYTHON = '3.13'
|
|||
# Use a unified .cache/ folder for all tools.
|
||||
nox.options.envdir = '.cache/nox'
|
||||
|
||||
# All tools except git and poetry are project dependencies.
|
||||
# Avoid accidental successes if the environment is not set up properly.
|
||||
# All tools except `git` and `uv` are project dependencies
|
||||
# => Avoid accidental successes if the environment is not set up properly
|
||||
nox.options.error_on_external_run = True
|
||||
|
||||
# Run only local checks by default.
|
||||
|
|
|
|||
5590
poetry.lock
generated
5590
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue