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

Make default cache-dependency-path paths fit most use cases #261

Open
ssbarnea opened this issue Jan 29, 2025 · 4 comments
Open

Make default cache-dependency-path paths fit most use cases #261

ssbarnea opened this issue Jan 29, 2025 · 4 comments

Comments

@ssbarnea
Copy link

ssbarnea commented Jan 29, 2025

The current default value for cache-dependency-glob is not flexible enough to be used by most people.

cache-dependency-glob: |
  **/requirements*.txt
  **/uv.lock

A more generic value like below should cover over 99.5% of use cases:

cache-dependency-glob: |
  **/*(requirements|constraints)*.(txt|in)
  **/pyproject.toml
  **/uv.lock

Reasoning:

  • There is no clear winner in battle between sort-friendly and english-syntax: test-requirements.txt vs requirements-test.txt, so supporting only one will affect ~50% users
  • constraints.txt is very popular against those using constraint files
  • lots of users are using .in instead of .txt extension because this is friendly with tools like dependabot, which can cause problems when mixing lock files with unlocked ones. .in is a way of saying that the file is clearly not a lock file.
  • pyproject.toml should not need any explanation
  • Not having a set of defaults that work for most users makes it harder to reuse the action, especially by other reusable actions/workflows, as users will need to find a way to pass customizations to the reused action. With a generic enough default, the need to it disappears.
@ssbarnea ssbarnea changed the title Related default cache-dependency-path paths Make default cache-dependency-path paths fit most use cases Jan 29, 2025
@eifinger
Copy link
Collaborator

I didn't know about people using *.in files. Also, a quick GitHub search shows ~40k uses of constraints.txt. So I am fully for adding these to the default.

I am not sold on pyproject.toml. There are changes to e.g. tool configs like ruff, mypy and other stuff that doesn't need to invalidate the setup-uv cache. I am also unsure why it should be added when a we already have requirements.txt and uv.lock. For users not committing the lock file?

@eifinger
Copy link
Collaborator

I am not sold on pyproject.toml.

Usecases like running multiple jobs with different resolution strategies. It makes no sense to commit a lock file.

@eifinger
Copy link
Collaborator

I will add this as a new default.

I contemplating whether to release it as part of a new major release. This isn't really breaking anything but might be unexpectively busting caching and increasing sizes.

@patcon
Copy link

patcon commented Feb 22, 2025

Thanks for this issue and consideration! Re: pyproject.toml

Usecases like running multiple jobs with different resolution strategies. It makes no sense to commit a lock file.

Also, people building testing general libraries that shouldn't include a lockfile

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

No branches or pull requests

3 participants