Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use dependency-groups #880

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 7 additions & 11 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"

python:
install:
- method: pip
path: .
extra_requirements: [docs]
python: "3.12"
commands:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv run --no-dev --group docs sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
36 changes: 23 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -43,6 +43,24 @@ dependencies = [
]

[project.optional-dependencies]
uv = [
"uv >= 0.1.18",
]
virtualenv = [
"virtualenv >= 20.0.35",
]

[project.scripts]
pyproject-build = "build.__main__:entrypoint"

[project.entry-points."pipx.run"]
build = "build.__main__:entrypoint"

[dependency-groups]
extra = [
"uv >= 0.1.18",
"virtualenv >= 20.0.35",
]
docs = [
"furo >= 2023.08.17",
"sphinx ~= 7.0",
@@ -51,7 +69,6 @@ docs = [
"sphinx-issues >= 3.0.0",
]
test = [
"build[uv, virtualenv]",
"filelock >= 3",
"pytest >= 6.2.4",
"pytest-cov >= 2.12",
@@ -64,27 +81,20 @@ test = [
'setuptools >= 56.0.0; python_version == "3.11"',
'setuptools >= 67.8.0; python_version >= "3.12"',
"setuptools_scm >= 6",
{ include-group = "extra" },
]
typing = [
"build[uv]",
"importlib-metadata >= 5.1",
"mypy ~= 1.9.0",
"tomli",
"typing-extensions >= 3.7.4.3",
{ include-group = "extra" },
]
uv = [
"uv >= 0.1.18",
]
virtualenv = [
"virtualenv >= 20.0.35",
dev = [
{ include-group = "test" },
{ include-group = "typing" },
]

[project.scripts]
pyproject-build = "build.__main__:entrypoint"

[project.entry-points."pipx.run"]
build = "build.__main__:entrypoint"

[tool.flit.sdist]
include = ["tests/", ".gitignore", "CHANGELOG.rst", "docs/", ".dockerignore", "tox.ini"]
exclude = ["**/__pycache__", "docs/_build", "**/*.egg-info", "tests/packages/*/build"]
20 changes: 10 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
requires =
tox>=4.2
tox>=4.22
virtualenv>=20.0.34
env_list =
fix
@@ -15,8 +15,6 @@ description =
run test suite with {basepython}
deps =
pip
extras =
test
pass_env =
LC_ALL
PIP_*
@@ -32,6 +30,8 @@ commands =
pytest -ra --cov --cov-config pyproject.toml \
--cov-report=html:{envdir}/htmlcov --cov-context=test \
--cov-report=xml:{toxworkdir}/coverage.{envname}.xml {posargs:-n auto}
dependency_groups =
test

[testenv:fix]
description = run static analysis and style checks
@@ -48,21 +48,21 @@ commands =

[testenv:type]
description = run type check on code base
extras =
typing
set_env =
PYTHONWARNDEFAULTENCODING =
commands =
mypy
dependency_groups =
typing

[testenv:docs]
description = build documentations
base_python = python3.12
extras =
docs
commands =
sphinx-build -n docs {envtmpdir} {posargs:-W}
python -c 'print("Documentation available under file://{envtmpdir}/index.html")'
dependency_groups =
docs

[testenv:path]
description = verify build can run from source (bootstrap)
@@ -83,12 +83,12 @@ description = generate a DEV environment
package = editable
deps =
virtualenv>=20.0.34
extras =
doc
test
commands =
python -m pip list --format=columns
python -c 'import sys; print(sys.executable)'
dependency_groups =
docs
test

[testenv:coverage]
description = combine coverage from test environments
Loading