Open jsirois opened 2 years ago
The vendor importer is installed here: https://github.com/pantsbuild/pex/blob/98c2640602ed3d2820f8e4f66dadc6c59df120dd/pex/pex_bootstrapper.py#L577-L587
And that leads to the issue via: https://github.com/pantsbuild/pex/blob/98c2640602ed3d2820f8e4f66dadc6c59df120dd/pex/third_party/__init__.py#L262-L279 https://github.com/pantsbuild/pex/blob/98c2640602ed3d2820f8e4f66dadc6c59df120dd/pex/third_party/__init__.py#L167-L175
The two module iterator implementations both assume packages have dunder-inits in them: https://github.com/pantsbuild/pex/blob/98c2640602ed3d2820f8e4f66dadc6c59df120dd/pex/third_party/__init__.py#L82-L93 https://github.com/pantsbuild/pex/blob/98c2640602ed3d2820f8e4f66dadc6c59df120dd/pex/third_party/__init__.py#L106-L129
The top-level package currently must have a dunder-init for the mechanism to work.
To see the issue in action 1st:
Then:
And the fix is just to add a dunder-init:
The key difference is before not "seeing" the inner package:
And after, "seeing" it: