Repository navigation
Closed
Labels
feature requestNew feature or request to improve the current logicNew feature or request to improve the current logichelp wantedExtra attention is neededExtra attention is neededneeds eyes
Description
I think a most users of this action run an "install dependencies" step immediately after. I think it would improve the developer experience if the "install dependencies" step was integrated into this action.
Current workflow:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txtOption 1: Support installing packages with pip
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
pip-install: -r requirements.txt
# or if you use a different package manager...
# pip-install: pipenv
# - name: Install dependencies
# run: pipenv installOption 2: Add full support for all package managers
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# Pip
package-manager: pip
package-manager-args: -r requirements.txt
# Pipenv
package-manager: pipenv
package-manager-args: --pre --dev --deploy
# Poetry
package-manager: poetry
package-manager-args: --no-devWhat do you think? Option 1 is much smaller in scope than option 2, but I think both would be low maintenance (Python has a lot of package managers, but not that many).
Reacted by Carl Anderson, Brian Rutledge, Bruno Alla, Rick Staa, cschaaf, Yury V. Zaytsev, Pascal Chorus, mm-matthias, Marcel Arns, offa and 11 more
Metadata
Metadata
Assignees
Labels
feature requestNew feature or request to improve the current logicNew feature or request to improve the current logichelp wantedExtra attention is neededExtra attention is neededneeds eyes
Activity
zyv commentedon Jan 3, 2021
We would very much like to use this action, because it will be a huge speed improvement as compared to pulling our pre-baked CI docker image. However, we absolutely need dependency management support - and specifically poetry. So sadly we can't switch until some kind of poetry support is implemented...
omBratteng commentedon Apr 30, 2021
I probably wouldn't install the project dependencies in the same step as setting up python, but it would be nice if the action included the major package managers. Like the node action includes yarn.
Although I think it would be better if the package manager was added at the image layer, which yarn is.
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
omBratteng commentedon Apr 30, 2021
I opened a PR that adds poetry to the virtual environments
actions/runner-images#3293
zyv commentedon Apr 30, 2021
We ended up creating an action to install Poetry after setting up Python - it's still faster than pulling a complete pre-baked docker image with the operating system:
https://github.com/moneymeets/action-setup-poetry
Adding poetry to the base action images would of course only make it better!
omBratteng commentedon May 5, 2021
They closed my PR, as they think because poetry only takes a few seconds to install, it is not needed in the action image, and using actions is better.
ricardo-dematos commentedon Sep 19, 2022
Like many of you, I also immediately run an "install dependencies" step after running this action, thus I've created a composite action:
The action documentation states:
This means that the inputs to run the "install dependencies" step are already available, at least for the currently supported package managers, thus this action could execute it in one go.
brcrista commentedon Sep 26, 2022
My usual take on this is that actions should follow the Unix philosophy. But in this case, by adding built-in dependency caching, we’ve already tightly coupled with the popular Python package managers. We'd welcome a PR for this if anyone wants to take that on.
v-gowridurgad commentedon Sep 18, 2025
Hi everyone,
We’ve raised PR #1201 to address the above requirement by introducing support for a new pip-install input, allowing dependencies to be installed directly via
actions/setup-python. This implementation currently supports only pip. Please validate it against the requirement and confirm. Any feedback or suggestions would be welcome.Thanks in advance!
v-gowridurgad commentedon Sep 29, 2025
Hi everyone,
We’re excited to to share that this feature has been implemented in PR #1201. This update introduces support for a new pip-install input, allowing dependencies to be installed directly via actions/setup-python.
To start using this feature, you can use the
actions/setup-python@mainbranch in your workflows for now, and the changes will be reflected in the upcoming releases.We’ll be closing this issue. Please feel free to reach out if you have any further concerns or need additional assistance.
zyv commentedon Sep 29, 2025
@gowridurgad It would be great to provide an example in the README of how to use the new input with
pyproject.toml. I assume this should work without any issues. No one wants to deal withrequirements.txtin 2025!v-gowridurgad commentedon Oct 1, 2025
Hi @zyv, Thanks for the feedback!
Currently, the pip-install input feature has been implemented to support only pip, and pip does not read or install dependencies directly from pyproject.toml (e.g. [tool.poetry.dependencies] ).
This behaviour is a known limitation. For reference, please see:
Support for other package managers like Poetry or Pipenv is not included yet, but we’re definitely considering adding it in the future based on community demand.
For now, if you're using Poetry or another package manager, you’ll need to run those install commands in a separate step after setting up Python.
We appreciate your understanding and contributions.
zyv commentedon Oct 6, 2025
@gowridurgad this is not correct;
pipdoes support the installation from standardpyproject.tomlkey (project.dependencies) and was able to do so for a long time now. The only downside is that it installs the project itself in addition to the dependencies, but for most projects this actually isn't an issue. The issue of not installing the project itself is tracked here:--only-deps(and--only-build-deps) option(s) pypa/pip#11440The syntax for
pipto install the dependencies frompyproject.tomlispip install .- if you can support this, then most projects using the standard layout (e.g. because they useuv) will be automatically supported.I only find it logical to allow
pip install .with this action if-rhas been implemented to avoid the need of pulling in more actions and/or writing more commands.v-gowridurgad commentedon Oct 10, 2025
Hi @zyv, thank you for following up. You are absolutely correct, pip can install dependencies specified in the standard
[project.dependencies]section of pyproject.toml viapip install ..My previous response was specifically referring to
[tool.poetry.dependencies], which pip does not natively support for reading or installing dependencies.To clarify, the pip-install input does support
pip install .and will install everything defined under[project.dependencies]in pyproject.toml.The following step can be used in a workflow to install the dependencies:
If there are any further suggestions or feedback, please let us know.
zyv commentedon Oct 10, 2025
@gowridurgad Yes, see above. My suggestion is to document exactly that in the README, so that people know that they can use the action to install dependencies automatically without any further actions if they use the standard
[project.dependencies]key.v-gowridurgad commentedon Oct 22, 2025
Hi @zyv, Regarding the suggestion to document the usage of pip install with pyproject.toml, since there is already an example in the README demonstrating how to use the pip-install input, a clarifying note has been added in this PR #1199 instead of adding another example to avoid repetition and maintain concise documentation. The note would state:
This should make it clear to users that the pip-install input can be used with a wide range of standard pip install command options, including installing from pyproject.toml with pip install ., without the need for multiple examples for every use case.
If you have any further suggestions or feedback, please let us know!