Hello! I am attempting to add a custom publisher s...
# general
l
Hello! I am attempting to add a custom publisher so i can publish pex binaries internally. Reading though https://www.pantsbuild.org/docs/common-plugin-tasks and the helm publish goal, docker publish goal, and twine publish goal i’m having some issue figuring out how i could extend pants to have rules that would execute for a pex_binary target to run a publish for pex_binary. Here’s an example of one of my iterations. I’m aware that i’m missing quite a bit in the example code (such as actually getting the packaged pex) but right now i’m just trying to get anything to run. I also tried doing something similar to run_pex_binary where the rule took in
PexBinaryFieldSet
and returned
PublishProcesses
but had the same issue. Here’s the warning I’m getting
Copy code
19:00:17.98 [WARN] No applicable files or targets matched. The `publish` goal works with these target types:

  * python_distribution

However, you only specified target arguments with these target types:

  * pex_binary
here’s what i’m running
Copy code
pants --filter-target-type=pex_binary publish //:pex-test
should note if i run the below command the pex package executes fine.
Copy code
pants --filter-target-type=pex_binary package //:pex-test
e
Your
PublishPexPackageRequest
looks mighty thin. I just went and read the 1st sentence of its base class doc string: https://github.com/pantsbuild/pants/blob/e564fc1db5b34d4a59346b376895847a60a31c8e/src/python/pants/core/goals/publish.py#L61-L84 I think you can figure it out if you re read those docs closely. Ditto most of the API types your using.
l
thanks! i was able to get past my issue by adding
*PublishPexPackageFieldSet.rules()
to my returned rules. Also that comment was useful for understanding how to use FieldSets. Appreciate the help!