Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Updated pip from 25.3 to 26.0.1. ([#508](https://github.com/heroku/buildpacks-python/pull/508))
- Explicitly configured uv to use hard links to maintain the behaviour of previous versions. ([#519](https://github.com/heroku/buildpacks-python/pull/519))

## [5.1.0] - 2026-02-26

Expand Down
12 changes: 10 additions & 2 deletions src/layers/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub(crate) fn install_uv(
},
)?;

// Prevent uv from downloading/using its own Python installation:
// https://docs.astral.sh/uv/concepts/python-versions/#disabling-automatic-python-downloads
let mut layer_env = LayerEnv::new()
// Prevent uv from downloading/using its own Python installation:
// https://docs.astral.sh/uv/concepts/python-versions/#disabling-automatic-python-downloads
.chainable_insert(
Scope::Build,
ModificationBehavior::Override,
Expand All @@ -53,6 +53,14 @@ pub(crate) fn install_uv(
ModificationBehavior::Override,
"UV_PYTHON_DOWNLOADS",
"never",
)
// Force uv to use hardlinks rather than the new default of reflinks, since the latter are
// significantly slower in some environments: https://github.com/astral-sh/uv/issues/18259
.chainable_insert(
Scope::Build,
ModificationBehavior::Override,
"UV_LINK_MODE",
"hardlink",
);

match layer.state {
Expand Down
1 change: 1 addition & 0 deletions tests/uv_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ fn uv_basic_install_and_cache_reuse() {
PYTHONUNBUFFERED=1
SOURCE_DATE_EPOCH=315532801
UV_CACHE_DIR=/layers/heroku_python/uv-cache
UV_LINK_MODE=hardlink
UV_NO_MANAGED_PYTHON=1
UV_PROJECT_ENVIRONMENT=/layers/heroku_python/venv
UV_PYTHON_DOWNLOADS=never
Expand Down