You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to define an extra for my package that pins specific versions of some dependencies, without affecting dependency resolution when it is not used.
My use case: I'm writing a library that depends on jax. I want to define an extras metal that installs jax-metal to support Apple GPUs. However, jax-metal requires a specific version of jaxlib. Since jax updates frequently, it is limiting to force a certain version of jax even when the extra is not used.
Possible way the thing could look like:
[tool.poetry.dependencies]
jax = "^0.4.22"jaxlib = "^0.4.22"jax-metal = { version = "0.0.6", optional = true }
[tool.poetry.extras]
metal = [
"jax-metal",
{ change-dependency = "jaxlib", version = "0.4.22" },
]
Would it be possible at all to do this? Or is it blocked by the way pip itself handles extras in packages it installs?
Impact
I've found someone having a similar problem on this stackoverflow thread. They made a plugin, but 1) it seems unmaintained and a bit messy, so I don't trust depending on it, 2) it works at the level of installing groups, so not for the extras in my final released package.
I guess there are other people with similar needs, but I don't know how many.
Workarounds
Workarounds I know of:
Create a separate package for my library with different dependencies
Time-consuming for me
Ask users to install jax-metal themselves following instructions
Time-consuming for users
Annoying for me because I can't use poetry to install things on my development copy
The text was updated successfully, but these errors were encountered:
Issue Kind
Brand new capability
Description
I want to define an extra for my package that pins specific versions of some dependencies, without affecting dependency resolution when it is not used.
My use case: I'm writing a library that depends on jax. I want to define an extras
metal
that installs jax-metal to support Apple GPUs. However,jax-metal
requires a specific version ofjaxlib
. Sincejax
updates frequently, it is limiting to force a certain version ofjax
even when the extra is not used.Possible way the thing could look like:
Would it be possible at all to do this? Or is it blocked by the way pip itself handles extras in packages it installs?
Impact
I've found someone having a similar problem on this stackoverflow thread. They made a plugin, but 1) it seems unmaintained and a bit messy, so I don't trust depending on it, 2) it works at the level of installing groups, so not for the extras in my final released package.
I guess there are other people with similar needs, but I don't know how many.
Workarounds
Workarounds I know of:
The text was updated successfully, but these errors were encountered: