Skip to content

Commit

Permalink
Add pip_args input option (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
brynpickering authored Apr 5, 2024
1 parent ff44a58 commit 1344706
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/pip-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ on:
description: "GitHub environment in which secrets are stored"
type: string
default: "pre-release"
pip_args:
description: "Any arguments to pass to pip when running test installations"
required: false
type: string
default: "--no-deps"

secrets:
TEST_PYPI_API_TOKEN:
required: true
Expand Down Expand Up @@ -88,7 +94,7 @@ jobs:

- name: try installing from local build
run: |
pip install dist/${{ inputs.package_name }}-*.tar.gz
pip install ${{inputs.pip_args}} dist/${{ inputs.package_name }}-*.tar.gz
pip-test-upload: # upload to test-pypi and then check install from there succeeds
needs: [pip-build, pip-test-build]
Expand Down Expand Up @@ -127,4 +133,4 @@ jobs:
- name: try installing from TestPyPI
run: |
cd ${{ runner.temp }}
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ${{ inputs.package_name }}==${{ env.VERSION }}
pip install ${{inputs.pip_args}} -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ${{ inputs.package_name }}==${{ env.VERSION }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ _Inputs_:
- environment (optional, default="pre-release"): GitHub environment in which secrets are stored.
Environments help to ensure that only certain operations are available to different user types.
E.g., releasing packages can be given an extra layer of security whereby a maintainer has to approve an action before it can run.
- pip_args (optional, default="--no-deps"). Any arguments to pass to pip when running test installations.
Many of our packages have non-python dependencies, so it is useful to use `--no-deps` in the installation.
However, if you know that your library has purely python dependencies then the pip build process is made more robust by removing this argument (i.e. `pip_args: ""`)
_Required secrets_: `TEST_PYPI_API_TOKEN` stored in a GitHub actions environment of the same name as `environment`.

Expand Down

0 comments on commit 1344706

Please sign in to comment.