Skip to content

fix: adding module to export#25

Merged
orest-tokovenko-block merged 2 commits into
mainfrom
fix/DFNS-598-reexport-codegen-models-all
Jun 11, 2026
Merged

fix: adding module to export#25
orest-tokovenko-block merged 2 commits into
mainfrom
fix/DFNS-598-reexport-codegen-models-all

Conversation

@orest-tokovenko-block

@orest-tokovenko-block orest-tokovenko-block commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes reportPrivateImportUsage warnings for downstream consumers importing the auto-generated models from vantage_sdk.models.

Problem

vantage_sdk/models/__init__.py does from .gen_models import * and then declares its own explicit __all__ listing only the hand-written .common models. Per the Python typing spec, an explicit __all__ overrides wildcard re-export and becomes the authoritative public interface. The generated models (Folder, CreateFolder, CreateCostExportSchema, UpdateVirtualTagConfig, etc.) are therefore treated as private re-exports, so consumers get warnings like:

"Folder" is not exported from module "vantage_sdk.models"
  Import from ".folder" instead (reportPrivateImportUsage)

This only affects third-party py.typed consumers, so it does not surface in this repo's own CI.

Fix

  • Import the gen_models module by name so its export list is referenceable
  • Append gen_models.__all__ to the package __all__ so the generated models are part of the public interface
from . import gen_models
...
__all__ += gen_models.__all__

No runtime or logic change: the wildcard already binds the names, the .common overrides still win, and overlapping names are harmless duplicates in __all__. The __all__ += module.__all__ form is used because it is statically recognized by pyright and does not trigger reportUnsupportedDunderAll (folded ] + ...) or ruff RUF005 (unpacking).

Validation

Reproduced in a clean environment with a non-editable py.typed wheel:

  • Before: 4 reportPrivateImportUsage warnings
  • After: 0 warnings

Repo ruff, ruff format, and basedpyright checks remain green.

@orest-tokovenko-block orest-tokovenko-block merged commit 27f095d into main Jun 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant