pdm icon indicating copy to clipboard operation
pdm copied to clipboard

Support of Dependency Groups in `pyproject.toml` | PEP 735

Open ioangatop opened this issue 1 year ago • 2 comments

Is your feature/enhancement proposal related to a problem? Please describe.

Hi!

First of all, thank you for developing and maintaining this awesome library!

I would like to ask if you could support dependency groups in pyproject.toml - PEP 735

Describe the solution you'd like

To be able to merge groups and form a new one, as follows:

[tool.pdm.dev-dependencies]
test = ["pytest", "coverage"]
docs = ["sphinx", "sphinx-rtd-theme"]
typing = ["mypy", "types-requests"]

[dependency-groups]
typing-test = [{include = "typing"}, {include = "test"}]
dev = [{include = "test"}, {include = "docs"}, {include = "typing"}]
all = [{include = "test"}, {include = "docs"}, {include = "typing"}, "useful-something"]

ioangatop avatar Mar 17 '24 20:03 ioangatop

We have no interest in supporting it until the PEP is accepted

frostming avatar Mar 18 '24 00:03 frostming

The PEP has been accepted.

Behemyth avatar Oct 11 '24 15:10 Behemyth

Guys, just ask first because I can't believe this is happening. Is it only me or we have an issue with pdm add...

I just upgrade from 2.13.2 to 2.20.1, everything is fine, the lock also upgraded.

but then I try to add new package pdm add -d pytest, it adds to [dependency-groups] but removes all other packages in [tool.pdm.dev-dependencies] except my monorepo packages.

Then I try re adding others using the same way from cli instead of updating pyproject. It turnout that the the first one I just add (pytest) get removed.

So it only keep one item in the [dependency-groups] dev=[...]. I try a few combinations, it still the same, one newly added item in there, the rest get removed, including in the lock. I just upgrade, pdm install and pdm add -d new-package to discover this.

Can someone confirm this is working on your side? Tested on 2 macs but I can't test on windows because no version manager for me to revert the installer.

CallMeLaNN avatar Nov 20 '24 08:11 CallMeLaNN

done via https://github.com/pdm-project/pdm/pull/3230, for reference.

deronnax avatar Dec 06 '24 14:12 deronnax