You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[project]
name = "some_project"version = "0.1.0"requires-python = ">=3.12"classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"package1",
"package2",
]
Observed Behavior
Even when configuring the uv cache directory on GitHub Actions, the cache is not applied correctly within uv.
Cause
The issue seems to stem from a combination of two factors:
Timestamp updates during git clone: Files managed by Git have their timestamps updated to the clone time. As a result, the source files are always considered "newer" than the cache files, causing uv to bypass the cache.
Reliance on ctime in uv: Since uv uses ctime to determine cache freshness, workarounds like using the touch command cannot be applied.
Ideas
Use hash-based cache management in CI mode
Similar to the --ci option for cache prune, a --ci option for sync and run commands could enable hash-based cache management instead of timestamp-based.
Use mtime instead of ctime
Using mtime would allow workarounds such as touch to function. However, as noted in #1060, this approach may have its own drawbacks and is not ideal.
If there are other potential solutions, please share! Especially if there's a way to resolve this issue with the current version of uv.
The text was updated successfully, but these errors were encountered:
When creating a workspace with multiple sub project, the cache for subdirectories does not work as expected.
uv version
Prerequisites
For example, when running the following in a GitHub Action:
This issue occurs in projects using uv with multiple
pyproject.toml
files, such as the following structure:Here is an example
pyproject.toml
:Observed Behavior
Even when configuring the uv cache directory on GitHub Actions, the cache is not applied correctly within uv.
Cause
The issue seems to stem from a combination of two factors:
git clone
: Files managed by Git have their timestamps updated to the clone time. As a result, the source files are always considered "newer" than the cache files, causing uv to bypass the cache.ctime
in uv: Since uv usesctime
to determine cache freshness, workarounds like using thetouch
command cannot be applied.Ideas
Use hash-based cache management in CI mode
Similar to the
--ci
option forcache prune
, a--ci
option forsync
andrun
commands could enable hash-based cache management instead of timestamp-based.Use
mtime
instead ofctime
Using
mtime
would allow workarounds such astouch
to function. However, as noted in #1060, this approach may have its own drawbacks and is not ideal.If there are other potential solutions, please share! Especially if there's a way to resolve this issue with the current version of uv.
The text was updated successfully, but these errors were encountered: