diff --git a/.gitignore b/.gitignore index d67139b..3f35be3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ __pycache__ .coverage -.mypy_cache -.pytest_cache +.*_cache .venv *.egg-info _build diff --git a/pyproject.toml b/pyproject.toml index 22c064f..b0e1144 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,10 @@ dev = [ "sphinx-rtd-theme", ] +[tool.uv] +cache-dir = "./.uv_cache" +cache-keys = [{ file = "pyproject.toml" }, { git = { commit = true } }] + [tool.setuptools_scm] write_to = "src/python_training_project/version.py" diff --git a/tools/build-docs.sh b/tools/build-docs.sh index 0e23634..1f50455 100755 --- a/tools/build-docs.sh +++ b/tools/build-docs.sh @@ -3,6 +3,10 @@ # Get Git root directory REPO_ROOT=$(git rev-parse --show-toplevel) +# Force the uv cache directory to be located in the repository root +# to avoid permission issues within CI/CD environments. +export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache" + pushd "${REPO_ROOT}" 2>&1 > /dev/null echo "Building documentation..." diff --git a/tools/build-package.sh b/tools/build-package.sh index 02b97db..56c1fe7 100755 --- a/tools/build-package.sh +++ b/tools/build-package.sh @@ -3,6 +3,10 @@ # Get Git root directory REPO_ROOT=$(git rev-parse --show-toplevel) +# Force the uv cache directory to be located in the repository root +# to avoid permission issues within CI/CD environments. +export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache" + pushd "${REPO_ROOT}" 2>&1 > /dev/null echo "Building package..." diff --git a/tools/deploy-package.sh b/tools/deploy-package.sh index 9640e45..c28ee31 100755 --- a/tools/deploy-package.sh +++ b/tools/deploy-package.sh @@ -3,6 +3,10 @@ # Get Git root directory REPO_ROOT=$(git rev-parse --show-toplevel) +# Force the uv cache directory to be located in the repository root +# to avoid permission issues within CI/CD environments. +export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache" + pushd "${REPO_ROOT}" 2>&1 > /dev/null echo "Deploying package..." diff --git a/tools/lint-package.sh b/tools/lint-package.sh index ae9d0f0..de6490f 100755 --- a/tools/lint-package.sh +++ b/tools/lint-package.sh @@ -3,6 +3,10 @@ # Get Git root directory REPO_ROOT=$(git rev-parse --show-toplevel) +# Force the uv cache directory to be located in the repository root +# to avoid permission issues within CI/CD environments. +export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache" + pushd "${REPO_ROOT}" 2>&1 > /dev/null mkdir -p build diff --git a/tools/test-package.sh b/tools/test-package.sh index 3b19333..ef5dff3 100755 --- a/tools/test-package.sh +++ b/tools/test-package.sh @@ -3,6 +3,10 @@ # Get Git root directory REPO_ROOT=$(git rev-parse --show-toplevel) +# Force the uv cache directory to be located in the repository root +# to avoid permission issues within CI/CD environments. +export UV_CACHE_DIR="${REPO_ROOT}/.uv_cache" + pushd "${REPO_ROOT}" 2>&1 > /dev/null mkdir -p build