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

Save cache if packages have been updated #781

Open
LoicGrobol opened this issue Dec 22, 2023 · 1 comment
Open

Save cache if packages have been updated #781

LoicGrobol opened this issue Dec 22, 2023 · 1 comment
Labels
feature request New feature or request to improve the current logic

Comments

@LoicGrobol
Copy link

Description

Automatically force a post-run cache save if packages have been updated.

Justification

Note: Restored cache will not be used if the requirements.txt file is not updated for a long time and a newer version of the dependency is available which can lead to an increase in total build time.

This is quite inconvenient, since it means that as time goes on, when new compatible versions of the dependencies are released, the cache will become staler and staler. Of course a workaround is to pin to specific versions:

The requirements file format allows for specifying dependency versions using logical operators (for example chardet>=3.0.4) or specifying dependencies without any versions. In this case the pip install -r requirements.txt command will always try to install the latest available package version. To be sure that the cache will be used, please stick to a specific dependency version and update it manually if necessary.

But that doesn't necessarily make sense (e.g. for libraries). It's also adds hassle that's unnecessary, since it's not hard to find out whether the versions of the installed packages have changed (just check the output of pip --list and see if that has changed since the last run). This can be done manually with the cache-save and cache-restore actions but it would be more convenient to have it as part of setup-python.

Are you willing to submit a PR?
Yes

@LoicGrobol LoicGrobol added feature request New feature or request to improve the current logic needs triage labels Dec 22, 2023
@dusan-trickovic
Copy link

Hello, @LoicGrobol! Thank you for creating this issue, we will investigate further and see what can be done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

2 participants