Skip to content

Install with package manager #659

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

Open
Cologler opened this issue Apr 27, 2023 · 9 comments
Open

Install with package manager #659

Cologler opened this issue Apr 27, 2023 · 9 comments
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@Cologler
Copy link

Description:

Currently, if we use poetry, we have to write two steps:

      - name: Install poetry
        run: pipx install poetry

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: ...
          cache: poetry

I hope this can be easier:

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: ...
          package-manager: poetry@{version}
          cache: poetry
@Cologler Cologler added feature request New feature or request to improve the current logic needs triage labels Apr 27, 2023
@dmitry-shibanov
Copy link
Contributor

Hello @Cologler. Thank you for your feature request. We'll take a look on it.

@adam-grant-hendry
Copy link

adam-grant-hendry commented Sep 15, 2023

There is a "cart before the horse" issue here depending on the OS.

MacOS can install pipx with brew, but Linux and Windows must use python (see the docs here). Hence, you have to install python to install pipx and then poetry all before you can run actions/setup-python, by which point you've already installed python...?

I believe the action should install poetry as a post-step if cache: poetry is used and set up the cache.

@adam-grant-hendry
Copy link

adam-grant-hendry commented Sep 15, 2023

There is a "cart before the horse" issue here depending on the OS.

Oops, I forgot about pre-installed software on each runner, and they all have python and pipx. My mistake...

@BrandonLWhite
Copy link

BrandonLWhite commented Dec 7, 2023

There's a more general use-case here that would be very useful to me, where setup-poetry could install a list of global/system tools via pipx, such as: Poetry, Tox, PDM, Invoke, Poe, etc. The idea being for a way to express pipx-installable tools (and their versions) that setup-python would then take care of installing, including caching the respective virtualenvs (eg /opt/pipx/venvs/) and command (eg /opt/pipx_bin/).

An extra bonus would be a way to express this in the pyproject.toml (as an alternative to passing as input) through a field like [tool.setup-python.pipx] or something like that.

I intend to write a stand-alone action as a proof-of-concept and will report back.

@BrandonLWhite
Copy link

Here is an action I've published to fill this need: https://github.com/BrandonLWhite/pipx-install-action

I do envision that one day this functionality is incorporated directly in actions/setup-python, but until then, please try out my action and see if it meets your needs!

@Privat33r-dev
Copy link

Hello @Cologler. Thank you for your feature request. We'll take a look on it.

Will you accept a PR with this feature? With one more input: "cache-packet-manager: BOOL".

@aparnajyothi-y
Copy link
Contributor

Hello Everyone, Thank you for your suggestion! Currently, setup-python automatically installs pip as it is a core part of the Python ecosystem. Adding support for other package managers like Poetry could introduce unnecessary complexity and maintenance overhead, as this action is designed specifically for setting up Python environments.

Supporting additional tools would also increase the scope of the action, potentially introducing compatibility issues and testing challenges. By keeping Poetry installation as a separate step, users can maintain flexibility and choose the installation method that best suits their needs without affecting the simplicity of the setup process.

We recommend keeping Poetry installation separate to preserve the focus and efficiency of setup-python.

@aparnajyothi-y aparnajyothi-y self-assigned this Apr 8, 2025
@MrLoh
Copy link

MrLoh commented Apr 8, 2025

Clearly python is just a second class citizen in actions. Javascript has support for a bunch of different pacakge managers and is generally orders of magnitude faster at setup.

@aparnajyothi-y
Copy link
Contributor

Hello @MrLoh, Thanks for sharing your perspective. We understand the comparison with JavaScript tooling and the desire for broader support within setup-python. Our goal is to keep the action lean, stable, and focused on setting up Python itself, while allowing users the flexibility to choose and manage additional tooling like Poetry as needed.

That said, we’re always open to feedback and will continue to explore ways to improve the Python developer experience in Actions, including setup performance and extensibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

8 participants