-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
pipx: command not found in v3 action #68
Comments
@NargiT Any thoughts? |
Hi @tiagovrtr I tried to reproduce your problem and could not: I noticed that your logs don't show any output from the |
Thanks for the quick response. I've realised I might have obfuscated the cause of the issue here. I noticed I had a step using google-github-actions/setup-gcloud. If I remove it the issue disappears. name: Upload Python Package
on:
pull_request:
@@ -32,8 +24,6 @@ jobs:
contents: "read"
id-token: "write"
pull-requests: "write"
env:
POETRY_VERSION: 1.5.0
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{vars.GCP_WORKLOAD_IDENTITY_PROVIDER}}
service_account: ${{vars.GCP_SERVICE_ACCOUNT}}
token_format: "access_token"
access_token_lifetime: "300s"
create_credentials_file: false
- name: "Set up Cloud SDK"
uses: google-github-actions/setup-gcloud@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
cache-dependency-path: "poetry.lock"
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ env.POETRY_VERSION }} |
I believe that would be an implication on the |
Yes, absolutely, this is probably caused by gcloud's python. Closing the issue |
This might actually have issues unrelated to gcloud, as I get the same error in a clean sef-hosted runner. Also I've noticed the action follows installation steps for macOS, but setting up pipx should depend on the runner OS. In my case it should follow linux steps as the job
The command that seems to fail is |
Hello @abatilo, I just saw your message and @tiagovrtr doc seems correct. depending of the OS the installation steps are not the same. Should we add os detection and install pipx accordingly ? |
Please do @NargiT. Do you have the bandwidth to work on this? |
sorry not currently. |
Also experiencing this on Ubuntu 18.04. My logs indicate that
Relevant line being |
I was setting up a test repo to try out v3 to see how the switch to pipx would affect us. I was surprised of the installation attempt of pipx. It only takes a second, but perhaps it's good to add a check to see if pipx is on the path before calling pip install pipx? On github hosted runners pipx is already in the path:
(Output from my test repo here: https://github.com/anderssonjohan/pipx-python-version-github-actions/actions/runs/8434367775/job/23097437766) pipx v1.4.3 is already included in the runner-images, so I'm not sure why this action has to do it. I've not tested the v3 on older self-hosted linux+windows runners though, and I guess that's different, as mentioned in the comments here. |
I think, the workflow isn't well designed.
When using a runner on a host where pipx is installed in system it will ALWAYS using the SYSTEM pipx even it is installed localy to user. At the end pipx must be called with full installation path, eg, in case above with /home/docker/.local/bin/pipx for stable work, or $HOME/.local/bin must be enforced to add to PATH. Currently I have no idea how to solve this in a clean way in docker-based runners (or other runners where pipx isn't pre-installed). With version 2 (pure pip install of poetry) there is no problem overall and I can scale via docker containers as I need. To be honest: I don't fully understand why pipx must be used for poetry, but I think I just miss something. |
I tried something different, e.g.,. created an environment where $HOME/.local/bin is in the path. This does not work, too :( The reason is simple: The first run works as expected, e.g., installing pipx - with a specific Python version:
And tests runs as expected. But: when you run it now with a different Python version, it fails entirely:
When removing $HOME/.local/bin from PATH environment it fails again with not finding poetry. IMHO:
Thanks for reading this - and thanks for the nice action |
Thanks for digging into this @ra-albrecht. Are you interested in contributing the changes? |
v3 action fails because pipx is not on PATH
The text was updated successfully, but these errors were encountered: