Specifying a sub/peer dependency's version without explicitly requiring it in pyproject #6437
-
|
I have a pyproject which specifies a need for package |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
There is no equivalent to While technically Poetry could add this as a first-class feature (rather than the groups trick), I don't think there's a ton of benefit as long as other tooling doesn't understand it. If you want to keep 'peer' versions apart from 'real' deps, put them in a non-optional group so they're in one place in your |
Beta Was this translation helpful? Give feedback.
There is no equivalent to
peerDependenciesin Python packaging -- if you care about the version, it is now a top-level dependency. You could implement this as an optional group that you never install explicitly, but that won't work when you use external tools/build sdists and bdists of your package -- that would only work forpoetry install.While technically Poetry could add this as a first-class feature (rather than the groups trick), I don't think there's a ton of benefit as long as other tooling doesn't understand it.
If you want to keep 'peer' versions apart from 'real' deps, put them in a non-optional group so they're in one place in your
pyproject.toml-- this was one of the intent…