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(python): specify path of requirements file #602

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ on:
default: latest

venv_path:
description: The path to create a virtual Python environment at (relative to working directory).
description: The path, relative to the working directory, to create a virtual Python environment at.
type: string
required: false

requirement:
description: The path, relative to the working directory, of a requirements file.
type: string
required: false
default: requirements.txt

pip_install_target:
description: The target directory that PIP should install packages into (relative to working directory).
description: The path, relative to the working directory, of a target directory that PIP should install packages into.
type: string
required: false

Expand Down Expand Up @@ -68,11 +74,13 @@ jobs:
source "$VENV_PATH/bin/activate"

- name: Install dependencies
if: inputs.requirement != ''
env:
TARGET: ${{ inputs.pip_install_target }}
PIP_INSTALL_REQUIREMENT: ${{ inputs.requirement }}
PIP_INSTALL_TARGET: ${{ inputs.pip_install_target }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --target "$TARGET"
pip install --requirement "$PIP_INSTALL_REQUIREMENT" --target "$PIP_INSTALL_TARGET"

- name: Create tarball
id: tar
Expand Down