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
8 changes: 2 additions & 6 deletions dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ multirun(
] + [
":requirements.update",
":uv_lock.update",
"//examples:bzlmod_requirements_3_12.update",
"//examples:bzlmod_requirements_3_12_windows.update",
"//examples:bzlmod_requirements_3_13.update",
"//examples:bzlmod_requirements_3_13_windows.update",
"//examples:bzlmod_requirements_3_14.update",
"//examples:bzlmod_requirements_3_14_windows.update",
"//examples:bzlmod_other_module_uv_lock.update",
"//examples:bzlmod_uv_lock.update",
"//tests/multi_pypi/alpha:requirements.update",
"//tests/multi_pypi/beta:requirements.update",
"//tests/uv/lock/pyproject_toml:requirements.update",
Expand Down
85 changes: 8 additions & 77 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,88 +18,19 @@ load("@rules_python//python/uv/private:lock.bzl", "lock") # buildifier: disable
licenses(["notice"]) # Apache 2.0

lock(
name = "bzlmod_requirements_3_12",
name = "bzlmod_uv_lock",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_lock_3_12.txt",
args = [
"--emit-index-url",
"--universal",
"--python-version=3.12",
],
out = "bzlmod/uv.lock",
directory = "examples/bzlmod",
python_version = "3.12",
python_version = "3.10",
visibility = ["//:__subpackages__"],
)

lock(
name = "bzlmod_requirements_3_12_windows",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_windows_3_12.txt",
args = [
"--emit-index-url",
"--python-platform",
"windows",
"--python-version=3.12",
],
directory = "examples/bzlmod",
python_version = "3.12",
visibility = ["//:__subpackages__"],
)

lock(
name = "bzlmod_requirements_3_13",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_lock_3_13.txt",
args = [
"--emit-index-url",
"--universal",
"--python-version=3.13",
],
directory = "examples/bzlmod",
python_version = "3.13",
visibility = ["//:__subpackages__"],
)

lock(
name = "bzlmod_requirements_3_13_windows",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_windows_3_13.txt",
args = [
"--emit-index-url",
"--python-platform",
"windows",
"--python-version=3.13",
],
directory = "examples/bzlmod",
python_version = "3.13",
visibility = ["//:__subpackages__"],
)

lock(
name = "bzlmod_requirements_3_14",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_lock_3_14.txt",
args = [
"--emit-index-url",
"--universal",
"--python-version=3.14",
],
directory = "examples/bzlmod",
python_version = "3.14",
visibility = ["//:__subpackages__"],
)

lock(
name = "bzlmod_requirements_3_14_windows",
srcs = ["bzlmod/pyproject.toml"],
out = "bzlmod/requirements_windows_3_14.txt",
args = [
"--emit-index-url",
"--python-platform",
"windows",
"--python-version=3.14",
],
directory = "examples/bzlmod",
python_version = "3.14",
name = "bzlmod_other_module_uv_lock",
srcs = ["bzlmod/other_module/pyproject.toml"],
out = "bzlmod/other_module/uv.lock",
directory = "examples/bzlmod/other_module",
python_version = "3.11",
visibility = ["//:__subpackages__"],
)
22 changes: 3 additions & 19 deletions examples/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,11 @@ load("@rules_python//python:py_test.bzl", "py_test")
load("@rules_python//python/uv:lock.bzl", "lock")

# This stanza calls a rule that generates targets for managing pip dependencies
# with uv for a particular python version.
# with uv.
lock(
name = "requirements_3_10",
name = "requirements",
srcs = ["pyproject.toml"],
out = "requirements_lock_3_10.txt",
args = [
"--extra-index-url",
"https://pypi.org/simple/",
],
python_version = "3.10",
)

lock(
name = "requirements_windows_3_10",
srcs = ["pyproject.toml"],
out = "requirements_windows_3_10.txt",
args = [
"--extra-index-url",
"https://pypi.org/simple/",
"--python-platform=windows",
],
out = "uv.lock",
python_version = "3.10",
)

Expand Down
22 changes: 4 additions & 18 deletions examples/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,7 @@ pip.parse(
],
hub_name = "pip",
python_version = "3.10",
# The requirements files for each platform that we want to support.
requirements_by_platform = {
# Default requirements file for needs to explicitly provide the platforms
"//:requirements_lock_3_10.txt": "linux_*,osx_*",
"//:requirements_windows_3_10.txt": "windows_x86_64",
},
uv_lock = "//:uv.lock",
# These modifications were created above and we
# are providing pip.parse with the label of the mod
# and the name of the wheel.
Expand All @@ -239,10 +234,7 @@ pip.parse(
pip.parse(
hub_name = "pip",
python_version = "3.12",
requirements_by_platform = {
"//:requirements_lock_3_12.txt": "linux_*,osx_*",
"//:requirements_windows_3_12.txt": "windows_x86_64,windows_aarch64",
},
uv_lock = "//:uv.lock",
whl_modifications = {
"@whl_mods_hub//:requests.json": "requests",
"@whl_mods_hub//:wheel.json": "wheel",
Expand All @@ -251,10 +243,7 @@ pip.parse(
pip.parse(
hub_name = "pip",
python_version = "3.13",
requirements_by_platform = {
"//:requirements_lock_3_13.txt": "linux_*,osx_*",
"//:requirements_windows_3_13.txt": "windows_x86_64,windows_aarch64",
},
uv_lock = "//:uv.lock",
whl_modifications = {
"@whl_mods_hub//:requests.json": "requests",
"@whl_mods_hub//:wheel.json": "wheel",
Expand All @@ -263,10 +252,7 @@ pip.parse(
pip.parse(
hub_name = "pip",
python_version = "3.14",
requirements_by_platform = {
"//:requirements_lock_3_14.txt": "linux_*,osx_*",
"//:requirements_windows_3_14.txt": "windows_x86_64,windows_aarch64",
},
uv_lock = "//:uv.lock",
whl_modifications = {
"@whl_mods_hub//:requests.json": "requests",
"@whl_mods_hub//:wheel.json": "wheel",
Expand Down
2 changes: 1 addition & 1 deletion examples/bzlmod/other_module/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ load("@rules_python//python/uv:lock.bzl", "lock")
lock(
name = "requirements",
srcs = ["pyproject.toml"],
out = "requirements_lock_3_11.txt",
out = "uv.lock",
python_version = "3.11",
)
2 changes: 1 addition & 1 deletion examples/bzlmod/other_module/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ pip.parse(
# Python versions that DON'T include whatever the root-module's default
# Python version is.
python_version = "3.11",
requirements_lock = ":requirements_lock_3_11.txt",
uv_lock = ":uv.lock",
)
use_repo(pip, "other_module_pip")
1 change: 1 addition & 0 deletions examples/bzlmod/other_module/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[project]
name = "other_module"
version = "0.0.0"
requires-python = ">=3.11"
dependencies = [
"absl-py",
]
10 changes: 0 additions & 10 deletions examples/bzlmod/other_module/requirements_lock_3_11.txt

This file was deleted.

23 changes: 23 additions & 0 deletions examples/bzlmod/other_module/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/bzlmod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[project]
name = "example_bzlmod"
version = "0.0.0"
requires-python = ">=3.10"
dependencies = [
"wheel",
"websockets",
Expand Down
Loading
Loading