-
-
Save huonw/73b947b318b115a298f0bcf57e6a0d51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[GLOBAL] | |
pants_version = "2.14.0" | |
backend_packages = [ | |
"pants.backend.python", | |
] | |
[python] | |
interpreter_constraints = ["CPython==3.9.*"] | |
[anonymous-telemetry] | |
enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pants --version | |
#> 2.14.0 | |
mkdir -p dir/ | |
cat > dir/BUILD <<EOF | |
python_sources() | |
pex_binary(name="pex1", entry_point="x.py") | |
pex_binary(name="pex2", entry_point="x.py") | |
EOF | |
cat > dir/x.py <<EOF | |
print("hello") | |
EOF | |
# BUG | |
pants run dir/x.py | |
#> 12:35:45.25 [ERROR] 1 Exception encountered: | |
#> | |
#> TooManyTargetsException: The `run` goal only works with one valid target, but was given multiple valid targets: | |
#> | |
#> * dir/x.py | |
#> * dir:pex1 | |
#> * dir:pex2 | |
#> | |
#> Please select one of these targets to run. | |
# OK: workaround (hard to deduce from above output) | |
pants run dir/x.py:dir | |
#> hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment