jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
446 stars 78 forks source link

install-qt-action messes up python environment #201

Closed asztalosdani closed 8 months ago

asztalosdani commented 11 months ago

Running install-qt-action messes up your python environment. You will have the latest python version even if you installed a specific one previously.

How to reproduce:

- name: Install python
  uses: actions/setup-python@v4
  with:
    python-version: '3.8.6'

- name: Install Qt
  uses: jurplel/install-qt-action@v3
  with:
    version: '5.15.2'

- name: Check python version
  shell: cmd
  run: python -c "import sys;print(sys.version)"

This will print 3.11.4 I know you can set setup-python: false, that's how I solved it, but would it be possible to not let it out of this actions scope? Or maybe check if python is available, and install it only if it isn't?

asztalosdani commented 11 months ago

You can see it reproduced in this workflow run (see the Check python version step)

jurplel commented 11 months ago

I am not sure how we can not let it out of the action's scope... It might be possible to perform more fine-grained checks for whether or not to install but it would require also checking the version.

You should be able to move your setup-python step after install qt without turning off setup-python too.

pzhlkj6612 commented 11 months ago

Running install-qt-action messes up your python environment.

Well, the backend of this action, aqtinstall, is a Python module, so setting up Python environment is reasonable.

The setup is performed here:

https://github.com/jurplel/install-qt-action/blob/8957947946ac9b7623a4ee3c75ab306ffd8ced1c/action.yml#L81-L85