Skip to content

DISCUSSION: Refactor and split sources.py? #546

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

Closed
ezwiefel opened this issue Feb 20, 2025 · 2 comments · Fixed by #548
Closed

DISCUSSION: Refactor and split sources.py? #546

ezwiefel opened this issue Feb 20, 2025 · 2 comments · Fixed by #548
Assignees

Comments

@ezwiefel
Copy link
Contributor

I've written a GCP Secret Manager source and I'd like to contribute it... but I'm worried it'll make source.py a bit long...

I'm wondering if you'd all be open to refactoring source.py into a subfolder? I think it'd make it easier to add new sources in the future.

Made something like this?

pydantic_settings/
├── __init__.py
├── main.py
├── py.typed
├── utils.py
├── version.py
└── sources/
    ├── __init__.py          # Re-exports all public components
    ├── base.py              # Base classes and core functionality
    ├── types.py             # Shared type definitions
    ├── utils.py             # Shared utility functions
    └── providers/           # Individual source implementations
        ├── __init__.py
        ├── secrets.py
        ├── env.py
        ├── dotenv.py
        ├── json.py
        ├── toml.py
        ├── pyproject.py
        ├── yaml.py
        ├── azure.py
        └── cli.py

I'd be happy to open a PR with the refactor if this approach works for all of you.

@hramezani
Copy link
Member

Thanks @ezwiefel for bringing this.
Agree, the source file is too big and hard too follow.
I would be happy to review prs. Please remember to not do all the changes in one big pr. I would like small prs

@ezwiefel
Copy link
Contributor Author

Sounds good, @hramezani, but I'm not sure how to do small prs for this change, since I'll be redirecting references to sources.py to a sourcesfolder. Any suggestions?

ezwiefel added a commit to ezwiefel/pydantic-settings that referenced this issue Feb 21, 2025
ezwiefel added a commit to ezwiefel/pydantic-settings that referenced this issue Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy