1- # Regression: pyproject.toml name = "rdflib-linux" (hyphens, standard Python convention)
2- # causes uv_hub to emit config_setting(name = "rdflib-linux", ...) with the raw name.
3- # A user writing dep_group = "rdflib_linux" (underscores, natural Bazel convention)
4- # gets a mismatch: flag "rdflib_linux" ≠ config_setting "rdflib-linux", so
5- # compatible_with() falls through to //conditions:default and emits
6- # @@platforms//:incompatible for the entire rdflib alias.
7- #
8- # Fix: normalize dep_group names in uv_hub (replace "-" → "_") before emitting
9- # config_setting targets and flag_values.
101load ("@aspect_rules_py//py:defs.bzl" , "py_test" )
112load ("@rules_shell//shell:sh_test.bzl" , "sh_test" )
123
13- # This sh_test reads the hub's generated dep_group/BUILD.bazel via exports_files()
14- # — a source-file target that carries NO target_compatible_with, so incompatibility
15- # does NOT propagate here. The test runs in //... and FAILS while the bug exists.
16- #
17- # Root cause it checks: uv_hub emits config_setting(name = "rdflib-linux") using the
18- # raw pyproject.toml [project].name. A user writing dep_group = "rdflib_linux"
19- # (underscore, Bazel convention) gets no match → @@platforms//:incompatible.
20- # Fix: normalize dep_group names with normalize_name() in uv_hub/repository.bzl.
4+ # Regression: hyphenated [project].name caused config_setting names with hyphens,
5+ # breaking dep_group = "rdflib_linux" (underscore) matching. Fix: normalize_name().
216sh_test (
227 name = "dep_group_names_normalized" ,
238 srcs = ["check_dep_group_names.sh" ],
@@ -26,33 +11,12 @@ sh_test(
2611 target_compatible_with = ["@platforms//os:linux" ],
2712)
2813
29- # Vector 1: hyphen/underscore mismatch.
30- # pyproject.toml name = "rdflib-linux" → hub config_setting = "rdflib-linux".
31- # dep_group = "rdflib_linux" (underscore) doesn't match → @@platforms//:incompatible.
3214py_test (
3315 name = "rdflib_linux" ,
3416 srcs = ["__test__.py" ],
3517 dep_group = "rdflib_linux" ,
3618 main = "__test__.py" ,
3719 python_version = "3.11" ,
3820 target_compatible_with = ["@platforms//os:linux" ],
39- deps = [
40- "@pypi_rdflib_linux//rdflib" ,
41- ],
42- )
43-
44- # Vector 2: multi-project hub, rdflib only in one project.
45- # "other" project shares @pypi_rdflib_linux but has no rdflib dependency.
46- # Building with dep_group = "other" → rdflib alias has no matching arm
47- # for "other" → //conditions:default → @@platforms//:incompatible.
48- py_test (
49- name = "rdflib_wrong_dep_group" ,
50- srcs = ["__test__.py" ],
51- dep_group = "other" ,
52- main = "__test__.py" ,
53- python_version = "3.11" ,
54- target_compatible_with = ["@platforms//os:linux" ],
55- deps = [
56- "@pypi_rdflib_linux//rdflib" ,
57- ],
21+ deps = ["@pypi_rdflib_linux//rdflib" ],
5822)
0 commit comments