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

Feat: add index_url paramter for setup env #6289

Closed

Conversation

yhkl-dev
Copy link

This PR addresses the issue that in some countries and regions, network restrictions can significantly slow down access to the official Python website, often resulting in timeouts. To solve this problem, I have added the option for users to customize the index_url during the setup_virtualenv process. For example, in China, users can use the https://pypi.tuna.tsinghua.edu.cn/simple source to download Python packages, instead of the default source provided by PyPI.

@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Dec 14, 2024
@CLAassistant
Copy link

CLAassistant commented Dec 14, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

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

You can use a pip conf file to change that setting globally:
https://pip.pypa.io/en/stable/topics/configuration/

[global] 
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

Putting this in /etc/pip.conf should affect all uses of pip, not just package management. Have you tried a conf file?

@@ -29,3 +29,9 @@
required: false
description: Action timeout in seconds. Action will get killed if it doesn't finish in timeout
type: integer
index_url:
default: "https://pypi.org/simple"
Copy link
Member

Choose a reason for hiding this comment

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

This default means all users that do not use this option will have -i https://pypi.org/simple in the pip command which seems pointless.

Copy link
Author

Choose a reason for hiding this comment

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

thanks for clarification!

@yhkl-dev yhkl-dev closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M PR that changes 30-99 lines. Good size to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants