Skip to content

Commit 781d9ea

Browse files
committed
Move uv cache to repo root
1 parent 7fb64d3 commit 781d9ea

File tree

7 files changed

+25
-2
lines changed

7 files changed

+25
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
__pycache__
22
.coverage
3-
.mypy_cache
4-
.pytest_cache
3+
.*_cache
54
.venv
65
*.egg-info
76
_build

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ dev = [
4848
"sphinx-rtd-theme",
4949
]
5050

51+
[tool.uv]
52+
cache-dir = "./.uv_cache"
53+
cache-keys = [{ file = "pyproject.toml" }, { git = { commit = true } }]
54+
5155
[tool.setuptools_scm]
5256
write_to = "src/python_training_project/version.py"
5357

tools/build-docs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Get Git root directory
44
REPO_ROOT=$(git rev-parse --show-toplevel)
55

6+
# Force the uv cache directory to be located in the repository root
7+
# to avoid permission issues within CI/CD environments.
8+
export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache"
9+
610
pushd "${REPO_ROOT}" 2>&1 > /dev/null
711

812
echo "Building documentation..."

tools/build-package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Get Git root directory
44
REPO_ROOT=$(git rev-parse --show-toplevel)
55

6+
# Force the uv cache directory to be located in the repository root
7+
# to avoid permission issues within CI/CD environments.
8+
export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache"
9+
610
pushd "${REPO_ROOT}" 2>&1 > /dev/null
711

812
echo "Building package..."

tools/deploy-package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Get Git root directory
44
REPO_ROOT=$(git rev-parse --show-toplevel)
55

6+
# Force the uv cache directory to be located in the repository root
7+
# to avoid permission issues within CI/CD environments.
8+
export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache"
9+
610
pushd "${REPO_ROOT}" 2>&1 > /dev/null
711

812
echo "Deploying package..."

tools/lint-package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Get Git root directory
44
REPO_ROOT=$(git rev-parse --show-toplevel)
55

6+
# Force the uv cache directory to be located in the repository root
7+
# to avoid permission issues within CI/CD environments.
8+
export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache"
9+
610
pushd "${REPO_ROOT}" 2>&1 > /dev/null
711

812
mkdir -p build

tools/test-package.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# Get Git root directory
44
REPO_ROOT=$(git rev-parse --show-toplevel)
55

6+
# Force the uv cache directory to be located in the repository root
7+
# to avoid permission issues within CI/CD environments.
8+
export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache"
9+
610
pushd "${REPO_ROOT}" 2>&1 > /dev/null
711

812
mkdir -p build

0 commit comments

Comments
 (0)