-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix: Use correct version of Python for poetry
tests
#208
Conversation
This fixes a bug whereby the runner's system Python was used instead of the version we want. Also add caching for poetry packages.
0c09d9a
to
da402bc
Compare
uses: abatilo/actions-poetry@v3.0.0 | ||
with: | ||
poetry-version: 1.2.2 | ||
cache: pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want poetry
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. As it stands it will cache the packages used by this project (i.e. cookiecutter and pytest) but not the ones used in the generated template project. I did try setting this value to poetry
but it complained there was no poetry.lock
in the root folder 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using pip for cache is fine here. There are two different environments being installed, the poetry one is the one that the specification for is build dynamically by cookiecutter within this workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible, I do wonder what change in the setup-poetry action caused this to fail. It might be worth checking because it could be better than manually using pipx
uses: abatilo/actions-poetry@v3.0.0 | ||
with: | ||
poetry-version: 1.2.2 | ||
cache: pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using pip for cache is fine here. There are two different environments being installed, the poetry one is the one that the specification for is build dynamically by cookiecutter within this workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me. It is something we had changed in other places, so merely an oversight not changing it also here.
Description
This PR changes the GitHub workflows from using the
setup-poetry
action to manually installingpoetry
viapipx
instead. This fixes an issue we're seeing on the Windows runner where the runner's system version of Python is being used by poetry rather than the one we specify (i.e. 3.12).Interestingly, we had already updated this in the workflows for the template (i.e. the ones which will end up in users' repos) but must have forgotten to do the same for this repo's workflows.
Type of change
Key checklist
python -m pytest
)pre-commit run --all-files
)Further checks