actions / actions/setup-python

Optional ability to set the pypi repository and credentials to be used by pip on the runner

Open
#814 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
TypeScript
Stars
2.2k
Forks
739
Avg merge
6d 18h
Merged PRs (30d)
1

Description

Description:
Add option with flags to allow users of the action to setup a pip.conf or pip.ini file with a private registry and credentials.

Example usage:

 - name: Set up Python ${{ matrix.python-version }}
     uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}
        repository: ${{ secrets.PYPI_REPO_URL }}
        username: ${{ secrets.PYPI_USER_TOKEN }}
        password: ${{ secrets.PYPI_PASS_TOKEN }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

Justification:
Using this action on ephemeral runners in environments where where companies have their own repository's to cache python dependencies. Great example (and my use case) is an enterprise nexus pypi repo where the open source pypi is blocked by firewall and dependencies need to be security scanned and placed in nexus prior to use internally. Having one setup-python action run and have the runner configured properly to use pip in any environment prevents the clutter having to manually write a pip.conf/pip.ini file every time we want to pip install.

Are you willing to submit a PR?
Absolutely, I am new to typescript but would love to put in a PR if others agree the work is useful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the setup-python action's existing inputs and runner setup flow, then determine how pip.conf or pip.ini would be configured for private repositories and credentials. Done means the action can accept the requested repository and credential inputs and configure pip for subsequent installs, with behavior validated across the supported runner environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.