Skip to content

Commit

Permalink
feat: Enable header generation
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix committed May 21, 2024
1 parent bbac989 commit 7d7e95a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/typical/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file was autogenerated by uv via the following command:
# bazel run @@//:generate_requirements_txt
--index-url https://pypi.org/simple

click==8.1.7 \
Expand Down
2 changes: 2 additions & 0 deletions examples/typical/requirements_linux.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file was autogenerated by uv via the following command:
# bazel run @@//:generate_requirements_linux_txt
--index-url https://pypi.org/simple

click==8.1.7 \
Expand Down
1 change: 1 addition & 0 deletions uv/private/pip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def _uv_pip_compile(ctx, template, executable):
"{{requirements_txt}}": ctx.file.requirements_txt.short_path,
"{{resolved_python}}": py_toolchain.py3_runtime.interpreter.short_path,
"{{python_platform}}": _python_platform(ctx.attr.python_platform),
"{{label}}": str(ctx.label),
},
)

Expand Down
5 changes: 3 additions & 2 deletions uv/private/pip_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PYTHON_PLATFORM="{{python_platform}}"
RESOLVED_PYTHON="{{resolved_python}}"
REQUIREMENTS_IN="{{requirements_in}}"
REQUIREMENTS_TXT="{{requirements_txt}}"
LABEL="{{label}}"

RESOLVED_PYTHON_BIN="$(dirname "$RESOLVED_PYTHON")"

Expand All @@ -19,10 +20,10 @@ PYTHON_VERSION="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.
$UV pip compile \
--generate-hashes \
--emit-index-url \
--no-header \
--no-strip-extras \
--custom-compile-command "bazel run $LABEL" \
--python-version=$PYTHON_VERSION \
$(echo $PYTHON_PLATFORM) \
-o $REQUIREMENTS_TXT \
$REQUIREMENTS_IN \
$@
"$@"
3 changes: 2 additions & 1 deletion uv/private/pip_compile_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PYTHON_PLATFORM="{{python_platform}}"
RESOLVED_PYTHON="{{resolved_python}}"
REQUIREMENTS_IN="{{requirements_in}}"
REQUIREMENTS_TXT="{{requirements_txt}}"
LABEL="{{label}}"

RESOLVED_PYTHON_BIN="$(dirname "$RESOLVED_PYTHON")"

Expand All @@ -24,8 +25,8 @@ $UV pip compile \
--no-cache \
--generate-hashes \
--emit-index-url \
--no-header \
--no-strip-extras \
--custom-compile-command "bazel run $LABEL" \
--python-version=$PYTHON_VERSION \
$(echo $PYTHON_PLATFORM) \
-o __updated__ \
Expand Down

0 comments on commit 7d7e95a

Please sign in to comment.