Skip to content

Migrate development extras to dependency groups#1152

Merged
jpadilla merged 1 commit intojpadilla:masterfrom
kurtmckee:rm-dev-extras
Mar 16, 2026
Merged

Migrate development extras to dependency groups#1152
jpadilla merged 1 commit intojpadilla:masterfrom
kurtmckee:rm-dev-extras

Conversation

@kurtmckee
Copy link
Contributor

@kurtmckee kurtmckee commented Mar 14, 2026

Note

These changes are being introduced because extras appear in lock files. When Dependabot opens security vulnerability PRs, the dev, docs, and tests extras also appear in the diff. In addition, having test dependencies as extras can affect dependency version resolution.

This PR will also eliminate the unnecessary extras appearing on the PyPI page:

image

This introduces the following changes:

In addition, when tox was run, the lint environment failed because pyupgrade doesn't support Python 3.9.
Therefore, one additional change was made:

  • The lint tox environment's basepython is updated to Python 3.10.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates contributor-focused dependencies (dev, docs, tests) from project.optional-dependencies (extras) to PEP 735 dependency groups, and updates automation to install those groups to reduce lockfile noise and avoid exposing contributor extras on PyPI.

Changes:

  • Add [dependency-groups] in pyproject.toml and remove dev/docs/tests from project.optional-dependencies.
  • Update tox.ini envs to install tests/docs/dev via dependency_groups (and bump lint to Python 3.10).
  • Update CI and RTD config to install dependency groups instead of extras.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Defines dev/docs/tests dependency groups and removes corresponding extras.
tox.ini Switches tox env dependency installation from extras to dependency groups; sets lint to Python 3.10.
.github/workflows/main.yml Updates dev install step to use --group dev.
.readthedocs.yaml Changes RTD install behavior to install docs group (and crypto extra).
CHANGELOG.rst Notes migration from extras to dependency groups under Unreleased.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

This introduces the following changes:

* The `dev` extra is moved to a dependency group.
* The `tests` extra is moved to a dependency group.
* The `docs` extra is moved to a dependency group.
* `tox.ini` has been updated to use the dependency groups.
* `main.yml` has been updated to install the `dev` dependency group.
* The Read the Docs config is updated to install the `docs` dependency group.

  This follows the how-to documentation published by Read the Docs.
  https://docs.readthedocs.com/platform/latest/build-customization.html#install-dependencies-from-dependency-groups

In addition, when tox was run, the `lint` environment failed
because pyupgrade doesn't support Python 3.9.
Therefore, one additional change was made:

* The `lint` tox environment's `basepython` is updated to Python 3.10.
@jpadilla jpadilla merged commit 40e3147 into jpadilla:master Mar 16, 2026
32 checks passed
@kurtmckee kurtmckee deleted the rm-dev-extras branch March 16, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants