Example of pyproject.toml for a namespace package? #600
-
Hello! I'm trying to editable install a local package using a namespace, however I'm doing something wrong in my pyproject.toml (either for the namespace package I'm trying to install or the non-namespace package I'm installing the namespace package to) as the namespace isn't getting recognized but only the package name. For example, "company_name.core_package" can only be imported as "core_package". The pyproject.toml for the local namespace package:
The pyproject.toml for the package I'm trying to editable install for. FYI this is just a package that install jupyter notebook dependencies along with other packages and doesn't have any modules:
I haven't found any examples in the official docs or on GitHub, so any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The file structure of the namespace package should be:
The The namespace package is See https://github.com/pdm-project/pdm-pep517 as an example |
Beta Was this translation helpful? Give feedback.
-
Adding a note for those that find this: It should be |
Beta Was this translation helpful? Give feedback.
The file structure of the namespace package should be:
The
includes
value of the projects should beincludes = ["company_name"]
The namespace package is
company_name
instead ofcore
, i.e. you can havecompany_name.utils
,company_name.others
as standalone packages, all belong to the namespacecompany_name
. The project namecompany_name.core
just acts as an identifier, with no special meanings. You can name it ascompany_name_core
and it will still be imported withimport company_name.core
. The file structure is what changes the rule.See https://github.com/pdm-project/pdm-pep517 as an example