Skip to content

Refactor sources.py into a subpackage (#546) #548

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 5 commits into from
Mar 11, 2025

Conversation

ezwiefel
Copy link
Contributor

@ezwiefel ezwiefel commented Feb 21, 2025

Refactors sources.py into a submodule named sources - and then further breaks it down into types, base classes, and providers - with each provider (such as DotEnvSettingsSource or AzureKeyVaultSettingSource) being put into a seperate module under pydantic_settings.sources.providers

Resolves #546

@ezwiefel
Copy link
Contributor Author

@hramezani - My apologies on the large PR - as I mentioned in #546, I couldn't figure out how to make it smaller commits. However, the code was simply a copy and paste from sources.py as much as possible.

@hramezani
Copy link
Member

@hramezani - My apologies on the large PR - as I mentioned in #546, I couldn't figure out how to make it smaller commits. However, the code was simply a copy and paste from sources.py as much as possible.

Thanks @ezwiefel for this PR. No worries. I am busy these days. I will review it next week

@hramezani
Copy link
Member

@ezwiefel this PR needs a rebase. but please don't do it now. this is on my list for the next version. So, I will let you know when you need to rebase. I don't want to waste your time to rebase multiple times.

my plan is to merge a couple of PRs and then review and merge your PR.

Thanks!

@hramezani
Copy link
Member

@ezwiefel sorry for the delay.

You can continue your work now. you can close this PR and open a new one if it is easier.

Thanks!

@ezwiefel
Copy link
Contributor Author

ezwiefel commented Mar 9, 2025

@hramezani - I've rebased the PR and copied any changes that were in sources.py into the sources folder

This was referenced Mar 10, 2025
Comment on lines 1 to 13
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Copy link
Member

Choose a reason for hiding this comment

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

do we need these comments here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry - that was auto generated... I'll remove.

@hramezani
Copy link
Member

Thanks @ezwiefel for the update.

I only left a small comment. other than that LGTM!

@hramezani hramezani merged commit e83ac4c into pydantic:main Mar 11, 2025
18 checks passed
@hramezani
Copy link
Member

Thanks @ezwiefel

@ezwiefel ezwiefel deleted the refactor-sources branch March 11, 2025 13:22
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.

DISCUSSION: Refactor and split sources.py?
2 participants