Skip to content

feat(generated): use explicit re-export form in service __init__.py#645

Merged
gjtorikian merged 1 commit intomainfrom
feat/explicit-reexports-in-service-inits
May 1, 2026
Merged

feat(generated): use explicit re-export form in service __init__.py#645
gjtorikian merged 1 commit intomainfrom
feat/explicit-reexports-in-service-inits

Conversation

@gjtorikian
Copy link
Copy Markdown
Contributor

@gjtorikian gjtorikian commented May 1, 2026

Note

Blocked on workos/oagen-emitters#70 landing and being released. This PR is the regenerated output that change produces. Marking as draft until the emitter release is out and the dependency in oagen.config.ts is bumped.

Summary

  • Regenerates all 19 service __init__.py files to use the PEP 484 explicit re-export form (from ._resource import X as X)
  • Fixes pyright reportPrivateImportUsage warnings under strict mode for direct imports of resource-level dataclasses

Why

Customer reported that from workos.user_management import RoleSingle, RoleMultiple triggers a private-import warning under strict pyright. PEP 484 requires either __all__ or X as X aliasing for a name to be considered a public re-export.

The same bug existed in every service __init__.py (not just user_management) — anyone doing from workos.authorization import ResourceTargetById, ParentByExternalId, ... hits the same warning.

What changed

Mechanical, generator-driven edits across 19 service barrels. Example:

-from ._resource import SSO, AsyncSSO
+from ._resource import SSO as SSO, AsyncSSO as AsyncSSO

No API surface changes. No spec changes. Pure re-export form change.

Test plan

  • uv run pytest — 1987 tests pass
  • uv run pyright — 0 errors, 0 warnings
  • Strict-mode pyright (# pyright: strict) on a consumer file no longer warns on from workos.user_management import RoleSingle, RoleMultiple or from workos.authorization import ResourceTargetById

🤖 Generated with Claude Code


Open in Devin Review

Regenerates all 19 service `__init__.py` files to use the PEP 484
explicit re-export form (`from ._resource import X as X`) instead of
bare imports.

Without the `as X` aliasing, pyright in strict mode flags imports like
`from workos.user_management import RoleSingle` as private-import
violations (`reportPrivateImportUsage`). The models barrel already used
the explicit form — this change makes the resource barrel match.

Mechanical change only — no API surface changes. Generated by oagen
after workos/oagen-emitters#70 lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian marked this pull request as ready for review May 1, 2026 17:28
@gjtorikian gjtorikian requested review from a team as code owners May 1, 2026 17:28
@gjtorikian gjtorikian requested a review from alisherry May 1, 2026 17:28
@gjtorikian gjtorikian merged commit 7ecb2e9 into main May 1, 2026
10 of 11 checks passed
@gjtorikian gjtorikian deleted the feat/explicit-reexports-in-service-inits branch May 1, 2026 17:28
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 1, 2026

Greptile Summary

Converts all 19 service __init__.py barrel files from plain from ._resource import X to the PEP 484 explicit re-export form from ._resource import X as X, fixing pyright reportPrivateImportUsage warnings under strict mode. The change is entirely mechanical and generator-driven with no API surface, logic, or behavioural differences.

Confidence Score: 5/5

Safe to merge — pure re-export form change with no runtime behaviour differences.

All 20 changed files are auto-generated barrel modules. The edits are mechanical and exhaustively consistent across every service module. No logic, API surface, or security concerns are affected.

No files require special attention.

Important Files Changed

Filename Overview
.oagen-manifest.json Timestamp updated to reflect regeneration date; no structural changes.
src/workos/authorization/init.py 8 exports (including helper types) converted to explicit re-export form; most complex change in the PR, looks correct.
src/workos/user_management/init.py 6 exports including RoleSingle/RoleMultiple (the originally-reported types) correctly converted.
src/workos/user_management_organization_membership_groups/init.py Long class names correctly aliased in multi-line form.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["oagen generator\n(emitter bump)"] -->|regenerates| B["19 × service __init__.py"]
    B -->|before| C["from ._resource import X"]
    B -->|after| D["from ._resource import X as X\n(PEP 484 explicit re-export)"]
    D --> E["pyright strict mode\nreportPrivateImportUsage ✅ 0 warnings"]
    C --> F["pyright strict mode\nreportPrivateImportUsage ⚠️ warnings"]
Loading

Reviews (1): Last reviewed commit: "feat(generated): use explicit re-export ..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant