Skip to content
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

Adopt pydantic-settings docs for Pydantic V2 #18

Merged
merged 4 commits into from
Apr 27, 2023

Conversation

hramezani
Copy link
Member

@hramezani hramezani commented Apr 21, 2023

It's based on the change on #17 to make pydantic-settings compatible with Pydantic V2.
All the docs and examples changed to be compatible

@codecov-commenter
Copy link

codecov-commenter commented Apr 21, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4d82c97) 96.00% compared to head (86c9e02) 96.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   96.00%   96.00%           
=======================================
  Files           5        5           
  Lines         275      275           
  Branches       67       67           
=======================================
  Hits          264      264           
  Misses         10       10           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

Otherwise looks like a great start.

Copy link
Member

Choose a reason for hiding this comment

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

please move these inline, into the markdown files.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've converted these examples to be compatible with V2 and added them here in examples directory to be compatible with Pydantic documents.
Also, I've added them directly in index.md as well.
When we decided about the docs repo and the way that we want to handle them we can we can use them directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

README.md Outdated
@@ -5,3 +5,5 @@
[![license](https://img.shields.io/github/license/pydantic/pydantic-settings.svg)](https://github.com/pydantic/pydantic-settings/blob/main/LICENSE)

**Work in Progress**, see https://github.com/pydantic/pydantic/pull/4492

{!docs/index.md!}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should include this, since it won't work in github.

Copy link
Member Author

@hramezani hramezani Apr 24, 2023

Choose a reason for hiding this comment

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

My plan was to make new docs available for the users because the old docs are outdated and we need to somehow share the new docs with the user.
Removed!

docs/index.md Outdated
"""
```

<!--- {!.tmp_examples/settings_main.md!} --->
Copy link
Member Author

Choose a reason for hiding this comment

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

As you can see the example code is injected directly here in the md file and this line is commented. Whenever we decided about the docs, we can uncomment this line and remove the above example code

@hramezani hramezani force-pushed the docs_integration branch 3 times, most recently from 883caf8 to 6a29a7d Compare April 26, 2023 10:30
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

we need to remove the .py files and the comments.

At some point we should enable pytest-examples to test the docs examples.

docs/index.md Outdated

model_config = ConfigDict(case_sensitive=True)
```
<!--- {!.tmp_examples/settings_case_sensitive.md!} --->
Copy link
Member

Choose a reason for hiding this comment

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

i think we should remove these.

Copy link
Member

Choose a reason for hiding this comment

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

I guess we can remove all these files now that they're copied into index.md

@samuelcolvin
Copy link
Member

LGTM, please enable auto-merge if you're happy with this.

@hramezani
Copy link
Member Author

@samuelcolvin I just create an issue for pytest-examples integration #33

@hramezani hramezani merged commit 0ac8e81 into pydantic:main Apr 27, 2023
@hramezani hramezani deleted the docs_integration branch April 27, 2023 10:36
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.

3 participants