rye
rye copied to clipboard
Specifying index-url / Private Indexes
Is it possible to specify --index-url
when adding a dependency to a project?
It used to be, it is not in the version on github. Now that I also use this version and not my own one, I want to incorporate that functionality back but I never really liked how that worked.
Because of how pip installs stuff it's very hard to pin dependencies to a specific index which is what I wanted to actually achieve originally. I'm up for suggestions of how this can be accomplished best with the current state of pip.
The current state of affairs in the pip world is pretty bad :(
- https://github.com/pypa/pip/issues/8606
- https://github.com/python-poetry/poetry/issues/6713
The current state of affairs in the pip world is pretty bad :(
- https://github.com/pypa/pip/issues/8606
- https://github.com/python-poetry/poetry/issues/6713
Only pdm solves that properly
Pipenv also solves this properly https://pipenv.pypa.io/en/latest/pipfile/#example-pipfile-lock
There is no PEP for this though.
Actually there is a draft pep for this, someone in pip project issue about that shared with me
End users of pip will be given the ability to explicitly define one or more repositories that are valid for a specific project, causing pip to only consider those repositories for that project, and avoiding generating an error altogether
https://peps.python.org/pep-0708/#what-is-changing
🙏
So if I read this correctly it will still consult both of them but error if it finds it in more than one. That's I guess better than nothing but quite unfortunate behavior. I much prefer what pdm does here.
Apparently in the original proposal there was a "repository file" that would let the end user specify the exact repository to pull a dependency from. This was "handwaved away" so I guess package managers will be expected to decide on how they want to do this themselves.
https://docs.google.com/document/d/184fQkb6NggVQfYmjTDA7p_U3iWDKk6grc2DigT1X3Es/edit
Any update for this feature? stucked using private pypi.
@futurist I'm currently considering adding a temporary hack in to unblock basic uses.
would be great, especially for pytorch where this is super common.