Hi, is it possible to override an undeclared first...
# general
a
Hi, is it possible to override an undeclared first-party dependency? I have a directory containing 2 python source files, say
a.py
and
b.py
.
a.py
depends on
b.py
without explicitly importing it. I also have a BUILD file containing
python_sources
target. Is there a way to tell pants that
a
depends on
b
so that it's properly packaged in pexes?
f
Use the
overrides
attribute on
python_sources
to set the dependency. https://www.pantsbuild.org/docs/reference-python_sources#codeoverridescode
Probably:
Copy code
overrides={
  "a.py": {
    "dependencies": ["b.py"],
  }
}
a
Thanks, I found it before, but had some trouble pulling it off for first-party dependencies. Finally I had to use relative path for b.py:
"dependencies": ["./b.py"]
Anyway, it works. Thanks 🙂
f
Can you open an issue re the need for the
./
? That seems like a bug to me.
a
Sure, I can do that a bit later today. I'll try to setup a simple example and check if I can reproduce it then
f
Thanks!