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

Use the PEP 735 [dependency-groups] table #13073

Merged
merged 2 commits into from
Mar 20, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/builddoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[docs]
run: uv pip install . --group docs
- name: Render the documentation
run: >
sphinx-build
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ jobs:
enable-cache: false

- name: Install build dependencies (pypa/build, twine)
run: |
uv pip install build "twine>=5.1"
# resolution fails without betterproto
uv pip install pypi-attestations==0.0.22 betterproto==2.0.0b6
run: uv pip install --group package

- name: Build distribution
run: python -m build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install ".[lint,test]"
run: uv pip install -r pyproject.toml --group package --group test --group types
- name: Type check with mypy
run: mypy

Expand All @@ -76,7 +76,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install ".[lint,test]"
run: uv pip install -r pyproject.toml --group package --group test --group types
- name: Type check with pyright
run: pyright

Expand All @@ -97,7 +97,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --upgrade sphinx-lint
run: uv pip install --group lint
- name: Lint documentation with sphinx-lint
run: make doclinter

Expand All @@ -118,7 +118,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --upgrade twine build
run: uv pip install --group package
- name: Lint with twine
run: |
python -m build .
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test]
run: uv pip install . --group test
- name: Install Docutils ${{ matrix.docutils }}
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
- name: Test with pytest
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test]
run: uv pip install . --group test
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test]
run: uv pip install . --group test
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test]
run: uv pip install . --group test
- name: Install Docutils' HEAD
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
- name: Test with pytest
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
enable-cache: false
- name: Install dependencies
run: |
uv pip install .[test] --resolution lowest-direct
uv pip install . --group test --resolution lowest-direct
uv pip install alabaster==1.0.0
- name: Test with pytest
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test]
run: uv pip install . --group test
- name: Test with pytest
run: python -m pytest -vv --durations 25
env:
Expand Down Expand Up @@ -357,7 +357,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install .[test] pytest-cov
run: uv pip install . --group test pytest-cov
- name: Test with pytest
run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/transifex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --upgrade babel jinja2
run: uv pip install --group translations
- name: Extract translations from source code
run: python utils/babel_runner.py extract
- name: Push translations to transifex.com
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
version: latest
enable-cache: false
- name: Install dependencies
run: uv pip install --upgrade babel jinja2
run: uv pip install --group translations
- name: Extract translations from source code
run: python utils/babel_runner.py extract
- name: Pull translations from transifex.com
Expand Down
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,48 @@ sphinx-quickstart = "sphinx.cmd.quickstart:main"
sphinx-apidoc = "sphinx.ext.apidoc:main"
sphinx-autogen = "sphinx.ext.autosummary.generate:main"

[dependency-groups]
docs = [
"sphinxcontrib-websupport",
]
lint = [
"ruff==0.11.0",
"sphinx-lint>=0.9",
]
package = [
"betterproto==2.0.0b6", # resolution fails without betterproto
"build",
"pypi-attestations==0.0.22",
"twine>=5.1",
]
test = [
"pytest>=8.0",
"pytest-xdist[psutil]>=3.4",
"cython>=3.0", # for Cython compilation
"defusedxml>=0.7.1", # for secure XML/HTML parsing
"setuptools>=70.0", # for Cython compilation
"typing_extensions>=4.9", # for typing_extensions.Unpack
]
translations = [
"babel>=2.13",
"Jinja2>=3.1",
]
types = [
"mypy==1.15.0",
"pyright==1.1.397",
{ include-group = "type-stubs" },
]
type-stubs = [
# align with versions used elsewhere
"types-colorama==0.4.15.20240311",
"types-defusedxml==0.7.0.20240218",
"types-docutils==0.21.0.20241128",
"types-Pillow==10.2.0.20240822",
"types-Pygments==2.19.0.20250305",
"types-requests==2.32.0.20250306",
"types-urllib3==1.26.25.14",
]

[tool.flit.module]
name = "sphinx"

Expand Down Expand Up @@ -420,3 +462,6 @@ reportUnusedFunction = "none"
reportUnusedImport = "none"
reportUnusedVariable = "none"
reportWildcardImportFromLibrary = "none"

[tool.uv]
default-groups = "all"
16 changes: 8 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ passenv =
READTHEDOCS
description =
py{311,312,313,314}: Run unit tests against {envname}.
extras =
dependency_groups =
test
setenv =
PYTHONWARNINGS = error
Expand All @@ -31,8 +31,9 @@ commands=
[testenv:lint]
description =
Run linters.
extras =
dependency_groups =
lint
types
# If you update any of these commands, don't forget to update the equivalent
# GitHub Workflow step
commands =
Expand All @@ -43,7 +44,7 @@ commands =
[testenv:docs]
description =
Build documentation.
extras =
dependency_groups =
docs
commands =
python -c "import shutil; shutil.rmtree('./build/sphinx', ignore_errors=True) if '{env:CLEAN:}' else None"
Expand All @@ -52,7 +53,7 @@ commands =
[testenv:docs-live]
description =
Build documentation.
extras =
dependency_groups =
docs
deps =
sphinx-autobuild
Expand All @@ -70,7 +71,7 @@ commands =
[testenv:ruff]
description =
Run ruff formatting and linting.
extras =
dependency_groups =
lint
commands =
ruff format .
Expand All @@ -79,8 +80,7 @@ commands =
[testenv:mypy]
description =
Run mypy type checking.
extras =
lint
test
dependency_groups =
types
commands =
mypy {posargs}
Loading