cjolowicz / cookiecutter-hypermodern-python

Hypermodern Python Cookiecutter
http://cookiecutter-hypermodern-python.readthedocs.io/
MIT License
1.82k stars 235 forks source link

Python 3.10 job installs dependencies under Python 3.9 (Cookiecutter) #1196

Open cjolowicz opened 2 years ago

cjolowicz commented 2 years ago

See https://github.com/cjolowicz/cookiecutter-hypermodern-python/runs/6451683960?check_suite_focus=true

Possible reason: The CI for the Cookiecutter uses the pre-installed pipx to install Poetry. It looks like the pre-installed pipx uses Python 3.9, so Poetry is also installed under that version. As a result, Poetry uses Python 3.9 to create the project environment.

paw-lu commented 2 years ago

Good find. Embarassingly I had come across this a while back and forgot to investigate.

Do we need to use pipx here?

We can either:

  1. Install pipx under the proper python, then proceed as usual
  2. Just use pip itself to install nox and poetry

Happy to help with either.

paw-lu commented 2 years ago

Think your reasoning is right btw, on the 3.10 runs my pipx uses 3.8.

runner@fv-az426-664:~/work/nbpreview/nbpreview$ pipx runpip nox '--version'
pip 22.1 from /opt/pipx/shared/lib/python3.8/site-packages/pip (python 3.8)
runner@fv-az426-664:~/work/nbpreview/nbpreview$ python -V
Python 3.10.4
paw-lu commented 2 years ago

Related:

paw-lu commented 2 years ago

We can either:

  1. Install pipx under the proper python, then proceed as usual
  2. Just use pip itself to install nox and poetry
  1. is use an action to handle installing poetry: snok/install-poetry.