Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying index-url / Private Indexes #36

Closed
pshashk opened this issue Apr 25, 2023 · 10 comments · Fixed by #199
Closed

Specifying index-url / Private Indexes #36

pshashk opened this issue Apr 25, 2023 · 10 comments · Fixed by #199
Labels
enhancement New feature or request
Milestone

Comments

@pshashk
Copy link

pshashk commented Apr 25, 2023

Is it possible to specify --index-url when adding a dependency to a project?

@mitsuhiko mitsuhiko added the enhancement New feature or request label Apr 25, 2023
@mitsuhiko
Copy link
Collaborator

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.

@mitsuhiko
Copy link
Collaborator

The current state of affairs in the pip world is pretty bad :(

@ryukinix
Copy link

The current state of affairs in the pip world is pretty bad :(

Only pdm solves that properly

@kabouzeid
Copy link

Pipenv also solves this properly https://pipenv.pypa.io/en/latest/pipfile/#example-pipfile-lock

There is no PEP for this though.

@ryukinix
Copy link

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

🙏

@mitsuhiko
Copy link
Collaborator

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.

@mwarkentin
Copy link

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

@mitsuhiko mitsuhiko changed the title Specifying index-url Specifying index-url / Private Indexes Apr 27, 2023
@futurist
Copy link

Any update for this feature? stucked using private pypi.

@mitsuhiko
Copy link
Collaborator

@futurist I'm currently considering adding a temporary hack in to unblock basic uses.

@kabouzeid
Copy link

would be great, especially for pytorch where this is super common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants