Python namespace conflict between locale sources and installed module

27 views Asked by At

I have a suite of python library using the same namespace (following PEP 420 and https://packaging.python.org/en/latest/guides/packaging-namespace-packages) in multiple git repositories. I am using poetry to manage dependencies and build the wheels that are uploaded to a private python package repository.

I added the library subpackage_a as dependency of subpackage_b. subpackage_a is now installed in mysubpackage_b poetry virtual environment, used to develop and run tests of this last.

Python is prioritizing the import from the site-packages so I'm able to import the dependency mynamespace.subpackage_a but not the locale module mynamespace.subpackage_b anymore.

Of course, if I build and install subpackage_b, it can import both, but I'm looking for a way to make it work from the source code so I can have a decent development experience.

I tried to explicit the path where my source are located in the PYTHONPATH. The pyproject.toml contains:

[tool.poetry]
name = "mynamespace-subpackage-b"
version = "1.0.0"
description = ""
authors = ["author"]
packages = [
  {include = "mynamespace"}
]
0

There are 0 answers