I just tried to add some python scripts (executabl...
# general
p
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
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
Nah. I will wait for the fix. I should probably work on something else for awhile anyway.
1
h