Is there a reason the following is not supported? ...
# general
r
Is there a reason the following is not supported? I want to include every
python_sources
target in a subdirectory as a dependency for a
python_distribution
target.
Copy code
UnsupportedWildcardError: The address `./xyz::` from the `dependencies` field from the target abc:def ended in a wildcard (`::`), which is not supported.
e
Yes, it's being opinionated about
import *
being a bad thing generally.
You can only glob on the CLI, not in BUILD.
Well, you can glob sources in certain targets, but not dependencies.
r
So previously I had everything globbed together in a single
python_sources
target that fed into my
python_distribution
target. However, I want to add
resources
targets for some of these targets. I could use
overrides
and that's the direction I'm going to go but it would be a lot cleaner if I could have the source and resource targets in the same build file.
e
They always can be in the same BUILD if you're willing to lift the BUILD to the shared ancestor directory of all such files needed, .py and resource.
By definition you can always use exactly 1 BUILD in the repo root that contains all metadata. Not that that would generally be the thing to do.
r
Would it be possible to use a macro and generate each
python_source
and
resource
target individually and then be able to link the related ones together as part of the macro? Afaik I can't import anything in a build file but maybe there's a way to do this using the
build_file_dir
?
e
I'm not sure, try it out. I have no clue about the last bit; I'm unfamiliar with
build_file_dir
.