https://pantsbuild.org/ logo
#general
Title
# general
c

cold-journalist-66984

05/20/2020, 4:09 PM
I have a project set up like
Copy code
src/python/thing-i-am-working-on/module.py
src/python/some-other-thing/other_module.py
when I try to run
pants setup-py src/python/thing-i-am-working-on::
I get this error and I’m not sure what to do about it
FAILURE: No exported target owner found for PythonLibrary(BuildFileAddress(src/python/some-other-thing/BUILD, some-other-thing))
Any thoughts on what could be going on here?
w

witty-crayon-22786

05/20/2020, 4:36 PM
@cold-journalist-66984: Sorry for the trouble. “exported” means “has a provides clause that declares where it is exported to”
c

cold-journalist-66984

05/20/2020, 4:58 PM
So do all of the sibling projects need to have a provides clause? For context, there is a root BUILD file at
src/python
and one in each of the sibling projects as well.
w

witty-crayon-22786

05/20/2020, 4:59 PM
no: there is some neat magic there. the task will walk the dependencies of something exportable
if it finds something else exportable, it will declare a dependency on the exportable thing. otherwise, the first exportable module will own anything
so unless you want to further subdivide your graph of published packages, you only need one setup py per “root” thing you are publishing.
c

cold-journalist-66984

05/20/2020, 5:16 PM
So that means my project must have a dependency on the sibling project that I’m not aware of yet, because it’s looking at that project, or am I misunderstanding something?
w

witty-crayon-22786

05/20/2020, 5:19 PM
dependencies are required in Pants, yes… independent of setup_py or not, multiple targets must declare that they depend on one another
c

cold-journalist-66984

05/20/2020, 5:20 PM
Great, thanks for all your help!
w

witty-crayon-22786

05/20/2020, 5:22 PM
sure thing! if you’re just getting started on a python project, the new docsite will guide you through using the “v2” engine, which provides a nicer experience there: https://pants.readme.io/docs/
h

happy-kitchen-89482

05/20/2020, 5:31 PM
Hmm and that reminds me that I should update https://pants.readme.io/docs/python-setup-py-goal with more details about how ownership works in that arena
w

witty-crayon-22786

05/20/2020, 5:35 PM
+1 … it’s pretty neat actually.
👍 1