use dependency groups instead of extras for dev dependencies#2543
use dependency groups instead of extras for dev dependencies#2543artpelling wants to merge 2 commits into
Conversation
|
This pull request modifies make ci_requirementsand commit the changed files to ensure that CI runs with the updated dependencies. |
|
I've updated the CI requirements. Of course, |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Hi @artpelling! I fully agree that we should use dependency groups at some point. However, conda-lock not supporting them (conda/conda-lock#857) is kind of a showstopper. Getting rid of the conda tests is not an option, since there are some dependency/platform combinations, for which there is no alternative (at least slycot on windows). Pixi might be an alternative to conda-lock at some point, but last time I checked there were issues as well. For now, I would prefer waiting a little longer and hoping that conda-lock gains dependency group at some point. (A workaround might be to write a script which extracts the data from the dependency group and feeds it to conda-lock.) |
I agree, I thought I quickly take a stab at it. Feel free to close the PR :) |
|
I'll keep the PR open, but make it a draft, since we'll want to use dependency groups eventually. |
I would suggest to use dependency-groups instead of
project.optional-dependenciesfor all development dependencies.The change is pretty minor but is the recommended way of handling dev dependencies. The main difference is that
dependency-groupsare not included when packaging, making the package smaller whereasproject.optional-dependenciesare meant for package extras with optional features.The other (minor) benefit is that it makes the dev workflow a bit cleaner, especially with
uv, wheredevis activated by default. The linting command is thenuv run ruff checkinstead ofuv run --with ".[dev]" ruff check. Also, it removes the problem with the[]characters in some shells likezsh. Thepipcommand becomespip install --group dev ..I just changed the
pyproject.tomlfor demonstration, I briefly looked at CI but got scared quickly. Migration might not be worth the headache...