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

fierce-park-88503

01/15/2019, 1:11 AM
I have some more questions about building python wheels out of pants targets. so say I have two libraries that I want to expose for external, non-pants usage: src/python/my_org/foo/bar, and src/python/my_org/baz. I build both wheels. the first will contain a package my_org.foo.bar, and the second will contain a package my_org.baz
since these two wheels both define a top-level ‘my_org’ package, doesn’t this mean that the two wheels can’t be used together in a project?
and if so, is there any way to get pants to structure the wheels in a way where they could be used together?
e

enough-analyst-54434

01/15/2019, 1:49 AM
They can, but to be clear, this is not a pants thing, it's a python thing. You need to declare a "namespace package" for
my_org
. This is most popularly done by adding a dependency on setuptools and using
__import__('pkg_resources').declare_namespace(__name__)
in
my_org/__init__.py
. see here: https://setuptools.readthedocs.io/en/latest/setuptools.html#namespace-packages
👍 3
10 Views