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

fix: pip cache key would be empty and couldn't use naked versions [APE-1179] #25

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jul 8, 2023

fixes: #24
Fixes: APE-1179

  1. fix: Fixes an issue where the GitHub action would not use an updated version of Ape when it existed when you excluded ape-version-pin. This was quite problematic and explains some anomalies we have seen. Basically, the cache key was just pip-38- and if you updated Ape, it would not care and would use the Ape from the cache.

To fix this, now, if you exclude ape-version-pin, we will lookup the latest version from pypi and use that rather than an empty pip install command. This way, we can properly cache the version ahead of time as well as check for the existence of the key. Now, when an Ape is released in between when a PR is first opened and when subsequent pushes to the PR's branch are done, it will update and use the newer Ape.

  1. feat: Allows for setting versions without constraints. Before, if you tried to use 0.6.12 as the ape-version-pin value, it would error because it was expecting something like ==0.6.12. That is not always obvious. It is nice that we support that but it is weird to not allow naked versions as well. So this PR allows setting versions normally.

  2. test: add test matrices for each of the parameter types you can provider for ape-version-pin. These tests helped me immensely (TDD).

  3. chore: run prettier and add a .prettierrc to try and match the existing style

@antazoey antazoey force-pushed the fix/pip-cache branch 8 times, most recently from 4dfe62a to c141eba Compare July 8, 2023 17:22
@antazoey antazoey changed the title fix: pip cache [APE-1179] fix: pip cache key would be empty [APE-1179] Jul 8, 2023
@antazoey antazoey changed the title fix: pip cache key would be empty [APE-1179] fix: pip cache key would be empty and couldn't use naked versions [APE-1179] Jul 8, 2023
@antazoey antazoey requested a review from fubuloubu July 8, 2023 17:45
@antazoey
Copy link
Member Author

antazoey commented Jul 8, 2023

and if you look at the test output for the (default) case, you will see the cache key is correctly including 0.6.12 in the key, so if 0.6.13 were to be released, it would not be a cache hit and would re-install ape

@fubuloubu
Copy link
Member

Should probably release this as a new major?

@antazoey
Copy link
Member Author

antazoey commented Jul 8, 2023

Should probably release this as a new major?

ok but let me try to fix a few other things first then

@antazoey antazoey merged commit 8b89129 into ApeWorX:main Jul 8, 2023
@antazoey antazoey deleted the fix/pip-cache branch July 8, 2023 23:03
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.

pip won't update when you don't set ape-version-pin [APE-1179]
2 participants