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

fix: Allow extra-index-url to precede index-url #11621

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akkuman
Copy link

@akkuman akkuman commented Nov 25, 2022

@akkuman akkuman changed the title Fix 11511 fix: Allow extra-index-url to precede index-url Nov 25, 2022
@webknjaz
Copy link
Member

pre-commit.ci autofix

Comment on lines -233 to +236
index_urls = [opts.index_url]
if PyPI.simple_url in index_urls:
index_urls.remove(PyPI.simple_url)
index_urls.append(opts.index_url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too difficult to make sense of if you consider the surrounding code and all possible circumstances. It may be better to modify some logic in PackageFinder so finder.index_urls does not automatically add the default index (PyPI.simple_url) eagerly, but still have it as a default if no extra indexes are added.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly because this function is called on each line of the file without any context. The upper layer is also the generator. If you modify it according to this idea, you may need to modify it at the outermost layer

I'm sorry. Actually, I'm not familiar with the overall structure of this project.

@sushi30
Copy link

sushi30 commented Jan 18, 2023

is this still being developed?

@0xfabioo
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants