Skip to content

chore: move to using dependency-groups #227

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

Merged
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ build_task:
container: {image: "python:3.11-bullseye"}
clone_script: *clone
<<: *task-template
install_script: pip install tox
install_script: pip install tox tox-uv
build_script:
- tox -e clean,lint,typecheck,build
- tar czf dist.tar.gz dist
Expand All @@ -102,7 +102,7 @@ linux_task:
container: {image: "python:3.13-rc-bookworm"}
allow_failures: true # RC
install_script:
- python -m pip install --upgrade pip tox pipx
- python -m pip install --upgrade pip tox tox-uv pipx
<<: *test-template
alias: base-test

Expand Down Expand Up @@ -149,7 +149,7 @@ windows_task:
- choco install -y --no-progress python3 --version=3.12.5 --params "/NoLockdown"
- choco install -y --no-progress curl
- pip install --upgrade certifi
- python -m pip install -U pip tox pipx
- python -m pip install -U pip tox tox-uv pipx
<<: *test-template
depends_on: [build, base-test]

Expand All @@ -168,7 +168,7 @@ linkcheck_task:
depends_on: [finalize]
allow_failures: true
<<: *task-template
install_script: pip install tox
install_script: pip install tox tox-uv
download_artifact_script: *download-artifact
linkcheck_script: tox --installpkg dist/*.whl -e linkcheck -- -q

Expand Down
24 changes: 13 additions & 11 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
version: 2

build:
os: "ubuntu-22.04"
os: ubuntu-lts-latest
tools:
python: "3.10"
python: latest
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv $READTHEDOCS_VIRTUALENV_PATH
install:
# Use a cache dir in the same mount to halve the install time
# pip and uv pip will gain support for groups soon
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv sync --active --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache --group docs --extra all

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

python:
install:
- requirements: docs/requirements.txt
- {path: ., extra_requirements: [all], method: pip}
9 changes: 0 additions & 9 deletions docs/requirements.txt

This file was deleted.

45 changes: 33 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ all = [
"trove-classifiers>=2021.10.20",
]
store = ["validate-pyproject-schema-store"]

[project.scripts]
validate-pyproject = "validate_pyproject.cli:main"

[project.entry-points."validate_pyproject.tool_schema"]
setuptools = "validate_pyproject.api:load_builtin_plugin"
distutils = "validate_pyproject.api:load_builtin_plugin"

[project.entry-points."repo_review.checks"]
validate_pyproject = "validate_pyproject.repo_review:repo_review_checks"

[project.entry-points."repo_review.families"]
validate_pyproject = "validate_pyproject.repo_review:repo_review_families"

[dependency-groups]
dev = [
{ include-group = "test" },
]
docs = [
"furo>=2023.08.17",
"sphinx>=7.2.2",
"sphinx-argparse>=0.3.1",
"sphinx-copybutton",
"sphinx-jsonschema>=1.16.11",
"sphinxemoji",
]
test = [
"setuptools",
"pytest>=8.3.3",
Expand All @@ -49,18 +75,13 @@ typecheck = [
"importlib-resources",
]

[project.scripts]
validate-pyproject = "validate_pyproject.cli:main"

[project.entry-points."validate_pyproject.tool_schema"]
setuptools = "validate_pyproject.api:load_builtin_plugin"
distutils = "validate_pyproject.api:load_builtin_plugin"

[project.entry-points."repo_review.checks"]
validate_pyproject = "validate_pyproject.repo_review:repo_review_checks"

[project.entry-points."repo_review.families"]
validate_pyproject = "validate_pyproject.repo_review:repo_review_families"
[tool.uv]
environments = [
"python_version >= '3.9'",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this is required because uv locks across the entire environment, and the docs requirements require 3.9 (sphinx>=7.2.2). You can't build the docs on 3.8.

]
dev-dependencies = [
"validate_pyproject[all]",
]

[tool.setuptools_scm]
version_scheme = "no-guess-dev"
Expand Down
19 changes: 7 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!

[tox]
minversion = 3.24
minversion = 4.22
envlist = default
isolated_build = True

Expand All @@ -16,9 +16,8 @@ passenv =
HOME
SETUPTOOLS_*
VALIDATE_PYPROJECT_*
extras =
all
test
dependency_groups = test
extras = all
commands =
pytest {posargs}

Expand All @@ -42,9 +41,8 @@ changedir = {toxinidir}
passenv =
TERM
# ^ ensure colors
extras =
all
typecheck
extras = all
dependency_groups = typecheck
commands =
python -m mypy {posargs:--pretty --show-error-context src}

Expand Down Expand Up @@ -79,11 +77,8 @@ setenv =
linkcheck: BUILD = linkcheck
passenv =
SETUPTOOLS_*
extras =
all
deps =
-r {toxinidir}/docs/requirements.txt
# ^ requirements.txt shared with Read The Docs
extras = all
dependency_groups = docs
commands =
sphinx-build -v -T -j auto --color -b {env:BUILD} -d "{env:BUILDDIR}/doctrees" "{env:DOCSDIR}" "{env:BUILDDIR}/{env:BUILD}" {posargs}

Expand Down