Giter Site home page Giter Site logo

Comments (12)

abatilo avatar abatilo commented on June 6, 2024 1

@NargiT Any thoughts?

from actions-poetry.

NargiT avatar NargiT commented on June 6, 2024 1

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 ?

from actions-poetry.

abatilo avatar abatilo commented on June 6, 2024

Hi @tiagovrtr

I tried to reproduce your problem and could not:
https://github.com/abatilo/actions-poetry/pull/69/files

I noticed that your logs don't show any output from the pipx ensurepath command. Do you have any ideas why that might be the case?

from actions-poetry.

tiagovrtr avatar tiagovrtr commented on June 6, 2024

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.
There might be some implications to PATH from gcloud's python

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 }}

from actions-poetry.

abatilo avatar abatilo commented on June 6, 2024

I believe that would be an implication on the setup-gcloud action, not this one. Or would you disagree? That action is impacting the ability of other actions to run, not the other way around.

from actions-poetry.

tiagovrtr avatar tiagovrtr commented on June 6, 2024

Yes, absolutely, this is probably caused by gcloud's python. Closing the issue

from actions-poetry.

tiagovrtr avatar tiagovrtr commented on June 6, 2024

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 runs-on: ubuntu-20.04.

python3 -m pip install --user pipx
python3 -m pipx ensurepath

The command that seems to fail is pipx ensurepath, and in the ubuntu installation it is required to prepend it with python3 -m to execute it with the python installation in PATH. Since this action is missing this, the shell might not find pipx as easily as it does in macOS.
I will share new developments as I dig into this

from actions-poetry.

abatilo avatar abatilo commented on June 6, 2024

Please do @NargiT. Do you have the bandwidth to work on this?

from actions-poetry.

NargiT avatar NargiT commented on June 6, 2024

sorry not currently.
Nevertheless, I would like to know how many OS do you want to support ?

from actions-poetry.

tiagovrtr avatar tiagovrtr commented on June 6, 2024

Please do @NargiT. Do you have the bandwidth to work on this?

Hi @abatilo , I've issued a fix that should cover not only ubuntu but the majority of OS's.
In ubuntu 23.xx, pipx can be installed through apt-get install, but that will only be necessary when GitHub launches ubuntu 23.xx runners

from actions-poetry.

atkinsonm avatar atkinsonm commented on June 6, 2024

Also experiencing this on Ubuntu 18.04. My logs indicate that pip install --user pipx and pipx ensurepath ran.

Run abatilo/actions-poetry@v3
  with:
    poetry-version: 1.5.0
  env:
    pythonLocation: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    PKG_CONFIG_PATH: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib/pkgconfig
    Python_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    Python[2](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:2)_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/[3](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:3).9.16/x6[4](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:4)
    Python3_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    LD_LIBRARY_PATH: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib
Run pip install --user pipx
  pip install --user pipx
  pipx ensurepath
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    PKG_CONFIG_PATH: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib/pkgconfig
    Python_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    Python2_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    Python3_ROOT_DIR: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64
    LD_LIBRARY_PATH: /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib
Collecting pipx
  Downloading pipx-1.4.3-py3-none-any.whl.metadata (17 kB)
Collecting argcomplete>=1.9.4 (from pipx)
  Using cached argcomplete-3.2.3-py3-none-any.whl.metadata (16 kB)
Requirement already satisfied: packaging>=20 in /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib/python3.9/site-packages (from pipx) (23.2)
Requirement already satisfied: platformdirs>=2.1 in /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib/python3.9/site-packages (from pipx) (3.11.0)
Requirement already satisfied: tomli in /mnt/github_actions_runner/_work/_tool/Python/3.9.16/x64/lib/python3.9/site-packages (from pipx) (2.0.1)
Collecting userpath!=1.9.0,>=1.6 (from pipx)
  Downloading userpath-1.9.2-py3-none-any.whl.metadata (3.0 kB)
Collecting click (from userpath!=1.9.0,>=1.6->pipx)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Downloading pipx-1.4.3-py3-none-any.whl (6[5](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:5) kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [6](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:6)5.1/65.1 kB 2.4 MB/s eta 0:00:00
Using cached argcomplete-3.2.3-py3-none-any.whl (42 kB)
Downloading userpath-1.9.2-py3-none-any.whl (9.1 kB)
Using cached click-8.1.[7](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:7)-py3-none-any.whl (97 kB)
Installing collected packages: click, argcomplete, userpath, pipx
  WARNING: The script userpath is installed in '/mnt/github_actions_runner/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script pipx is installed in '/mnt/github_actions_runner/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed argcomplete-3.2.3 click-[8](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:8).1.7 pipx-1.4.3 userpath-1.[9](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:9).2

Notice:  A new release of pip is available: 22.0.4 -> 24.0
Notice:  To update, run: pip install --upgrade pip
/mnt/github_actions_runner/_work/_temp/e3354f2b-245d-4f6c-9[19](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:20)d-da0e86[26](https://slack-github.com/slack/slack-cli-py-tools/actions/runs/336934/job/458155#step:4:28)56ff.sh: line 2: pipx: command not found

Relevant line being WARNING: The script pipx is installed in '/mnt/github_actions_runner/.local/bin' which is not on PATH.

from actions-poetry.

anderssonjohan avatar anderssonjohan commented on June 6, 2024

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:

/home/runner/.local/bin is already in PATH.
/opt/pipx_bin is already in PATH.

⚠️  All pipx binary directories have been added to PATH. If you are sure you
want to proceed, try again with the '--force' flag.

Otherwise pipx is ready to go! ✨ 🌟 ✨

(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.

from actions-poetry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.