Pulumi's Policy as Code SDK, CrossGuard. Define infrastructure checks in code to enforce security, compliance, cost, and other practices, enforced at deployment time.
While working on the hackathon project to add python policy decorators, I was running into reportPrivateImportUsage errors from pylance in VS Code:
Diagnostics for incorrect usage of symbol imported from a "py.typed" module that is not re-exported from that module.
In particular, we're doing the following:
If a file __init__.py uses the form “from .A import X”, symbol “A” is not private unless the name begins with an underscore (but “X” is still private).
...with the intention of exporting the X symbol, but per above it is private.
This change addresses the problem, by exporting the symbols using __all__.
Subsequently, we should consider prefixing all other modules with an underscore, as they really are intended to be private.
While working on the hackathon project to add python policy decorators, I was running into
reportPrivateImportUsage
errors from pylance in VS Code:In particular, we're doing the following:
...with the intention of exporting the
X
symbol, but per above it is private.This change addresses the problem, by exporting the symbols using
__all__
.Subsequently, we should consider prefixing all other modules with an underscore, as they really are intended to be private.