python-poetry / python-poetry/poetry
Let poetry use both global/system-wide and venv dependencies
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
Issue Kind
Brand new capability
Description
I'd love to be able to let poetry see both packages installed globally on my computer and packages installed via poetry to the project's virtual environment. Perhaps, the global ones should be explicitly mentioned somehow to avoid silent problems with dependencies.
I'm not aware of such functionality in poetry.
Impact
Here's one use case. I want to install a bunch of "regular" dependencies, say numpy and matplotlib for the sake of argument, from PyPI which I can do with poetry. But it is better for some dependencies, like PyTorch, to be left to the user to install on their computer just because it might break at any point. So it would nice to do something like:
poetry install --global=torch,torchvision
And then poetry will install numpy and matplotlib to the venv but it will also be aware that global installations of torch and torchvision should be used.
Given how many issues I've seen with PyTorch mentioned, this could be a solid way to deal with it.
Workarounds
I think you can do some things with --extras flag but I had problems with it. For instance, it tried to install all cuda wheel versions even if I wanted to install just one.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests; start by tracing the poetry install entry point and the existing --extras handling. Define how globally installed packages would be selected, recorded, and isolated from virtual-environment dependencies, then add coverage for the proposed --global=torch,torchvision behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100