Skip to content

Instantly share code, notes, and snippets.

@huonw

huonw/pants.toml Secret

Last active February 8, 2023 01:38
Show Gist options
  • Save huonw/73b947b318b115a298f0bcf57e6a0d51 to your computer and use it in GitHub Desktop.
Save huonw/73b947b318b115a298f0bcf57e6a0d51 to your computer and use it in GitHub Desktop.
[GLOBAL]
pants_version = "2.14.0"
backend_packages = [
"pants.backend.python",
]
[python]
interpreter_constraints = ["CPython==3.9.*"]
[anonymous-telemetry]
enabled = false
#!/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