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

Accept third alternative for --index command line option for name and url #5573

Open
kalebmckale opened this issue Jan 21, 2023 · 1 comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@kalebmckale
Copy link
Contributor

kalebmckale commented Jan 21, 2023

Is your feature request related to a problem?

Again, this is related to solving the larger problem that pipenv-generated Pipfiles consistently have to be edited for private indices.

Specifically, the current method to generate a name for a source index based on the URL passed by --index produces some unfavorable results. The current method merely removes periods and squishes the various parts of the URL into one blob word.

Describe the solution you'd like

While I'm okay with the alternative I mention below, I think the better solution would be to give users the ability to specify the name at the command line, e.g.
--index="myorg-pypi=https://internal.myorg.com/pypi/simple"
or
--index=myorg-pypi:https://internal.myorg.com/pypi/simple

The current logic for exclusively index name or index URL could remain.

When both are provided, the name and URL could be checked against the existing sources as in the current logic and, if either exists but the source differs in the other element, the current source info could be updated; if both elements match, it would be considered an existing source; otherwise, the new source with user-specified name is added.

Describe alternatives you've considered

An alternative to adding another input type for --index could be to truncate the URL at the first "." before appending, when duplicate, the unique identifier. This would require changing the appropriate line (project.py: 956) from .replace(".", "") to .split(".")[0].

Additional context

Again, I am happy to implement these changes, based on which one is desired, and create a pull request. I have tested the alternative locally already since it's the easiest to implement and was happy with the results. However, other users may wish to have the option to select the name when creating Pipfile from pipenv with --index.

@matteius matteius added Type: Enhancement 💡 This is a feature or enhancement request. Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. labels Jan 26, 2023
@matteius
Copy link
Member

matteius commented Jul 7, 2023

@kalebmckale I think it makes sense, feel free to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Candidate The issue has been identified/triaged and contributions are welcomed/encouraged. Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

2 participants