Skip to content
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

CI: Fix poetry caching #133

Merged
merged 1 commit into from
Oct 16, 2024
Merged

CI: Fix poetry caching #133

merged 1 commit into from
Oct 16, 2024

Conversation

alexdewar
Copy link
Collaborator

I followed @AdrianDAlessandro's suggestion in the issue and changed to installing poetry via pipx before the setup-python step.

Fixes #103.

I followed @AdrianDAlessandro's suggestion in the issue and changed to installing `poetry` via `pipx` before the `setup-python` step.

Fixes #103.
Copy link
Contributor

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this fixes the caching issue... why?

@alexdewar
Copy link
Collaborator Author

@dalonsoa The problem is that seemingly you need poetry installed before the setup-python action runs, else the caching doesn't work. And the poetry action we were using doesn't work for this.... Is that right, @AdrianDAlessandro?

Copy link
Contributor

@AdrianDAlessandro AdrianDAlessandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalonsoa The problem is that seemingly you need poetry installed before the setup-python action runs, else the caching doesn't work. And the poetry action we were using doesn't work for this.... Is that right, @AdrianDAlessandro?

Yes, that is also my understanding. But it comes with a risk of a semi-hidden bug.

I noticed that if the python version installed by setup-python doesn't match the version in pyproject.toml, it will fall back on trying to use the default/system python version in the selected OS. Which goes one of two ways:

  1. Succeeds and runs if that version is compatible with pyproject.toml, but will show something like the workflow "test(ubuntu-latest, 3.12)" succeeded when it actually used Python 3.10
  2. Fails if that version is also incompatible with pyproject.toml

Number 2. above is fine, but number 1. is a problem and I'm not sure how to force the workflow to fail in that case (which I think it should)

@alexdewar
Copy link
Collaborator Author

@AdrianDAlessandro Ugh that's kind of annoying. One nasty hack we could do is to add a check for problem 1 on the CI somehow.

@alexdewar alexdewar merged commit 807bd61 into main Oct 16, 2024
9 checks passed
@alexdewar alexdewar deleted the fix-poetry-caching branch October 16, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache poetry fails
3 participants