Skip to content
Draft
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
3 changes: 3 additions & 0 deletions e2e/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ write_source_files(
name = "snapshots",
testonly = True,
files = {
# @pypi_rdflib_linux — dep_group names must be underscore-normalized.
"snapshots/pypi_rdflib_linux.dep_group.BUILD.bazel": "@pypi_rdflib_linux//dep_group:BUILD.bazel",

# @pypi_multi (multi-project: alpha, beta, gamma)
# ----------------------------------------------------------------
# Per-package alias with multiple select arms. Catches regressions in
Expand Down
2 changes: 2 additions & 0 deletions e2e/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ include("//cases/freethreaded-805:setup.MODULE.bazel")
include("//cases/multi-project-hub:setup.MODULE.bazel")
include("//cases/oci:setup.MODULE.bazel")
include("//cases/pth-namespace-547:setup.MODULE.bazel")
include("//cases/rdflib-linux:setup.MODULE.bazel")
include("//cases/pytest-main-867:setup.MODULE.bazel")
include("//cases/pytest-mock-530:setup.MODULE.bazel")
include("//cases/pytest-subdir-imports:setup.MODULE.bazel")
Expand All @@ -107,6 +108,7 @@ include("//cases/single-project-hub:setup.MODULE.bazel")
include("//cases/unconstrained-dependencies:setup.MODULE.bazel")
include("//cases/uv-abi3-compat-853:setup.MODULE.bazel")
include("//cases/uv-bare-linux-wheels:setup.MODULE.bazel")
include("//cases/uv-hub-cross-project:setup.MODULE.bazel")
include("//cases/uv-conflict-817:setup.MODULE.bazel")
include("//cases/uv-conflict-gte:setup.MODULE.bazel")
include("//cases/uv-conflict-max-863:setup.MODULE.bazel")
Expand Down
6 changes: 3 additions & 3 deletions e2e/cases/firebase-admin-import/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ load("//tools:pth_snapshot.bzl", "extract_venv_pth")
py_test(
name = "test",
srcs = ["test.py"],
dep_group = "firebase-admin-import",
dep_group = "firebase_admin_import",
main = "test.py",
deps = [
"@pypi_firebase_admin_import//firebase_admin",
Expand All @@ -53,7 +53,7 @@ py_test(
py_test(
name = "test_tool",
srcs = ["test.py"],
dep_group = "firebase-admin-import",
dep_group = "firebase_admin_import",
expose_venv = True,
isolated = False,
main = "test.py",
Expand All @@ -73,7 +73,7 @@ py_test(
py_binary(
name = "firebase_importer",
srcs = ["test.py"],
dep_group = "firebase-admin-import",
dep_group = "firebase_admin_import",
main = "test.py",
deps = [
"@pypi_firebase_admin_import//firebase_admin",
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/freethreaded-805/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _LINUX_X86_64 = [
py_test(
name = "test_bin",
srcs = ["test.py"],
dep_group = "freethreaded-test",
dep_group = "freethreaded_test",
main = "test.py",
python_version = "3.13",
tags = ["manual"],
Expand All @@ -46,7 +46,7 @@ platform_transition_test(
py_test(
name = "venv_test_bin",
srcs = ["test.py"],
dep_group = "freethreaded-test",
dep_group = "freethreaded_test",
expose_venv = True,
isolated = False,
main = "test.py",
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/pth-namespace-547/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("//tools:pth_snapshot.bzl", "extract_venv_pth")
py_test(
name = "test",
srcs = ["__test__.py"],
dep_group = "pth-namespace-547",
dep_group = "pth_namespace_547",
expose_venv = True,
isolated = False,
main = "__test__.py",
Expand All @@ -21,7 +21,7 @@ py_test(
py_test(
name = "test_legacy",
srcs = ["__test__.py"],
dep_group = "pth-namespace-547",
dep_group = "pth_namespace_547",
main = "__test__.py",
deps = [
"@pypi_pth_namespace_547//jaraco_classes",
Expand Down
10 changes: 5 additions & 5 deletions e2e/cases/pytest-main-867/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@aspect_rules_py//py:defs.bzl", "py_pytest_main", "py_test")
py_test(
name = "test_example",
srcs = ["test_example.py"],
dep_group = "pytest-main-867",
dep_group = "pytest_main_867",
pytest_main = True,
deps = ["@pypi_pytest_main_867//pytest"],
)
Expand All @@ -15,7 +15,7 @@ py_test(
py_test(
name = "test_naming_regression",
srcs = ["test_example.py"],
dep_group = "pytest-main-867",
dep_group = "pytest_main_867",
pytest_main = True,
deps = ["@pypi_pytest_main_867//pytest"],
)
Expand All @@ -29,7 +29,7 @@ py_test(
"test_a.py",
"test_b.py",
],
dep_group = "pytest-main-867",
dep_group = "pytest_main_867",
pytest_main = True,
deps = ["@pypi_pytest_main_867//pytest"],
)
Expand All @@ -39,7 +39,7 @@ py_test(
py_test(
name = "test_collection_check",
srcs = ["test_collection_check.py"],
dep_group = "pytest-main-867",
dep_group = "pytest_main_867",
pytest_main = True,
deps = ["@pypi_pytest_main_867//pytest"],
)
Expand All @@ -58,7 +58,7 @@ py_test(
"test_a.py",
":test_direct_main",
],
dep_group = "pytest-main-867",
dep_group = "pytest_main_867",
main = ":__test__test_direct_main__.py",
deps = [
":test_direct_main",
Expand Down
4 changes: 2 additions & 2 deletions e2e/cases/pytest-mock-530/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@aspect_rules_py//py:defs.bzl", "py_test")
py_test(
name = "test_mock_py_test",
srcs = ["test_mock.py"],
dep_group = "pytest-mock-530",
dep_group = "pytest_mock_530",
pytest_main = True,
deps = [
"@pypi_pytest_mock_530//pytest",
Expand All @@ -18,7 +18,7 @@ py_test(
"__test__.py",
"test_mock.py",
],
dep_group = "pytest-mock-530",
dep_group = "pytest_mock_530",
expose_venv = True,
isolated = False,
main = "__test__.py",
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/pytest-subdir-imports/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ py_library(
py_test(
name = "test_subdir_import",
srcs = ["tests/test_subdir.py"],
dep_group = "pytest-subdir-imports",
dep_group = "pytest_subdir_imports",
pytest_main = True,
deps = [
":lib",
Expand Down
2 changes: 1 addition & 1 deletion e2e/cases/pytest-xdist-integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ py_test(
"-n",
"2",
],
dep_group = "pytest-xdist-integration",
dep_group = "pytest_xdist_integration",
pytest_main = True,
deps = [
"@pypi_pytest_xdist_integration//pytest",
Expand Down
22 changes: 22 additions & 0 deletions e2e/cases/rdflib-linux/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
load("@aspect_rules_py//py:defs.bzl", "py_test")
load("@rules_shell//shell:sh_test.bzl", "sh_test")

# Regression: hyphenated [project].name caused config_setting names with hyphens,
# breaking dep_group = "rdflib_linux" (underscore) matching. Fix: normalize_name().
sh_test(
name = "dep_group_names_normalized",
srcs = ["check_dep_group_names.sh"],
args = ["$(location @pypi_rdflib_linux//dep_group:BUILD.bazel)"],
data = ["@pypi_rdflib_linux//dep_group:BUILD.bazel"],
target_compatible_with = ["@platforms//os:linux"],
)

py_test(
name = "rdflib_linux",
srcs = ["__test__.py"],
dep_group = "rdflib_linux",
main = "__test__.py",
python_version = "3.11",
target_compatible_with = ["@platforms//os:linux"],
deps = ["@pypi_rdflib_linux//rdflib"],
)
14 changes: 14 additions & 0 deletions e2e/cases/rdflib-linux/__test__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Regression: rdflib must be importable on Linux.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What makes this package unique that caused the bug? Outline it here...


Reported error:
@@aspect_rules_py++uv+pypi//rdflib:rdflib (cae838)
<-- target platform (...:linux_host_platform) didn't satisfy constraint
@@platforms//:incompatible
"""

import rdflib
from rdflib import Graph

g = Graph()
assert rdflib.__version__ == "7.1.1", rdflib.__version__
print("rdflib", rdflib.__version__, "imported and Graph() constructed successfully")
19 changes: 19 additions & 0 deletions e2e/cases/rdflib-linux/check_dep_group_names.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Regression: dep_group config_setting names must be normalized (hyphens → underscores).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the .sh really necessary? The rdflib_linux string is already in the BUILD and I think a comment at the top of the BUILD explaining why rdliflib_linux instead of rdflib-linux is enough and we can avoid the shell script?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rdflib-linux is not enough bc instead of fail is skipped

# If the hub emits config_setting(name = "rdflib-linux"), then dep_group = "rdflib_linux"
# never matches and every package in the hub becomes @@platforms//:incompatible.
set -euo pipefail

BUILD_FILE="${1:?usage: check_dep_group_names.sh <dep_group/BUILD.bazel>}"

if grep -qF '"rdflib-linux"' "$BUILD_FILE"; then
echo "FAIL: config_setting name contains hyphens: 'rdflib-linux'"
echo " dep_group = \"rdflib_linux\" (underscore) will never match it."
echo " uv_hub must normalize project names via normalize_name() before"
echo " emitting config_setting targets and flag_values."
echo ""
grep '"rdflib-linux"' "$BUILD_FILE"
exit 1
fi

echo "PASS: all dep_group config_setting names are underscore-normalized"
8 changes: 8 additions & 0 deletions e2e/cases/rdflib-linux/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "rdflib-linux"
version = "0.0.0"
authors = []
requires-python = ">=3.11"
dependencies = [
"rdflib>=7.0.0",
]
10 changes: 10 additions & 0 deletions e2e/cases/rdflib-linux/setup.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Regression: hyphenated [project].name → config_setting name mismatch → @@platforms//:incompatible.

uv = use_extension("@aspect_rules_py//uv:extensions.bzl", "uv")
uv.declare_hub(hub_name = "pypi_rdflib_linux")
uv.project(
hub_name = "pypi_rdflib_linux",
lock = "//cases/rdflib-linux:uv.lock",
pyproject = "//cases/rdflib-linux:pyproject.toml",
)
use_repo(uv, "pypi_rdflib_linux")
45 changes: 45 additions & 0 deletions e2e/cases/rdflib-linux/uv.lock

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

4 changes: 2 additions & 2 deletions e2e/cases/uv-abi3-compat-853/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load("@aspect_rules_py//py:defs.bzl", "py_test")
py_test(
name = "test_import",
srcs = ["test_abi3.py"],
dep_group = "abi3-compat",
dep_group = "abi3_compat",
main = "test_abi3.py",
python_version = "3.12",
target_compatible_with = ["@platforms//os:linux"],
Expand All @@ -17,7 +17,7 @@ py_test(
py_test(
name = "test_import_venv_test",
srcs = ["test_abi3.py"],
dep_group = "abi3-compat",
dep_group = "abi3_compat",
expose_venv = True,
isolated = False,
main = "test_abi3.py",
Expand Down
12 changes: 12 additions & 0 deletions e2e/cases/uv-hub-cross-project/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@rules_shell//shell:sh_test.bzl", "sh_test")

# Regression: packages must be isolated to the dep_group of the project that declares them.
# rdflib is in rdflib-project; other-project has cowsay only. The rdflib hub alias
# must not contain an other_project arm (cross-project contamination).
sh_test(
name = "cross_project_isolation",
srcs = ["check_cross_project_isolation.sh"],
args = ["$(location @pypi_cross_hub//rdflib:BUILD.bazel)"],
data = ["@pypi_cross_hub//rdflib:BUILD.bazel"],
target_compatible_with = ["@platforms//os:linux"],
)
18 changes: 18 additions & 0 deletions e2e/cases/uv-hub-cross-project/check_cross_project_isolation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

BUILD="${1:?}"

if grep -qF "other_project" "$BUILD"; then
echo "FAIL: rdflib alias contains other_project arm — cross-project contamination"
grep "other_project" "$BUILD"
exit 1
fi

if ! grep -qF "rdflib_project" "$BUILD"; then
echo "FAIL: rdflib alias missing rdflib_project arm"
cat "$BUILD"
exit 1
fi

echo "PASS: rdflib isolated to rdflib_project"
7 changes: 7 additions & 0 deletions e2e/cases/uv-hub-cross-project/other/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exports_files(
[
"pyproject.toml",
"uv.lock",
],
visibility = ["//:__subpackages__"],
)
8 changes: 8 additions & 0 deletions e2e/cases/uv-hub-cross-project/other/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "other-project"
version = "0.0.0"
authors = []
requires-python = ">=3.11"
dependencies = [
"cowsay",
]
22 changes: 22 additions & 0 deletions e2e/cases/uv-hub-cross-project/other/uv.lock

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

8 changes: 8 additions & 0 deletions e2e/cases/uv-hub-cross-project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "rdflib-project"
version = "0.0.0"
authors = []
requires-python = ">=3.11"
dependencies = [
"rdflib>=7.0.0",
]
Loading