https://pantsbuild.org/ logo
p

proud-dentist-22844

04/13/2021, 6:53 PM
I just tried to add some python scripts (executables in a bin/ dir) to
python_library(sources=)
but it says:
Copy code
InvalidFieldException: The 'sources' field in target st2auth/bin must only contain files that end in one of ['.py', '.pyi'], but it had these files: ['st2auth/bin/st2auth'].

Maybe create a `resources()` or `files()` target and include it in the `dependencies` field?
If I add them as resources() or files() the linters won’t be applied to them, right? How do I correctly add scripts that do not have a .py extension?
h

hundreds-father-404

04/13/2021, 7:01 PM
Hm that's a good point that it is valid to have a Python script with no file ending. Pants was being overly opinionated here. Will fix Would you be interested in a temporary workaround? It requires setting up a very light weight target definition with the Plugin API and using that custom target type in your BUILD file. To be clear, this is only a workaround and the proper fix will go out soon
p

proud-dentist-22844

04/13/2021, 7:03 PM
Nah. I will wait for the fix. I should probably work on something else for awhile anyway.
1
h

hundreds-father-404

04/13/2021, 8:09 PM
5 Views