Skip to content

Prefix private modules with underscore #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 4, 2022

Conversation

cretz
Copy link
Member

@cretz cretz commented Nov 2, 2022

What was changed

Prefix private modules with _

Why?

Discourages user use (especially since many are exposed via the parent module anyways)

Checklist

  1. Closes [Feature Request] Prefix private files/modules' filenames with underscore #178

@cretz cretz requested a review from a team November 2, 2022 17:07
@Quinn-With-Two-Ns
Copy link

Maybe I missed something, but should we mark the sandbox module as restricted? Looking at the readme we a user could use classes in _restrictions.py

my_restrictions = dataclasses.replace(
    SandboxRestrictions.default,
    passthrough_modules=SandboxRestrictions.passthrough_modules_default | SandboxMatcher(access={"pydantic"}),
)
my_worker = Worker(..., runner=SandboxedWorkflowRunner(restrictions=my_restrictions))

@cretz
Copy link
Member Author

cretz commented Nov 3, 2022

@Quinn-With-Two-Ns - No, https://python.temporal.io/temporalio.worker.workflow_sandbox.html is intentionally public (yet unstable) API. I re-export the things I want public from _restrictions.py to the parent module.

@Quinn-With-Two-Ns
Copy link

Thanks I missed the re-export

@cretz cretz merged commit 65c4025 into temporalio:main Nov 4, 2022
@cretz cretz deleted the move-private-modules branch November 4, 2022 21:34
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.

[Feature Request] Prefix private files/modules' filenames with underscore
2 participants