Skip to content

Environment configuration #895

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Environment configuration #895

wants to merge 9 commits into from

Conversation

THardy98
Copy link
Contributor

What was changed

Environment configuration for Python SDK, using core base envconfig module

  1. Closes [Feature Request] Environment configuration #835

  2. How was this tested:
    test_envconfig.py

  3. Any docs updates needed?
    probably

@THardy98 THardy98 requested a review from a team as a code owner June 10, 2025 16:37
@THardy98 THardy98 marked this pull request as draft June 10, 2025 16:37
@THardy98 THardy98 changed the title init impl Environment configuration Jun 11, 2025
@THardy98 THardy98 marked this pull request as ready for review June 11, 2025 22:19
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Make sure you get rid of those .DS_Store macOS file nonsense. They should be globally excluded by gitignore.

I dunno if we need to do this in this PR, we can wait and see what @cretz and @dandavison opinions are too, but IMO it would make good sense to add a Client.connect() overload that takes a ClientConfigProfile here for easy use.

Also these guys need experimental notices on them too

"""Environment and file-based configuration for Temporal clients.

This module provides utilities to load Temporal client configuration from TOML files
and environment variables, following the same patterns as the Go SDK.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
and environment variables, following the same patterns as the Go SDK.
and environment variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed



@dataclass(frozen=True)
class _DataSource:
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be private, since it exists as a field in public things. I think probably we don't really need this, and it could just be a Union[str, bytes]. Maybe a type alias for that, so it can have a comment explaining str is path and bytes is data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to a union type, kept the methods as private helpers

# Create a dictionary of kwargs for ConnectConfig
kwargs: dict[str, Any] = {"api_key": self.api_key}

# Target host
Copy link
Member

Choose a reason for hiding this comment

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

Boring comments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@THardy98
Copy link
Contributor Author

THardy98 commented Jun 13, 2025

Make sure you get rid of those .DS_Store macOS file nonsense. They should be globally excluded by gitignore.

Whoops, didn't realize I had committed them. Removed, added to gitignore

I dunno if we need to do this in this PR, we can wait and see what @cretz and @dandavison opinions are too, but IMO it would make good sense to add a Client.connect() overload that takes a ClientConfigProfile here for easy use.

seems reasonable, will wait to chad gets back as i think he'll have more to suggestions anyway

Also these guys need experimental notices on them too

added to each class (not sure if each method is necessary?)

@THardy98 THardy98 requested a review from Sushisource June 16, 2025 15:38
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

This is looking good to me, but have Dan or Chad when he's back take a look

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] Environment configuration
2 participants