famous-kite-46295
07/11/2024, 5:04 PMtarget
to create an alias (as described in the docs) but looks like that approach only works for depending on that target, not give people a nicer command to run a script:
NoApplicableTargetsException: No applicable files or targets matched. The `run` goal works with these target types:
* pex_binary
* python_requirement
* python_source
* python_test
However, you only specified target arguments with these target types:
* target
Is there a recommended alternative? Defining a pex-binary where I would have defined the target, but including the source file that the alias would have pointed to?wide-midnight-78598
07/11/2024, 6:02 PMfamous-kite-46295
07/11/2024, 6:12 PMpants run my/path/to/some/file/in/a/subfolder/my_script.py
accessible under pants run less/deep:my_script
. Based on the docs I was hoping to use the target
for such an alias. But seems such an alias target can only be used a dependency, not with pants run
broad-processor-92400
07/11/2024, 11:08 PM[cli.alias]
configured in `pants.toml`: https://www.pantsbuild.org/2.21/docs/using-pants/advanced-target-selection#using-cli-aliases
[cli.alias]
run-my-script = "run my/path/to/some/file/in/a/subfolder/my_script.py" # used like `pants run-my-script`
my-script = "my/path/to/some/file/in/a/subfolder/my_script.py" # used like `pants run my-script`