Skip to content

Commit 8e8f8db

Browse files
authored
Merge pull request #2720 from syedriko/syedriko-lcore-3121
LCORE-3121: [Cleanup] scripts/konflux_requirements.sh vs scripts konflux_resolve.py
2 parents b618926 + e3c28dd commit 8e8f8db

4 files changed

Lines changed: 15 additions & 105 deletions

File tree

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ distribution-archives: ## Generate distribution archives to be uploaded into Pyt
362362
upload-distribution-archives: ## Upload distribution archives into Python registry
363363
uv run python -m twine upload --repository ${PYTHON_REGISTRY} dist/*
364364

365-
konflux-requirements: ## Generate hermetic requirements.*.txt file for Konflux build
366-
./scripts/konflux_requirements.sh
365+
konflux-requirements: ## Generate .konflux/requirements.*.txt files for Konflux hermetic build
366+
scripts/konflux_resolve.py --profile cpu
367367

368368
konflux-rpm-lock: ## Generate rpm.lock.yaml file for Konflux build
369369
./scripts/generate-rpm-lock.sh

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ Update these files when you:
15151515
make konflux-requirements
15161516
```
15171517
1518-
This compiles Python dependencies from `pyproject.toml` using `uv`, splits packages by their source index (PyPI vs Red Hat's internal registry), and generates hermetic requirements files with pinned versions and hashes for Konflux builds.
1518+
This compiles Python dependencies from `pyproject.toml` using a fork of `uv` that supports a "prefer-index" package version resolution policy, splits packages by their source index (PyPI vs Red Hat's internal registry), and generates hermetic requirements files with pinned versions and hashes for Konflux builds.
15191519
15201520
**Files produced:**
15211521
- `.konflux/requirements.hashes.source.txt` – PyPI packages with hashes

‎scripts/konflux_requirements.sh‎

Lines changed: 0 additions & 93 deletions
This file was deleted.

‎scripts/konflux_resolve.py‎

100644100755
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -985,13 +985,8 @@ def load_wheel_only(path: str) -> set[str]:
985985

986986
_UV_COMPILED_RE = re.compile(r"^([a-zA-Z0-9][a-zA-Z0-9._-]*)([=<>!~].*)?$")
987987

988-
989-
UV_BINARY = os.environ.get(
990-
"UV_BINARY",
991-
os.path.join(
992-
os.path.dirname(__file__), "..", "..", "uv", "target", "release", "uv"
993-
),
994-
)
988+
UV_IMAGE = os.environ.get("UV_IMAGE", "quay.io/syedriko/uv:prefer-index")
989+
CONTAINER_RUNTIME = os.environ.get("CONTAINER_RUNTIME", "podman")
995990

996991

997992
def uv_resolve(
@@ -1012,9 +1007,15 @@ def uv_resolve(
10121007
else "requirements.overrides.txt"
10131008
),
10141009
)
1015-
uv = UV_BINARY if os.path.isfile(UV_BINARY) else "uv"
10161010
cmd = [
1017-
uv,
1011+
CONTAINER_RUNTIME,
1012+
"run",
1013+
"--rm",
1014+
"--volume",
1015+
f"{os.getcwd()}:/io:ro",
1016+
"--workdir",
1017+
"/io",
1018+
UV_IMAGE,
10181019
"pip",
10191020
"compile",
10201021
"pyproject.toml",
@@ -1027,6 +1028,8 @@ def uv_resolve(
10271028
rhoai_index_url,
10281029
"--default-index",
10291030
"https://pypi.org/simple/",
1031+
"--index-strategy",
1032+
"prefer-index",
10301033
"--emit-index-annotation",
10311034
"--no-sources",
10321035
"--group",

0 commit comments

Comments
 (0)