Skip to content

poly deps --interface reports false positives for __all__ = core.__all__ #418

@zed

Description

@zed

Given comp/__init__.py for a polylith component:

from .core import *

__all__ = core.__all__

where comp/core.py may contain:

__all__ = ["pub_func"]

def pub_func():
    pass

When poly --brick comp --interface is run
Then I see unexpected warning (something like):

ℹ Found in another_comp: pub_func is not part of the public interface of comp.

And if I replace core.__all__ with its content: ["pub_func"]
Then there is no errors (the desired outcome). It correctly reports (something like):

comp exposes:
pub_func

I borrowed the idiom for building a flat __all__ for a package from its nested modules from the stdlib's asyncio module:
https://github.com/python/cpython/blob/59d3594ca12939dea0a537d9964d8d637546855c/Lib/asyncio/__init__.py#L7-L42

polylith-cli 1.42.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions