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

Add constraints file support #225

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .github/workflows/linuxci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Python environment report
run: python -c "import sys; print(sys.version)"
- name: Run ${{ matrix.python-version }} platform tests (default)
uses: py-actions/py-dependency-install@master

Choose a reason for hiding this comment

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

FYI, the best way to self-test an action is to make a local checkout in the job and call it through a relative path. Here's an example: https://github.com/ansible-community/ansible-test-gh-action/blob/d397b87/.github/workflows/test-action.yml#L144.

uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
- name: Run ${{ matrix.python-version }} platform tests (with args)
uses: py-actions/py-dependency-install@master
uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
update-pip: "false"
update-setuptools: "false"
update-wheel: "false"
8 changes: 4 additions & 4 deletions .github/workflows/macosci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Python environment report
run: python -c "import sys; print(sys.version)"
- name: Run ${{ matrix.python-version }} platform tests (default)
uses: py-actions/py-dependency-install@master
uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
- name: Run ${{ matrix.python-version }} platform tests (with args)
uses: py-actions/py-dependency-install@master
uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
update-pip: "false"
update-setuptools: "false"
update-wheel: "false"
8 changes: 4 additions & 4 deletions .github/workflows/windowsci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
- name: Python environment report
run: python -c "import sys; print(sys.version)"
- name: Run ${{ matrix.python-version }} platform tests (default)
uses: py-actions/py-dependency-install@master
uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
- name: Run ${{ matrix.python-version }} platform tests (with args)
uses: py-actions/py-dependency-install@master
uses: py-actions/py-dependency-install@642387473628e92c4b9ac198b5ba51b9102d3f08
with:
path: "tests/requirements.txt"
requirements-path: "tests/requirements.txt"
update-pip: "false"
update-setuptools: "false"
update-wheel: "false"
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: "Python Dependency Installation"
description: "Install Python dependencies from requirements.txt file"
inputs:
path: # id

Choose a reason for hiding this comment

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

Instead of removing old input names, it's best to use a deprecationMessage (with this setting, GitHub hints end-users to update gracefully, whenever they run your action) like I did here: https://github.com/pypa/gh-action-pypi-publish/blob/79739dc/action.yml#L12-L23. Of course, this requires a bit of logic elsewhere, to use the old value as a fallback.

requirements-path:
description: "Path to requirements.txt file"
required: false
default: "requirements.txt"
update-pip: # id
default: "requirements.txt" # on by default, path can be changed by user
constraints-path:
description: "Path to constraints.txt file"
required: false
default: "none" # off by default, can be toggled on by user
update-pip:
description: "Boolean for pip upgrade prior to the dependency installation (default='true')"
required: false
default: "true" # options "true", "false"
Expand Down
Loading