Conversation
not on main branch HEAD commit
| - 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.
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.
| name: "Python Dependency Installation" | ||
| description: "Install Python dependencies from requirements.txt file" | ||
| inputs: | ||
| path: # id |
There was a problem hiding this comment.
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.
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