Skip to content

How to skip pip upgrade? #1096

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

Open
2 of 5 tasks
retzero opened this issue Apr 28, 2025 · 3 comments
Open
2 of 5 tasks

How to skip pip upgrade? #1096

retzero opened this issue Apr 28, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@retzero
Copy link

retzero commented Apr 28, 2025

Description:
I'm running self-hosted runner w/o internet connection.
Unfortunately the setup-python action perform pip upgrade and eventually failed due to network unreachable.
Q1) Is it possible to skip pip upgrade step?
Q2) How can I configure our internal private repository instead of pypi.org?

Execute installation script
  Check if Python hostedtoolcache folder exist...
  Creating Python hostedtoolcache folder...
  Create Python 3.10.12 folder
  Copy Python binaries to hostedtoolcache folder
  Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
  Upgrading pip...
  Looking in links: /tmp/tmp9gc2bf_x
  Requirement already satisfied: setuptools in /home/actions/_work/_tool/Python/3.10.12/x64/lib/python3.10/site-packages (65.5.0)
  Requirement already satisfied: pip in /home/actions/_work/_tool/Python/3.10.12/x64/lib/python3.10/site-packages (23.0.1)
  Error: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5320422a40>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/pip/
  Error: WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5320421150>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/pip/
  Error: WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f53204228f0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/pip/
  Error: WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f53204217': /simple/pip/
  Error: WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5320422f20>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/pip/
  Error: ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
  Error: ERROR: No matching distribution found for pip
  Error: The process '/usr/bin/bash' failed with exit code 1

Action version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

Expected behavior:
A description of what you expected to happen.

Actual behavior:
A description of what is actually happening.

@retzero retzero added bug Something isn't working needs triage labels Apr 28, 2025
@gowridurgad
Copy link
Contributor

Hello @retzero,
Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

@gowridurgad gowridurgad self-assigned this Apr 28, 2025
@gowridurgad
Copy link
Contributor

Hi @retzero, Thank you for reporting this issue. Based on the logs you provided, it seems the self-hosted runner's lack of internet access is causing the pip upgrade step to fail, as it cannot reach the PyPI servers.
Skipping pip upgrade step:
Currently, the setup-python action performs a pip upgrade by default. Unfortunately, as of now, there isn't a built-in option in the action to skip the automatic pip upgrade step.
Configuring an internal private repository:
To use an internal private repository, you can configure pip to use your repository by creating a pip.conf file. Here's how you can set it up:

- name: Override PIP Configuration
  run: |
    mkdir -p ~/.pip
    echo "[global]" > ~/.pip/pip.conf
    echo "index-url = https://<your-private-repo-url>/simple" >> ~/.pip/pip.conf

Replace with the URL of your private repository. Make sure your private repository is accessible from the self-hosted runner and contains all the required packages.
For additional context and configuration options, you can refer to the pip configuration documentation.
Additionally, we noticed you’re using version 3 of the setup-python action. We recommend upgrading to the latest version to benefit from performance improvements, better caching, and updated features. This might also help avoid similar issues in the future.
Let us know if you need further assistance!

@gowridurgad
Copy link
Contributor

Hi @retzero, Just a gentle reminder regarding this issue, If you have any updates or need further assistance, Please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants