hundreds-father-404
04/11/2022, 11:26 PMhundreds-father-404
04/11/2022, 11:26 PMdiff --git a/src/python/pants/util/BUILD b/src/python/pants/util/BUILD
index 76d0a50a8..660377f23 100644
--- a/src/python/pants/util/BUILD
+++ b/src/python/pants/util/BUILD
@@ -3,4 +3,7 @@
python_sources()
-python_tests(name="tests")
+python_tests(
+ name="tests",
+ interpreter_constraints=parametrize(py39=["==3.9.*"], py310=[">=3.9"]),
+)
hundreds-father-404
04/11/2022, 11:27 PM./pants test src/python/pants/util:tests
fails and suggest instead src/python/pants/util:tests@interpreter_constraints=py39
and src/python/pants/util:tests@interpreter_constraints=py310
hundreds-father-404
04/11/2022, 11:27 PMhundreds-father-404
04/11/2022, 11:27 PMwitty-crayon-22786
04/11/2022, 11:29 PMsrc/python/pants/util:tests@interpreter_constraints=py39
and src/python/pants/util:tests@interpreter_constraints=py310
… are target generators, yea. they depend on the files that they generatedhundreds-father-404
04/11/2022, 11:30 PMwitty-crayon-22786
04/11/2022, 11:30 PMhundreds-father-404
04/11/2022, 11:31 PMhundreds-father-404
04/11/2022, 11:31 PMhundreds-father-404
04/11/2022, 11:31 PMwitty-crayon-22786
04/11/2022, 11:32 PMMy vague understanding is that we are giving you several degrees of specificityon the CLI, yea… the affordance in BUILD files still resolves to exactly one matching target.
hundreds-father-404
04/11/2022, 11:33 PMwitty-crayon-22786
04/11/2022, 11:33 PMhundreds-father-404
04/11/2022, 11:35 PMdiff --git a/src/python/pants/util/BUILD b/src/python/pants/util/BUILD
index 76d0a50a8..091736175 100644
--- a/src/python/pants/util/BUILD
+++ b/src/python/pants/util/BUILD
@@ -3,4 +3,8 @@
python_sources()
-python_tests(name="tests")
+python_test(
+ name="test",
+ source="strutil_test.py",
+ interpreter_constraints=parametrize(py39=["==3.9.*"], py310=[">=3.9"]),
+)
$ ./pants test src/python/pants/util:test
The address `src/python/pants/util:test` was not generated by the target `src/python/pants/util:test`, which only generated these addresses:
* src/python/pants/util:test@interpreter_constraints=py39
* src/python/pants/util:test@interpreter_constraints=py310
witty-crayon-22786
04/11/2022, 11:45 PMhundreds-father-404
04/11/2022, 11:50 PMhundreds-father-404
04/11/2022, 11:50 PMhundreds-father-404
04/11/2022, 11:52 PMwitty-crayon-22786
04/14/2022, 8:15 PM```Generally, you can still useexample:tests
without thesuffix as an alias to all the@
created targets.```bit