Skip to content

Example of pyproject.toml for a namespace package? #600

Answered by frostming
waydegilliam asked this question in Q&A
Discussion options

You must be logged in to vote

The file structure of the namespace package should be:

company_name
    core
        __init__.py
        ...
pyproject.toml

The includes value of the projects should be includes = ["company_name"]

The namespace package is company_name instead of core, i.e. you can have company_name.utils, company_name.others as standalone packages, all belong to the namespace company_name. The project name company_name.core just acts as an identifier, with no special meanings. You can name it as company_name_core and it will still be imported with import company_name.core. The file structure is what changes the rule.

See https://github.com/pdm-project/pdm-pep517 as an example

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by waydegilliam
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants