Skip to content

Switch to dependency-groups #585

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 5 commits into from
Jul 25, 2025
Merged

Switch to dependency-groups #585

merged 5 commits into from
Jul 25, 2025

Conversation

paddyroddy
Copy link
Member

Fixes #570. Move to the modern [dependency-groups] syntax for non-user facing additional dependencies. See PEP 735.

@paddyroddy paddyroddy self-assigned this Jul 23, 2025
@paddyroddy paddyroddy added enhancement New feature or request p4-low Low priority task A task to be completed with the repo labels Jul 23, 2025
@paddyroddy paddyroddy requested a review from Copilot July 23, 2025 15:22
Copy link
Contributor

@Copilot 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 modernizes dependency management by migrating from the legacy [project.optional-dependencies] syntax to the new [dependency-groups] format introduced in PEP 735. This change affects how development, documentation, and testing dependencies are declared and installed.

  • Replaces optional-dependencies with dependency-groups in pyproject.toml files
  • Updates tox configuration to use dependency_groups instead of extras
  • Updates installation commands in documentation to use --group flags instead of extras syntax

Reviewed Changes

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

File Description
{{cookiecutter.project_slug}}/pyproject.toml Migrates dependency declarations from optional-dependencies to dependency-groups and updates tox configuration
tutorial.md Updates installation command examples to use --group syntax
tests/data/test_package_generation/pyproject.toml Applies the same dependency-groups migration to test data
README.md Updates quick start installation command to use --group syntax

@paddyroddy paddyroddy marked this pull request as ready for review July 23, 2025 15:23
@paddyroddy paddyroddy requested review from samcunliffe, p-j-smith and Saransh-cpp and removed request for samcunliffe July 23, 2025 15:23
Copy link
Member

@samcunliffe samcunliffe left a comment

Choose a reason for hiding this comment

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

This should go together with

in a new release.

@samcunliffe
Copy link
Member

Screenshot 2025-07-23 at 17 16 26

Ouch.

@paddyroddy
Copy link
Member Author

Ouch.

Sorry, was trying to distribute load!

Copy link
Collaborator

@matt-graham matt-graham left a comment

Choose a reason for hiding this comment

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

As far as I can tell the --group option was only added to uv pip install in version v0.8.1, which was released yesterday? And it is only available in pip install from v25.1 (released in April 2025). As it's quite likely users won't have the latest uv and/or pip versions installed, it might be worth adding a note to instructions in tutorial and README that if you get an error when using the --group argument you may need to update you version of uv / pip.

@paddyroddy
Copy link
Member Author

uv added support in v0.6.7 which was released 17/03/2025. I can add the note, but most users (especially on uv) I would expect to be up-to-date.

@paddyroddy paddyroddy requested a review from matt-graham July 24, 2025 11:06
@paddyroddy
Copy link
Member Author

Link checker failing is unrelated

Copy link
Contributor

@p-j-smith p-j-smith left a comment

Choose a reason for hiding this comment

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

Very nice, a couple of suggestions but nothing blocking

paddyroddy and others added 3 commits July 24, 2025 15:11
Co-authored-by: Paul Smith <paul.j.smith@ucl.ac.uk>
Co-authored-by: Paul Smith <paul.j.smith@ucl.ac.uk>
Copy link
Collaborator

@matt-graham matt-graham left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@paddyroddy paddyroddy merged commit 9543edb into main Jul 25, 2025
15 checks passed
@paddyroddy paddyroddy deleted the dep-groups branch July 25, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p4-low Low priority task A task to be completed with the repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate optional-dependencies to dependency-groups
4 participants