Skip to content

Support namespace packages without namespace-packages setting #6114

@charliermarsh

Description

@charliermarsh

Right now, our module discovery doesn't support namespace packages -- or rather, it requires that projects specify namespace packages explicitly via the namespace-packages setting.

I'd like to remove this setting, and ensure that namespace packages "just work".

One option is to take inspiration from Mypy, where they effectively mark a directory without a __init__.py[i] file as a namespace package if it's within a directory that contains an __init__.py[i] file, and provide escape hatches for explicitly specifying package bases.

Another option is to take inspiration Pyright, where AFAICT they allow you to specify multiple roots which are effectively your package bases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreRelated to core functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions