-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: master
Are you sure you want to change the base?
Conversation
not on main branch HEAD commit
@@ -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 |
There was a problem hiding this comment.
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.
@@ -1,11 +1,15 @@ | |||
name: "Python Dependency Installation" | |||
description: "Install Python dependencies from requirements.txt file" | |||
inputs: | |||
path: # id |
There was a problem hiding this comment.
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.
await exec.exec(`python -m pip install -r ${requirementsPath}`); | ||
} else { | ||
await exec.exec( | ||
`python -m pip install -r ${requirementsPath} -c ${constraintsPath}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's best to use an env var for this, since pip doesn't bypass constraints to internal ephemeral envs made for building sdists via PEP 517.
`python -m pip install -r ${requirementsPath} -c ${constraintsPath}` | |
`PIP_CONSTRAINT='${constraintsPath}' python -m pip install -r ${requirementsPath}` |
(not sure if this syntax works in JS, you may need to figure out how to pass env vars in a different way...)
Closes #224