Coverage report: - 97.56% -
- - -- coverage.py v7.2.7, - created at 2023-07-13 11:37 +0200 -
-diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/404.html b/404.html deleted file mode 100644 index 4e1882c..0000000 --- a/404.html +++ /dev/null @@ -1 +0,0 @@ -
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our community include:
Examples of unacceptable behavior include:
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at pawamoy@pm.me. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
Community Impact: A violation through a single incident or series of actions.
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
Consequence: A permanent ban from any sort of public interaction within the community.
This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
Nothing easier!
Fork and clone the repository, then:
cd griffe-pydantic
-make setup
-
Note
If it fails for some reason, you'll need to install PDM manually.
You can install it with:
python3 -m pip install --user pipx
-pipx install pdm
-
Now you can try running make setup
again, or simply pdm install
.
You now have the dependencies installed.
Run make help
to see all the available actions!
This project uses duty to run tasks. A Makefile is also provided. The Makefile will try to run certain tasks on multiple Python versions. If for some reason you don't want to run the task on multiple Python versions, you run the task directly with pdm run duty TASK
.
The Makefile detects if a virtual environment is activated, so make
will work the same with the virtualenv activated or not.
If you work in VSCode, see examples of tasks and run configurations.
As usual:
git switch -c feature-or-bugfix-name
Before committing:
make format
to auto-format the codemake check
to check everything (fix any warning)make test
to run the tests (fix any issue)make docs
If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review.
Don't bother updating the changelog, we will take care of this.
Commit messages must follow our convention based on the Angular style or the Karma convention:
<type>[(scope)]: Subject
-
-[Body]
-
Subject and body must be valid Markdown. Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general.
Scope and body are optional. Type can be:
build
: About packaging, building wheels, etc.chore
: About packaging or repo/files management.ci
: About Continuous Integration.deps
: Dependencies update.docs
: About documentation.feat
: New feature.fix
: Bug fix.perf
: About performance.refactor
: Changes that are not features or bug fixes.style
: A change in code style/format.tests
: About tests.If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown:
Body.
-
-Issue #10: https://github.com/namespace/project/issues/10
-Related to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15
-
These "trailers" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons :
. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number).
We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped.
Link to any related issue in the Pull Request message.
During the review, we recommend using fixups:
# SHA is the SHA of the commit you want to fix
-git commit --fixup=SHA
-
Once all the changes are approved, you can squash your commits:
git rebase -i --autosquash main
-
And force-push:
git push -f
-
If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging.
- coverage.py v7.2.7, - created at 2023-07-13 11:37 +0200 -
-Module | -statements | -missing | -excluded | -branches | -partial | -coverage | -
---|---|---|---|---|---|---|
src/griffe_pydantic/extension.py | -51 | -0 | -2 | -20 | -2 | -97.18% | -
tests/conftest.py | -1 | -0 | -0 | -0 | -0 | -100.00% | -
tests/test_extension.py | -8 | -0 | -0 | -2 | -0 | -100.00% | -
Total | -60 | -0 | -2 | -22 | -2 | -97.56% | -
- No items found using the specified filter. -
-- « prev - ^ index - » next - - coverage.py v7.2.7, - created at 2023-07-13 11:37 +0200 -
- -1"""Griffe extension for Pydantic."""
- -3from __future__ import annotations
- -5import json
-6import sys
-7from typing import TYPE_CHECKING
- -9from griffe.agents.nodes import ObjectNode
-10from griffe.agents.nodes import get_call_keyword_arguments as get_kwargs
-11from griffe.dataclasses import Attribute, Class, Docstring, Function
-12from griffe.expressions import Expression, Name
-13from griffe.extensions import Extension
-14from griffe.importer import dynamic_import
- -16if TYPE_CHECKING:
-17 import ast
- - -20self_namespace = "griffe_pydantic"
-21mkdocstrings_namespace = "mkdocstrings"
- - -24def _is_pydantic_field_validator(func: Function) -> bool:
-25 return any(decorator.callable_path == "pydantic.field_validator" for decorator in func.decorators)
- - -28class PydanticExtension(Extension):
-29 """Griffe extension for Pydantic."""
- -31 def __init__(self, *, schema: bool = True) -> None:
-32 """Initialize the extension.
- -34 Parameters:
-35 schema: Whether to compute and store the JSON schema of models.
-36 """
-37 super().__init__()
-38 self.schema = schema
-39 self.in_model: list[Class] = []
- -41 def on_class_instance(self, node: ast.AST | ObjectNode, cls: Class) -> None: # noqa: ARG002
-42 """Detect and prepare Pydantic models."""
-43 for base in cls.bases:
-44 if isinstance(base, (Name, Expression)): 44 ↛ 46line 44 didn't jump to line 46, because the condition on line 44 was never false
-45 base = base.full # noqa: PLW2901
-46 if base == "pydantic.BaseModel":
-47 cls.labels.add(f"pydantic-{base[13:].lower()}") # pydantic-model/settings
-48 cls.extra[self_namespace]["fields"] = {}
-49 cls.extra[self_namespace]["validators"] = {}
-50 cls.extra[mkdocstrings_namespace]["template"] = "pydantic_model.html"
-51 self.in_model.append(cls)
-52 break
- -54 def on_attribute_instance(self, node: ast.AST | ObjectNode, attr: Attribute) -> None:
-55 """Handle Pydantic fields."""
-56 if self.in_model:
-57 cls = self.in_model[-1]
-58 if attr.name == "model_config":
-59 cls.extra[self_namespace]["config"] = get_kwargs(node.value, parent=cls) # type: ignore[union-attr]
-60 else:
-61 attr.labels = {"pydantic-field"}
-62 cls.extra[self_namespace]["fields"][attr.name] = attr
-63 # Populate docstring from the field's `description` argument.
-64 if not attr.docstring and (docstring := get_kwargs(node.value, parent=cls).get("description", None)): # type: ignore[union-attr]
-65 attr.docstring = Docstring(docstring, parent=attr)
- -67 def on_function_instance(self, node: ast.AST | ObjectNode, func: Function) -> None: # noqa: ARG002
-68 """Handle Pydantic field validators."""
-69 if self.in_model and _is_pydantic_field_validator(func):
-70 func.labels = {"pydantic-validator"}
-71 cls = self.in_model[-1]
-72 cls.extra[self_namespace]["validators"][func.name] = func
- -74 def on_class_members(self, node: ast.AST | ObjectNode, cls: Class) -> None: # noqa: ARG002
-75 """Finalize the Pydantic model data."""
-76 if self.in_model and cls is self.in_model[-1]:
-77 # Add schema to extra data.
-78 if self.schema: 78 ↛ 84line 78 didn't jump to line 84, because the condition on line 78 was never false
-79 true_class = dynamic_import(cls.path, import_paths=[cls.filepath.parent, *sys.path]) # type: ignore[union-attr]
-80 schema = json.dumps(true_class.model_json_schema(), indent=2)
-81 cls.extra[self_namespace]["schema"] = schema
- -83 # Pop last class from the heap.
-84 self.in_model.pop()
-- « prev - ^ index - » next - - coverage.py v7.2.7, - created at 2023-07-13 11:34 +0200 -
- -1"""Configuration for the pytest test suite."""
- -3pytest_plugins = ["griffe.tests"]
-- « prev - ^ index - » next - - coverage.py v7.2.7, - created at 2023-07-13 11:37 +0200 -
- -1"""Tests for the `extension` module."""
- -3from __future__ import annotations
- -5from griffe.extensions import load_extensions
-6from griffe.tests import temporary_visited_module
- -8from griffe_pydantic.extension import PydanticExtension
- -10code = """
-11 from pydantic import field_validator, ConfigDict, BaseModel, Field
- - -14 class ExampleModel(BaseModel):
-15 '''An example model.'''
- -17 model_config = ConfigDict(frozen=False)
- -19 field_without_default: str
-20 '''Shows the *[Required]* marker in the signature.'''
- -22 field_plain_with_validator: int = 100
-23 '''Show standard field with type annotation.'''
- -25 field_with_validator_and_alias: str = Field("FooBar", alias="BarFoo", validation_alias="BarFoo")
-26 '''Shows corresponding validator with link/anchor.'''
- -28 field_with_constraints_and_description: int = Field(
-29 default=5, ge=0, le=100, description="Shows constraints within doc string."
-30 )
- -32 @field_validator("field_with_validator_and_alias", "field_plain_with_validator")
-33 @classmethod
-34 def check_max_length_ten(cls, v):
-35 '''Show corresponding field with link/anchor.'''
-36 if len(v) >= 10:
-37 raise ValueError("No more than 10 characters allowed")
-38 return v
- -40 def regular_method(self):
-41 pass
- -43 class RegularClass(object):
-44 regular_attr = 1
-45"""
- - -48def test_extension() -> None:
-49 """Test the extension."""
-50 with temporary_visited_module(code, extensions=load_extensions([PydanticExtension])) as module:
-51 assert module
-These projects were used to build griffe-pydantic. Thank you!
python
| pdm
| copier-pdm
Project | Summary | Version (accepted) | Version (last resolved) | License |
---|---|---|---|---|
colorama | Cross-platform colored terminal text. | >=0.4 | 0.4.6 | BSD License |
griffe | Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. | >=0.32.0 | 0.32.0 | ISC |
Project | Summary | Version (accepted) | Version (last resolved) | License |
---|---|---|---|---|
annotated-types | Reusable constraint types to use with typing.Annotated | >=0.4.0 | 0.5.0 | MIT License |
ansimarkup | Produce colored terminal text with an xml-like markup | ~=1.4 | 1.5.0 | Revised BSD License |
babel | Internationalization utilities | >=2.10.3 | 2.12.1 | BSD |
beautifulsoup4 | Screen-scraping library | 4.12.2 | MIT License | |
black | The uncompromising code formatter. | >=23.1 | 23.7.0 | MIT |
blacken-docs | Run Black on Python code blocks in documentation files. | >=1.13 | 1.15.0 | MIT |
certifi | Python package for providing Mozilla's CA Bundle. | >=2017.4.17 | 2023.5.7 | MPL-2.0 |
charset-normalizer | The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet. | <4,>=2 | 3.2.0 | MIT |
click | Composable command line interface toolkit | >=8.0.0 | 8.1.4 | BSD-3-Clause |
colorama | Cross-platform colored terminal text. | ; platform_system == "Windows" | 0.4.6 | BSD License |
coverage | Code coverage measurement for Python | [toml]>=5.2.1 | 7.2.7 | Apache-2.0 |
csscompressor | A python port of YUI CSS Compressor | >=0.9.5 | 0.9.5 | BSD |
cssselect | cssselect parses CSS3 Selectors and translates them to XPath 1.0 | >=1.2.0 | 1.2.0 | BSD |
dparse | A parser for Python dependency files | >=0.6.2 | 0.6.3 | MIT license |
duty | A simple task runner. | >=0.10 | 1.0.0 | ISC |
exceptiongroup | Backport of PEP 654 (exception groups) | >=1.0.0rc8; python_version < "3.11" | 1.1.2 | ? |
execnet | execnet: rapid multi-Python deployment | >=1.1 | 2.0.2 | MIT License |
failprint | Run a command, print its output only if it fails. | >=0.11 | 0.11.1 | ISC |
ghp-import | Copy your docs directly to the gh-pages branch. | >=1.0 | 2.1.0 | Apache Software License |
git-changelog | Automatic Changelog generator using Jinja2 templates. | >=1.0 | 2.0.0 | ISC |
gitdb | Git Object Database | <5,>=4.0.1 | 4.0.10 | BSD License |
gitpython | GitPython is a Python library used to interact with Git repositories | 3.1.32 | BSD | |
griffe | Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. | >=0.24 | 0.32.0 | ISC |
htmlmin2 | An HTML Minifier | >=0.1.13 | 0.1.13 | BSD |
idna | Internationalized Domain Names in Applications (IDNA) | <4,>=2.5 | 3.4 | BSD License |
importlib-metadata | Read metadata from Python packages | >=4.3; python_version < "3.10" | 6.8.0 | ? |
iniconfig | brain-dead simple config-ini parsing | 2.0.0 | MIT License | |
jinja2 | A very fast and expressive template engine. | <4,>=2.11 | 3.1.2 | BSD-3-Clause |
jsmin | JavaScript minifier. | >=3.0.1 | 3.0.1 | MIT License |
lxml | Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API. | >=4.6 | 4.9.3 | BSD-3-Clause |
markdown | Python implementation of Markdown. | <4.0.0,>=3.3.3 | 3.3.7 | BSD License |
markdown-callouts | Markdown extension: a classier syntax for admonitions | >=0.2 | 0.3.0 | MIT |
markdown-exec | Utilities to execute code blocks in Markdown files. | >=0.5 | 1.6.0.1.0.0 | ISC |
markdown2 | A fast and complete Python implementation of Markdown | >=2.4.3 | 2.4.9 | MIT |
markupsafe | Safely add untrusted strings to HTML/XML markup. | >=2.0 | 2.1.3 | BSD-3-Clause |
mergedeep | A deep merge function for 🐍. | >=1.3.4 | 1.3.4 | MIT License |
mkdocs | Project documentation with Markdown. | >=1.3 | 1.4.3 | BSD License |
mkdocs-coverage | MkDocs plugin to integrate your coverage HTML report into your site. | >=0.2 | 0.2.7 | ISC |
mkdocs-gen-files | MkDocs plugin to programmatically generate documentation pages during the build | >=0.3 | 0.5.0 | MIT License |
mkdocs-git-committers-plugin-2 | An MkDocs plugin to create a list of contributors on the page | >=1.1 | 1.1.2 | MIT |
mkdocs-literate-nav | MkDocs plugin to specify the navigation in Markdown instead of YAML | >=0.4 | 0.6.0 | MIT License |
mkdocs-material | Documentation that simply works | >=7.3 | 9.1.18+insiders.4.36.1 | MIT License |
mkdocs-material-extensions | Extension pack for Python Markdown and MkDocs Material. | >=1.1 | 1.1.1 | MIT License |
mkdocs-minify-plugin | An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk | >=0.6.4 | 0.6.4 | MIT |
mkdocstrings | Automatic documentation from sources, for MkDocs. | [python]>=0.18 | 0.22.0 | ISC |
mkdocstrings-python | A Python handler for mkdocstrings. | >=0.5.2 | 1.1.2.1.1.1 | ISC |
mypy | Optional static typing for Python | >=0.910 | 1.4.1 | MIT License |
mypy-extensions | Type system extensions for programs checked with the mypy type checker. | >=0.4.3 | 1.0.0 | MIT License |
packaging | Core utilities for Python packages | >=22.0 | 23.1 | BSD License |
paginate | Divides large result sets into pages for easier browsing | >=0.5.6 | 0.5.6 | MIT |
pathspec | Utility library for gitignore style pattern matching of file paths. | >=0.9.0 | 0.11.1 | Mozilla Public License 2.0 (MPL 2.0) |
pipdeptree | Command line utility to show dependency tree of packages. | >=2.3 | 2.9.5 | MIT License |
platformdirs | A small Python package for determining appropriate platform-specific dirs, e.g. a "user data dir". | >=2 | 3.8.1 | MIT License |
pluggy | plugin and hook calling mechanisms for python | <2.0,>=0.12 | 1.2.0 | MIT |
ptyprocess | Run a subprocess in a pseudo terminal | ~=0.6; sys_platform != "win32" | 0.7.0 | ISC License (ISCL) |
pydantic | Data validation using Python type hints | >=2.0.2 | 2.0.2 | MIT License |
pydantic-core | ==2.1.2 | 2.1.2 | MIT | |
pygments | Pygments is a syntax highlighting package written in Python. | >=2.14 | 2.15.1 | BSD-2-Clause |
pymdown-extensions | Extension pack for Python Markdown. | >=9 | 10.0.1 | MIT License |
pyquery | A jquery-like library for python | >=1.2 | 2.0.0 | BSD |
pytest | pytest: simple powerful testing with Python | >=6.2 | 7.4.0 | MIT |
pytest-cov | Pytest plugin for measuring coverage. | >=3.0 | 4.1.0 | MIT |
pytest-randomly | Pytest plugin to randomly order tests and control random.seed. | >=3.10 | 3.13.0 | MIT |
pytest-xdist | pytest xdist plugin for distributed testing, most importantly across multiple CPUs | >=2.4 | 3.3.1 | MIT |
python-dateutil | Extensions to the standard Python datetime module | >=2.8.1 | 2.8.2 | Dual License |
pytz | World timezone definitions, modern and historical | >=2015.7; python_version < "3.9" | 2023.3 | ? |
pyyaml | YAML parser and emitter for Python | >=5.1 | 6.0 | MIT |
pyyaml-env-tag | A custom YAML tag for referencing environment variables in YAML files. | >=0.1 | 0.1 | MIT License |
readtime | Calculates the time some text takes the average human to read, based on Medium's read time forumula | >=2.0 | 2.0.0 | BSD |
regex | Alternative regular expression module, to replace re. | >=2022.4.24 | 2023.6.3 | Apache Software License |
requests | Python HTTP for Humans. | 2.31.0 | Apache 2.0 | |
ruamel-yaml | ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order | >=0.17.21 | 0.17.32 | MIT license |
ruamel-yaml-clib | C version of reader, parser and emitter for ruamel.yaml derived from libyaml | >=0.2.7; platform_python_implementation == "CPython" and python_version < "3.12" | 0.2.7 | MIT |
ruff | An extremely fast Python linter, written in Rust. | >=0.0.246 | 0.0.278 | MIT |
safety | Checks installed dependencies for known vulnerabilities and licenses. | >=2 | 2.3.4 | MIT license |
semver | Python helper for Semantic Versioning (https://semver.org) | >=2.13 | 3.0.1 | BSD |
setuptools | Easily download, build, install, upgrade, and uninstall Python packages | >=19.3 | 68.0.0 | MIT License |
six | Python 2 and 3 compatibility utilities | >=1.5 | 1.16.0 | MIT |
smmap | A pure Python implementation of a sliding window memory map manager | <6,>=3.0.1 | 5.0.0 | BSD |
soupsieve | A modern CSS selector implementation for Beautiful Soup. | >1.2 | 2.4.1 | MIT License |
toml | Python Library for Tom's Obvious, Minimal Language | >=0.10 | 0.10.2 | MIT |
tomli | A lil' TOML parser | >=1.1.0; python_version < "3.11" | 2.0.1 | ? |
types-markdown | Typing stubs for Markdown | >=3.3 | 3.4.2.9 | Apache-2.0 license |
types-pyyaml | Typing stubs for PyYAML | >=6.0 | 6.0.12.10 | Apache-2.0 license |
types-toml | Typing stubs for toml | >=0.10 | 0.10.8.6 | Apache-2.0 license |
typing-extensions | Backported and Experimental Type Hints for Python 3.7+ | >=3.10.0.0; python_version < "3.10" | 4.7.1 | Python Software Foundation License |
urllib3 | HTTP library with thread-safe connection pooling, file post, and more. | <3,>=1.21.1 | 2.0.3 | MIT License |
watchdog | Filesystem events monitoring | >=2.0 | 3.0.0 | Apache License 2.0 |
zipp | Backport of pathlib-compatible object wrapper for zip files | >=0.5 | 3.16.1 | ? |
Griffe extension for Pydantic.
With pip
:
pip install griffe-pydantic
-
With pipx
:
python3.8 -m pip install --user pipx
-pipx install griffe-pydantic
-
griffe dump mypackage -e griffe_pydantic
-
See command-line usage in Griffe's documentation.
import griffe
-
-griffe.load(
- "mypackage",
- extensions=griffe.load_extensions(
- [{"griffe_pydantic": {"schema": True}}]
- )
-)
-
See programmatic usage in Griffe's documentation.
plugins:
-- mkdocstrings:
- handlers:
- python:
- options:
- extensions:
- - griffe_pydantic:
- schema: true
-
See MkDocs usage in Griffe's documentation.
from pydantic import field_validator, ConfigDict, BaseModel, Field
-
-
-class ExampleModel(BaseModel):
- """An example model."""
-
- model_config = ConfigDict(frozen=False)
-
- field_without_default: str
- """Shows the *[Required]* marker in the signature."""
-
- field_plain_with_validator: int = 100
- """Show standard field with type annotation."""
-
- field_with_validator_and_alias: str = Field("FooBar", alias="BarFoo", validation_alias="BarFoo")
- """Shows corresponding validator with link/anchor."""
-
- field_with_constraints_and_description: int = Field(
- default=5, ge=0, le=100, description="Shows constraints within doc string."
- )
-
- @field_validator("field_with_validator_and_alias", "field_without_default")
- @classmethod
- def check_max_length_ten(cls, v) -> str:
- """Show corresponding field with link/anchor."""
- if len(v) >= 10:
- raise ValueError("No more than 10 characters allowed")
- return v
-
ExampleModel ¤ Bases: BaseModel
An example model.
field_plain_with_validator class-attribute
instance-attribute
¤field_plain_with_validator: int = 100
-
Show standard field with type annotation.
field_with_validator_and_alias class-attribute
instance-attribute
¤field_with_validator_and_alias: str = Field(
- "FooBar", alias="BarFoo", validation_alias="BarFoo"
-)
-
Shows corresponding validator with link/anchor.
field_without_default instance-attribute
¤field_without_default: str
-
Shows the [Required] marker in the signature.
ExampleModel pydantic-model
¤ Bases: BaseModel
An example model.
Config:
frozen
: False
Fields:
field_without_default
(str
) field_plain_with_validator
(int
) field_with_validator_and_alias
(str
) field_with_constraints_and_description
(int
) Validators:
field_plain_with_validator pydantic-field
¤field_plain_with_validator: int
-
Show standard field with type annotation.
field_with_constraints_and_description pydantic-field
¤field_with_constraints_and_description: int = 5
-
Shows constraints within doc string.
field_with_validator_and_alias pydantic-field
¤field_with_validator_and_alias: str
-
Shows corresponding validator with link/anchor.
field_without_default pydantic-field
¤field_without_default: str
-
Shows the [Required] marker in the signature.
griffe-pydantic follows the sponsorware release strategy, which means that new features are first exclusively released to sponsors as part of Insiders. Read on to learn what sponsorships achieve, how to become a sponsor to get access to Insiders, and what's in it for you!
griffe-pydantic Insiders is a private fork of griffe-pydantic, hosted as a private GitHub repository. Almost1 all new features are developed as part of this fork, which means that they are immediately available to all eligible sponsors, as they are made collaborators of this repository.
Every feature is tied to a funding goal in monthly subscriptions. When a funding goal is hit, the features that are tied to it are merged back into griffe-pydantic and released for general availability, making them available to all users. Bugfixes are always released in tandem.
Sponsorships start as low as $10 a month.2
Sponsorships make this project sustainable, as they buy the maintainers of this project time – a very scarce resource – which is spent on the development of new features, bug fixing, stability improvement, issue triage and general support. The biggest bottleneck in Open Source is time.3
If you're unsure if you should sponsor this project, check out the list of completed funding goals to learn whether you're already using features that were developed with the help of sponsorships. You're most likely using at least a handful of them, thanks to our awesome sponsors!
The moment you become a sponsor, you'll get immediate access to 1 additional features that you can start using right away, and which are currently exclusively available to sponsors:
Thanks for your interest in sponsoring! In order to become an eligible sponsor with your GitHub account, visit pawamoy's sponsor profile, and complete a sponsorship of $10 a month or more. You can use your individual or organization GitHub account for sponsoring.
Important: If you're sponsoring @pawamoy through a GitHub organization, please send a short email to pawamoy@pm.me with the name of your organization and the GitHub account of the individual that should be added as a collaborator.4
You can cancel your sponsorship anytime.5
If you sponsor publicly, you're automatically added here with a link to your profile and avatar to show your support for griffe-pydantic. Alternatively, if you wish to keep your sponsorship private, you'll be a silent +1. You can select visibility during checkout and change it afterwards.
The following section lists all funding goals. Each goal contains a list of features prefixed with a checkmark symbol, denoting whether a feature is already available or planned, but not yet implemented. When the funding goal is hit, the features are released for general availability.
This section lists all funding goals that were previously completed, which means that those features were part of Insiders, but are now generally available and can be used by all users.
We're building an open source project and want to allow outside collaborators to use griffe-pydantic locally without having access to Insiders. Is this still possible?
Yes. Insiders is compatible with griffe-pydantic. Almost all new features and configuration options are either backward-compatible or implemented behind feature flags. Most Insiders features enhance the overall experience, though while these features add value for the users of your project, they shouldn't be necessary for previewing when making changes to content.
We don't want to pay for sponsorship every month. Are there any other options?
Yes. You can sponsor on a yearly basis by switching your GitHub account to a yearly billing cycle. If for some reason you cannot do that, you could also create a dedicated GitHub account with a yearly billing cycle, which you only use for sponsoring (some sponsors already do that).
If you have any problems or further questions, please reach out to pawamoy@pm.me.
Are we allowed to use Insiders under the same terms and conditions as griffe-pydantic?
Yes. Whether you're an individual or a company, you may use griffe-pydantic Insiders precisely under the same terms as griffe-pydantic, which are given by the ISC License. However, we kindly ask you to respect our fair use policy:
Please don't distribute the source code of Insiders. You may freely use it for public, private or commercial projects, privately fork or mirror it, but please don't make the source code public, as it would counteract the sponsorware strategy.
If you cancel your subscription, you're automatically removed as a collaborator and will miss out on all future updates of Insiders. However, you may use the latest version that's available to you as long as you like. Just remember that GitHub deletes private forks.
In general, every new feature is first exclusively released to sponsors, but sometimes upstream dependencies enhance existing features that must be supported by griffe-pydantic. ↩
Note that $10 a month is the minimum amount to become eligible for Insiders. While GitHub Sponsors also allows to sponsor lower amounts or one-time amounts, those can't be granted access to Insiders due to technical reasons. Such contributions are still very much welcome as they help ensuring the project's sustainability. ↩
Making an Open Source project sustainable is exceptionally hard: maintainers burn out, projects are abandoned. That's not great and very unpredictable. The sponsorware model ensures that if you decide to use griffe-pydantic, you can be sure that bugs are fixed quickly and new features are added regularly. ↩
It's currently not possible to grant access to each member of an organization, as GitHub only allows for adding users. Thus, after sponsoring, please send an email to pawamoy@pm.me, stating which account should become a collaborator of the Insiders repository. We're working on a solution which will make access to organizations much simpler. To ensure that access is not tied to a particular individual GitHub account, create a bot account (i.e. a GitHub account that is not tied to a specific individual), and use this account for the sponsoring. After being added to the list of collaborators, the bot account can create a private fork of the private Insiders GitHub repository, and grant access to all members of the organizations. ↩
If you cancel your sponsorship, GitHub schedules a cancellation request which will become effective at the end of the billing cycle. This means that even though you cancel your sponsorship, you will keep your access to Insiders as long as your cancellation isn't effective. All charges are processed by GitHub through Stripe. As we don't receive any information regarding your payment, and GitHub doesn't offer refunds, sponsorships are non-refundable. ↩
griffe-pydantic Insiders is a compatible drop-in replacement for griffe-pydantic, and can be installed similarly using pip
or git
. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.
griffe-pydantic Insiders can be installed with pip
using SSH:
pip install git+ssh://git@github.com/pawamoy-insiders/griffe-pydantic.git
-
Or using HTTPS:
pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/griffe-pydantic.git
-
The GH_TOKEN
environment variable is a GitHub token. It can be obtained by creating a personal access token for your GitHub account. It will give you access to the Insiders repository, programmatically, from the command line or GitHub Actions workflows:
repo
scopeNote that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories.
Self-hosting the Insiders package makes it possible to depend on griffe-pydantic normally, while transparently downloading and installing the Insiders version locally. It means that you can specify your dependencies normally, and your contributors without access to Insiders will get the public version, while you get the Insiders version on your machine.
Limitation
With this method, there is no way to force the installation of an Insiders version rather than a public version. If there is a public version that is more recent than your self-hosted Insiders version, the public version will take precedence. Remember to regularly update your self-hosted versions by uploading latest distributions.
You can build the distributions for Insiders yourself, by cloning the repository and using build to build the distributions, or you can download them from our GitHub Releases. You can upload these distributions to a private PyPI-like registry (Artifactory, Google Cloud, pypiserver, etc.) with Twine:
# download distributions in ~/dists, then upload with:
-twine upload --repository-url https://your-private-index.com ~/dists/*
-
You might also need to provide a username and password/token to authenticate against the registry. Please check Twine's documentation.
You can then configure pip (or other tools) to look for packages into your package index. For example, with pip:
pip config set global.extra-index-url https://your-private-index.com/simple
-
Note that the URL might differ depending on whether your are uploading a package (with Twine) or installing a package (with pip), and depending on the registry you are using (Artifactory, Google Cloud, etc.). Please check the documentation of your registry to learn how to configure your environment.
We kindly ask that you do not upload the distributions to public registries, as it is against our Terms of use.
pypiserver
In this example we use pypiserver to serve a local PyPI index.
pip install --user pypiserver
-# or pipx install pypiserver
-
-# create a packages directory
-mkdir -p ~/.local/pypiserver/packages
-
-# run the pypi server without authentication
-pypi-server run -p 8080 -a . -P . ~/.local/pypiserver/packages &
-
We can configure the credentials to access the server in ~/.pypirc
:
[distutils]
-index-servers =
- local
-
-[local]
-repository: http://localhost:8080
-username:
-password:
-
We then clone the Insiders repository, build distributions and upload them to our local server:
# clone the repository
-git clone git@github.com:pawamoy-insiders/griffe-pydantic
-cd griffe-pydantic
-
-# install build
-pip install --user build
-# or pipx install build
-
-# checkout latest tag
-git checkout $(git describe --tags --abbrev=0)
-
-# build the distributions
-pyproject-build
-
-# upload them to our local server
-twine upload -r local dist/* --skip-existing
-
Finally, we configure pip, and for example PDM, to use our local index to find packages:
pip config set global.extra-index-url http://localhost:8080/simple
-pdm config pypi.extra.url http://localhost:8080/simple
-
Now when running pip install griffe-pydantic
, or resolving dependencies with PDM, both tools will look into our local index and find the Insiders version. Remember to update your local index regularly!
Of course, you can use griffe-pydantic Insiders directly from git
:
git clone git@github.com:pawamoy-insiders/griffe-pydantic
-
When cloning from git
, the package must be installed:
pip install -e griffe-pydantic
-
When upgrading Insiders, you should always check the version of griffe-pydantic which makes up the first part of the version qualifier. For example, a version like 8.x.x.4.x.x
means that Insiders 4.x.x
is currently based on 8.x.x
.
If the major version increased, it's a good idea to consult the changelog and go through the steps to ensure your configuration is up to date and all necessary changes have been made.
' - sponsors.forEach(function (sponsor) { - html += ` - - - - ` - }); - html += '
' - bronzeSponsors.innerHTML = html; - } - }); -} diff --git a/license/index.html b/license/index.html deleted file mode 100644 index a1b2475..0000000 --- a/license/index.html +++ /dev/null @@ -1,16 +0,0 @@ -ISC License
-
-Copyright (c) 2023, Timothée Mazzucotelli
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
griffe_pydantic](griffe_pydantic/index.md)
- * [
extension](griffe_pydantic/extension.md)
diff --git a/reference/griffe_pydantic/extension/index.html b/reference/griffe_pydantic/extension/index.html
deleted file mode 100644
index c15887e..0000000
--- a/reference/griffe_pydantic/extension/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
extension
extension ¤Griffe extension for Pydantic.
PydanticExtension ¤PydanticExtension(*, schema: bool = False) -> None
-
Bases: Extension
Griffe extension for Pydantic.
Parameters:
bool
) – Whether to compute and store the JSON schema of models.
on_attribute_instance ¤on_attribute_instance(
- node: ast.AST | ObjectNode, attr: Attribute
-) -> None
-
Handle Pydantic fields.
on_class_instance ¤on_class_instance(
- node: ast.AST | ObjectNode, cls: Class
-) -> None
-
Detect and prepare Pydantic models.
on_class_members ¤on_class_members(
- node: ast.AST | ObjectNode, cls: Class
-) -> None
-
Finalize the Pydantic model data.
on_function_instance ¤on_function_instance(
- node: ast.AST | ObjectNode, func: Function
-) -> None
-
Handle Pydantic field validators.
griffe_pydantic ¤griffe-pydantic package.
Griffe extension for Pydantic.
PydanticExtension ¤PydanticExtension(*, schema: bool = False) -> None
-
Bases: Extension
Griffe extension for Pydantic.
Parameters:
bool
) – Whether to compute and store the JSON schema of models.
on_attribute_instance ¤on_attribute_instance(
- node: ast.AST | ObjectNode, attr: Attribute
-) -> None
-
Handle Pydantic fields.
on_class_instance ¤on_class_instance(
- node: ast.AST | ObjectNode, cls: Class
-) -> None
-
Detect and prepare Pydantic models.
on_class_members ¤on_class_members(
- node: ast.AST | ObjectNode, cls: Class
-) -> None
-
Finalize the Pydantic model data.
on_function_instance ¤on_function_instance(
- node: ast.AST | ObjectNode, func: Function
-) -> None
-
Handle Pydantic field validators.
Griffe extension for Pydantic.
"},{"location":"#installation","title":"Installation","text":"With pip
:
pip install griffe-pydantic\n
With pipx
:
python3.8 -m pip install --user pipx\npipx install griffe-pydantic\n
"},{"location":"#usage","title":"Usage","text":""},{"location":"#command-line","title":"Command-line","text":"griffe dump mypackage -e griffe_pydantic\n
See command-line usage in Griffe's documentation.
"},{"location":"#python","title":"Python","text":"import griffe\n\ngriffe.load(\n \"mypackage\",\n extensions=griffe.load_extensions(\n [{\"griffe_pydantic\": {\"schema\": True}}]\n )\n)\n
See programmatic usage in Griffe's documentation.
"},{"location":"#mkdocs","title":"MkDocs","text":"mkdocs.ymlplugins:\n- mkdocstrings:\nhandlers:\npython:\noptions:\nextensions:\n- griffe_pydantic:\nschema: true\n
See MkDocs usage in Griffe's documentation.
"},{"location":"#examples","title":"Examples","text":"Pydantic modelWithout extensionWith extensionfrom pydantic import field_validator, ConfigDict, BaseModel, Field\n\n\nclass ExampleModel(BaseModel):\n\"\"\"An example model.\"\"\"\n\n model_config = ConfigDict(frozen=False)\n\n field_without_default: str\n\"\"\"Shows the *[Required]* marker in the signature.\"\"\"\n\n field_plain_with_validator: int = 100\n\"\"\"Show standard field with type annotation.\"\"\"\n\n field_with_validator_and_alias: str = Field(\"FooBar\", alias=\"BarFoo\", validation_alias=\"BarFoo\")\n\"\"\"Shows corresponding validator with link/anchor.\"\"\"\n\n field_with_constraints_and_description: int = Field(\n default=5, ge=0, le=100, description=\"Shows constraints within doc string.\"\n )\n\n @field_validator(\"field_with_validator_and_alias\", \"field_without_default\")\n @classmethod\n def check_max_length_ten(cls, v) -> str:\n\"\"\"Show corresponding field with link/anchor.\"\"\"\n if len(v) >= 10:\n raise ValueError(\"No more than 10 characters allowed\")\n return v\n
"},{"location":"#model_noext.ExampleModel","title":"ExampleModel","text":" Bases: BaseModel
An example model.
"},{"location":"#model_noext.ExampleModel.field_plain_with_validator","title":"field_plain_with_validatorclass-attribute
instance-attribute
","text":"field_plain_with_validator: int = 100\n
Show standard field with type annotation.
"},{"location":"#model_noext.ExampleModel.field_with_validator_and_alias","title":"field_with_validator_and_aliasclass-attribute
instance-attribute
","text":"field_with_validator_and_alias: str = Field(\n \"FooBar\", alias=\"BarFoo\", validation_alias=\"BarFoo\"\n)\n
Shows corresponding validator with link/anchor.
"},{"location":"#model_noext.ExampleModel.field_without_default","title":"field_without_defaultinstance-attribute
","text":"field_without_default: str\n
Shows the [Required] marker in the signature.
"},{"location":"#model_noext.ExampleModel.check_max_length_ten","title":"check_max_length_tenclassmethod
","text":"check_max_length_ten(v) -> str\n
Show corresponding field with link/anchor.
"},{"location":"#model_noext.ExampleModel","title":"Overview","text":""},{"location":"#model_noext.ExampleModel.field_plain_with_validator","title":"Overview","text":""},{"location":"#model_noext.ExampleModel.field_with_validator_and_alias","title":"Overview","text":""},{"location":"#model_noext.ExampleModel.field_without_default","title":"Overview","text":""},{"location":"#model_noext.ExampleModel.check_max_length_ten","title":"Overview","text":""},{"location":"#model_ext.ExampleModel","title":"ExampleModelpydantic-model
","text":" Bases: BaseModel
An example model.
Config:
frozen
: False
Fields:
field_without_default
(str
) field_plain_with_validator
(int
) field_with_validator_and_alias
(str
) field_with_constraints_and_description
(int
) Validators:
check_max_length_ten
\u2192 field_with_validator_and_alias
, field_without_default
pydantic-field
","text":"field_plain_with_validator: int\n
Show standard field with type annotation.
"},{"location":"#model_ext.ExampleModel.field_with_constraints_and_description","title":"field_with_constraints_and_descriptionpydantic-field
","text":"field_with_constraints_and_description: int = 5\n
Shows constraints within doc string.
"},{"location":"#model_ext.ExampleModel.field_with_validator_and_alias","title":"field_with_validator_and_aliaspydantic-field
","text":"field_with_validator_and_alias: str\n
Shows corresponding validator with link/anchor.
"},{"location":"#model_ext.ExampleModel.field_without_default","title":"field_without_defaultpydantic-field
","text":"field_without_default: str\n
Shows the [Required] marker in the signature.
"},{"location":"#model_ext.ExampleModel.check_max_length_ten","title":"check_max_length_tenpydantic-validator
","text":"check_max_length_ten(v) -> str\n
Show corresponding field with link/anchor.
"},{"location":"#model_ext.ExampleModel","title":"Overview","text":""},{"location":"#model_ext.ExampleModel.field_plain_with_validator","title":"Overview","text":""},{"location":"#model_ext.ExampleModel.field_with_constraints_and_description","title":"Overview","text":""},{"location":"#model_ext.ExampleModel.field_with_validator_and_alias","title":"Overview","text":""},{"location":"#model_ext.ExampleModel.field_without_default","title":"Overview","text":""},{"location":"#model_ext.ExampleModel.check_max_length_ten","title":"Overview","text":""},{"location":"changelog/","title":"Changelog","text":"All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
"},{"location":"code_of_conduct/","title":"Contributor Covenant Code of Conduct","text":""},{"location":"code_of_conduct/#our-pledge","title":"Our Pledge","text":"We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
"},{"location":"code_of_conduct/#our-standards","title":"Our Standards","text":"Examples of behavior that contributes to a positive environment for our community include:
Examples of unacceptable behavior include:
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
"},{"location":"code_of_conduct/#scope","title":"Scope","text":"This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
"},{"location":"code_of_conduct/#enforcement","title":"Enforcement","text":"Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at pawamoy@pm.me. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
"},{"location":"code_of_conduct/#enforcement-guidelines","title":"Enforcement Guidelines","text":"Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
"},{"location":"code_of_conduct/#1-correction","title":"1. Correction","text":"Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
"},{"location":"code_of_conduct/#2-warning","title":"2. Warning","text":"Community Impact: A violation through a single incident or series of actions.
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
"},{"location":"code_of_conduct/#3-temporary-ban","title":"3. Temporary Ban","text":"Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
"},{"location":"code_of_conduct/#4-permanent-ban","title":"4. Permanent Ban","text":"Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
Consequence: A permanent ban from any sort of public interaction within the community.
"},{"location":"code_of_conduct/#attribution","title":"Attribution","text":"This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
"},{"location":"contributing/","title":"Contributing","text":"Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
"},{"location":"contributing/#environment-setup","title":"Environment setup","text":"Nothing easier!
Fork and clone the repository, then:
cd griffe-pydantic\nmake setup\n
Note
If it fails for some reason, you'll need to install PDM manually.
You can install it with:
python3 -m pip install --user pipx\npipx install pdm\n
Now you can try running make setup
again, or simply pdm install
.
You now have the dependencies installed.
Run make help
to see all the available actions!
This project uses duty to run tasks. A Makefile is also provided. The Makefile will try to run certain tasks on multiple Python versions. If for some reason you don't want to run the task on multiple Python versions, you run the task directly with pdm run duty TASK
.
The Makefile detects if a virtual environment is activated, so make
will work the same with the virtualenv activated or not.
If you work in VSCode, see examples of tasks and run configurations.
"},{"location":"contributing/#development","title":"Development","text":"As usual:
git switch -c feature-or-bugfix-name
Before committing:
make format
to auto-format the codemake check
to check everything (fix any warning)make test
to run the tests (fix any issue)make docs
If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review.
Don't bother updating the changelog, we will take care of this.
"},{"location":"contributing/#commit-message-convention","title":"Commit message convention","text":"Commit messages must follow our convention based on the Angular style or the Karma convention:
<type>[(scope)]: Subject\n\n[Body]\n
Subject and body must be valid Markdown. Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general.
Scope and body are optional. Type can be:
build
: About packaging, building wheels, etc.chore
: About packaging or repo/files management.ci
: About Continuous Integration.deps
: Dependencies update.docs
: About documentation.feat
: New feature.fix
: Bug fix.perf
: About performance.refactor
: Changes that are not features or bug fixes.style
: A change in code style/format.tests
: About tests.If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown:
Body.\n\nIssue #10: https://github.com/namespace/project/issues/10\nRelated to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15\n
These \"trailers\" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons :
. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number).
We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped.
"},{"location":"contributing/#pull-requests-guidelines","title":"Pull requests guidelines","text":"Link to any related issue in the Pull Request message.
During the review, we recommend using fixups:
# SHA is the SHA of the commit you want to fix\ngit commit --fixup=SHA\n
Once all the changes are approved, you can squash your commits:
git rebase -i --autosquash main\n
And force-push:
git push -f\n
If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging.
"},{"location":"credits/","title":"Credits","text":""},{"location":"credits/#exec-2--credits","title":"Credits","text":"These projects were used to build griffe-pydantic. Thank you!
python
| pdm
| copier-pdm
colorama
Cross-platform colored terminal text. >=0.4
0.4.6
BSD License griffe
Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. >=0.32.0
0.32.0
ISC"},{"location":"credits/#exec-2--development-dependencies","title":"Development dependencies","text":"Project Summary Version (accepted) Version (last resolved) License annotated-types
Reusable constraint types to use with typing.Annotated >=0.4.0
0.5.0
MIT License ansimarkup
Produce colored terminal text with an xml-like markup ~=1.4
1.5.0
Revised BSD License babel
Internationalization utilities >=2.10.3
2.12.1
BSD beautifulsoup4
Screen-scraping library 4.12.2
MIT License black
The uncompromising code formatter. >=23.1
23.7.0
MIT blacken-docs
Run Black on Python code blocks in documentation files. >=1.13
1.15.0
MIT certifi
Python package for providing Mozilla's CA Bundle. >=2017.4.17
2023.5.7
MPL-2.0 charset-normalizer
The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet. <4,>=2
3.2.0
MIT click
Composable command line interface toolkit >=8.0.0
8.1.4
BSD-3-Clause colorama
Cross-platform colored terminal text. ; platform_system == \"Windows\"
0.4.6
BSD License coverage
Code coverage measurement for Python [toml]>=5.2.1
7.2.7
Apache-2.0 csscompressor
A python port of YUI CSS Compressor >=0.9.5
0.9.5
BSD cssselect
cssselect parses CSS3 Selectors and translates them to XPath 1.0 >=1.2.0
1.2.0
BSD dparse
A parser for Python dependency files >=0.6.2
0.6.3
MIT license duty
A simple task runner. >=0.10
1.0.0
ISC exceptiongroup
Backport of PEP 654 (exception groups) >=1.0.0rc8; python_version < \"3.11\"
1.1.2
? execnet
execnet: rapid multi-Python deployment >=1.1
2.0.2
MIT License failprint
Run a command, print its output only if it fails. >=0.11
0.11.1
ISC ghp-import
Copy your docs directly to the gh-pages branch. >=1.0
2.1.0
Apache Software License git-changelog
Automatic Changelog generator using Jinja2 templates. >=1.0
2.0.0
ISC gitdb
Git Object Database <5,>=4.0.1
4.0.10
BSD License gitpython
GitPython is a Python library used to interact with Git repositories 3.1.32
BSD griffe
Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. >=0.24
0.32.0
ISC htmlmin2
An HTML Minifier >=0.1.13
0.1.13
BSD idna
Internationalized Domain Names in Applications (IDNA) <4,>=2.5
3.4
BSD License importlib-metadata
Read metadata from Python packages >=4.3; python_version < \"3.10\"
6.8.0
? iniconfig
brain-dead simple config-ini parsing 2.0.0
MIT License jinja2
A very fast and expressive template engine. <4,>=2.11
3.1.2
BSD-3-Clause jsmin
JavaScript minifier. >=3.0.1
3.0.1
MIT License lxml
Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API. >=4.6
4.9.3
BSD-3-Clause markdown
Python implementation of Markdown. <4.0.0,>=3.3.3
3.3.7
BSD License markdown-callouts
Markdown extension: a classier syntax for admonitions >=0.2
0.3.0
MIT markdown-exec
Utilities to execute code blocks in Markdown files. >=0.5
1.6.0.1.0.0
ISC markdown2
A fast and complete Python implementation of Markdown >=2.4.3
2.4.9
MIT markupsafe
Safely add untrusted strings to HTML/XML markup. >=2.0
2.1.3
BSD-3-Clause mergedeep
A deep merge function for \ud83d\udc0d. >=1.3.4
1.3.4
MIT License mkdocs
Project documentation with Markdown. >=1.3
1.4.3
BSD License mkdocs-coverage
MkDocs plugin to integrate your coverage HTML report into your site. >=0.2
0.2.7
ISC mkdocs-gen-files
MkDocs plugin to programmatically generate documentation pages during the build >=0.3
0.5.0
MIT License mkdocs-git-committers-plugin-2
An MkDocs plugin to create a list of contributors on the page >=1.1
1.1.2
MIT mkdocs-literate-nav
MkDocs plugin to specify the navigation in Markdown instead of YAML >=0.4
0.6.0
MIT License mkdocs-material
Documentation that simply works >=7.3
9.1.18+insiders.4.36.1
MIT License mkdocs-material-extensions
Extension pack for Python Markdown and MkDocs Material. >=1.1
1.1.1
MIT License mkdocs-minify-plugin
An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk >=0.6.4
0.6.4
MIT mkdocstrings
Automatic documentation from sources, for MkDocs. [python]>=0.18
0.22.0
ISC mkdocstrings-python
A Python handler for mkdocstrings. >=0.5.2
1.1.2.1.1.1
ISC mypy
Optional static typing for Python >=0.910
1.4.1
MIT License mypy-extensions
Type system extensions for programs checked with the mypy type checker. >=0.4.3
1.0.0
MIT License packaging
Core utilities for Python packages >=22.0
23.1
BSD License paginate
Divides large result sets into pages for easier browsing >=0.5.6
0.5.6
MIT pathspec
Utility library for gitignore style pattern matching of file paths. >=0.9.0
0.11.1
Mozilla Public License 2.0 (MPL 2.0) pipdeptree
Command line utility to show dependency tree of packages. >=2.3
2.9.5
MIT License platformdirs
A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\". >=2
3.8.1
MIT License pluggy
plugin and hook calling mechanisms for python <2.0,>=0.12
1.2.0
MIT ptyprocess
Run a subprocess in a pseudo terminal ~=0.6; sys_platform != \"win32\"
0.7.0
ISC License (ISCL) pydantic
Data validation using Python type hints >=2.0.2
2.0.2
MIT License pydantic-core
==2.1.2
2.1.2
MIT pygments
Pygments is a syntax highlighting package written in Python. >=2.14
2.15.1
BSD-2-Clause pymdown-extensions
Extension pack for Python Markdown. >=9
10.0.1
MIT License pyquery
A jquery-like library for python >=1.2
2.0.0
BSD pytest
pytest: simple powerful testing with Python >=6.2
7.4.0
MIT pytest-cov
Pytest plugin for measuring coverage. >=3.0
4.1.0
MIT pytest-randomly
Pytest plugin to randomly order tests and control random.seed. >=3.10
3.13.0
MIT pytest-xdist
pytest xdist plugin for distributed testing, most importantly across multiple CPUs >=2.4
3.3.1
MIT python-dateutil
Extensions to the standard Python datetime module >=2.8.1
2.8.2
Dual License pytz
World timezone definitions, modern and historical >=2015.7; python_version < \"3.9\"
2023.3
? pyyaml
YAML parser and emitter for Python >=5.1
6.0
MIT pyyaml-env-tag
A custom YAML tag for referencing environment variables in YAML files. >=0.1
0.1
MIT License readtime
Calculates the time some text takes the average human to read, based on Medium's read time forumula >=2.0
2.0.0
BSD regex
Alternative regular expression module, to replace re. >=2022.4.24
2023.6.3
Apache Software License requests
Python HTTP for Humans. 2.31.0
Apache 2.0 ruamel-yaml
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order >=0.17.21
0.17.32
MIT license ruamel-yaml-clib
C version of reader, parser and emitter for ruamel.yaml derived from libyaml >=0.2.7; platform_python_implementation == \"CPython\" and python_version < \"3.12\"
0.2.7
MIT ruff
An extremely fast Python linter, written in Rust. >=0.0.246
0.0.278
MIT safety
Checks installed dependencies for known vulnerabilities and licenses. >=2
2.3.4
MIT license semver
Python helper for Semantic Versioning (https://semver.org) >=2.13
3.0.1
BSD setuptools
Easily download, build, install, upgrade, and uninstall Python packages >=19.3
68.0.0
MIT License six
Python 2 and 3 compatibility utilities >=1.5
1.16.0
MIT smmap
A pure Python implementation of a sliding window memory map manager <6,>=3.0.1
5.0.0
BSD soupsieve
A modern CSS selector implementation for Beautiful Soup. >1.2
2.4.1
MIT License toml
Python Library for Tom's Obvious, Minimal Language >=0.10
0.10.2
MIT tomli
A lil' TOML parser >=1.1.0; python_version < \"3.11\"
2.0.1
? types-markdown
Typing stubs for Markdown >=3.3
3.4.2.9
Apache-2.0 license types-pyyaml
Typing stubs for PyYAML >=6.0
6.0.12.10
Apache-2.0 license types-toml
Typing stubs for toml >=0.10
0.10.8.6
Apache-2.0 license typing-extensions
Backported and Experimental Type Hints for Python 3.7+ >=3.10.0.0; python_version < \"3.10\"
4.7.1
Python Software Foundation License urllib3
HTTP library with thread-safe connection pooling, file post, and more. <3,>=1.21.1
2.0.3
MIT License watchdog
Filesystem events monitoring >=2.0
3.0.0
Apache License 2.0 zipp
Backport of pathlib-compatible object wrapper for zip files >=0.5
3.16.1
? More credits from the author
"},{"location":"license/","title":"License","text":"ISC License\n\nCopyright (c) 2023, Timoth\u00e9e Mazzucotelli\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n
"},{"location":"insiders/","title":"Insiders","text":"griffe-pydantic follows the sponsorware release strategy, which means that new features are first exclusively released to sponsors as part of Insiders. Read on to learn what sponsorships achieve, how to become a sponsor to get access to Insiders, and what's in it for you!
"},{"location":"insiders/#what-is-insiders","title":"What is Insiders?","text":"griffe-pydantic Insiders is a private fork of griffe-pydantic, hosted as a private GitHub repository. Almost1 all new features are developed as part of this fork, which means that they are immediately available to all eligible sponsors, as they are made collaborators of this repository.
Every feature is tied to a funding goal in monthly subscriptions. When a funding goal is hit, the features that are tied to it are merged back into griffe-pydantic and released for general availability, making them available to all users. Bugfixes are always released in tandem.
Sponsorships start as low as $10 a month.2
"},{"location":"insiders/#what-sponsorships-achieve","title":"What sponsorships achieve","text":"Sponsorships make this project sustainable, as they buy the maintainers of this project time \u2013 a very scarce resource \u2013 which is spent on the development of new features, bug fixing, stability improvement, issue triage and general support. The biggest bottleneck in Open Source is time.3
If you're unsure if you should sponsor this project, check out the list of completed funding goals to learn whether you're already using features that were developed with the help of sponsorships. You're most likely using at least a handful of them, thanks to our awesome sponsors!
"},{"location":"insiders/#whats-in-it-for-me","title":"What's in it for me?","text":"The moment you become a sponsor, you'll get immediate access to 1 additional features that you can start using right away, and which are currently exclusively available to sponsors:
Thanks for your interest in sponsoring! In order to become an eligible sponsor with your GitHub account, visit pawamoy's sponsor profile, and complete a sponsorship of $10 a month or more. You can use your individual or organization GitHub account for sponsoring.
Important: If you're sponsoring @pawamoy through a GitHub organization, please send a short email to pawamoy@pm.me with the name of your organization and the GitHub account of the individual that should be added as a collaborator.4
You can cancel your sponsorship anytime.5
\u00a0 Join our awesome sponsors
If you sponsor publicly, you're automatically added here with a link to your profile and avatar to show your support for griffe-pydantic. Alternatively, if you wish to keep your sponsorship private, you'll be a silent +1. You can select visibility during checkout and change it afterwards.
"},{"location":"insiders/#funding","title":"Funding","text":""},{"location":"insiders/#goals","title":"Goals","text":"The following section lists all funding goals. Each goal contains a list of features prefixed with a checkmark symbol, denoting whether a feature is already available or planned, but not yet implemented. When the funding goal is hit, the features are released for general availability.
"},{"location":"insiders/#1000-gravifridge-user-manual","title":"$ 1,000 \u2014 GraviFridge User Manual","text":"This section lists all funding goals that were previously completed, which means that those features were part of Insiders, but are now generally available and can be used by all users.
"},{"location":"insiders/#frequently-asked-questions","title":"Frequently asked questions","text":""},{"location":"insiders/#compatibility","title":"Compatibility","text":"We're building an open source project and want to allow outside collaborators to use griffe-pydantic locally without having access to Insiders. Is this still possible?
Yes. Insiders is compatible with griffe-pydantic. Almost all new features and configuration options are either backward-compatible or implemented behind feature flags. Most Insiders features enhance the overall experience, though while these features add value for the users of your project, they shouldn't be necessary for previewing when making changes to content.
"},{"location":"insiders/#payment","title":"Payment","text":"We don't want to pay for sponsorship every month. Are there any other options?
Yes. You can sponsor on a yearly basis by switching your GitHub account to a yearly billing cycle. If for some reason you cannot do that, you could also create a dedicated GitHub account with a yearly billing cycle, which you only use for sponsoring (some sponsors already do that).
If you have any problems or further questions, please reach out to pawamoy@pm.me.
"},{"location":"insiders/#terms","title":"Terms","text":"Are we allowed to use Insiders under the same terms and conditions as griffe-pydantic?
Yes. Whether you're an individual or a company, you may use griffe-pydantic Insiders precisely under the same terms as griffe-pydantic, which are given by the ISC License. However, we kindly ask you to respect our fair use policy:
Please don't distribute the source code of Insiders. You may freely use it for public, private or commercial projects, privately fork or mirror it, but please don't make the source code public, as it would counteract the sponsorware strategy.
If you cancel your subscription, you're automatically removed as a collaborator and will miss out on all future updates of Insiders. However, you may use the latest version that's available to you as long as you like. Just remember that GitHub deletes private forks.
In general, every new feature is first exclusively released to sponsors, but sometimes upstream dependencies enhance existing features that must be supported by griffe-pydantic.\u00a0\u21a9
Note that $10 a month is the minimum amount to become eligible for Insiders. While GitHub Sponsors also allows to sponsor lower amounts or one-time amounts, those can't be granted access to Insiders due to technical reasons. Such contributions are still very much welcome as they help ensuring the project's sustainability.\u00a0\u21a9
Making an Open Source project sustainable is exceptionally hard: maintainers burn out, projects are abandoned. That's not great and very unpredictable. The sponsorware model ensures that if you decide to use griffe-pydantic, you can be sure that bugs are fixed quickly and new features are added regularly.\u00a0\u21a9
It's currently not possible to grant access to each member of an organization, as GitHub only allows for adding users. Thus, after sponsoring, please send an email to pawamoy@pm.me, stating which account should become a collaborator of the Insiders repository. We're working on a solution which will make access to organizations much simpler. To ensure that access is not tied to a particular individual GitHub account, create a bot account (i.e. a GitHub account that is not tied to a specific individual), and use this account for the sponsoring. After being added to the list of collaborators, the bot account can create a private fork of the private Insiders GitHub repository, and grant access to all members of the organizations.\u00a0\u21a9
If you cancel your sponsorship, GitHub schedules a cancellation request which will become effective at the end of the billing cycle. This means that even though you cancel your sponsorship, you will keep your access to Insiders as long as your cancellation isn't effective. All charges are processed by GitHub through Stripe. As we don't receive any information regarding your payment, and GitHub doesn't offer refunds, sponsorships are non-refundable.\u00a0\u21a9
griffe-pydantic Insiders is a compatible drop-in replacement for griffe-pydantic, and can be installed similarly using pip
or git
. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.
griffe-pydantic Insiders can be installed with pip
using SSH:
pip install git+ssh://git@github.com/pawamoy-insiders/griffe-pydantic.git\n
Or using HTTPS:
pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/griffe-pydantic.git\n
How to get a GitHub personal access token The GH_TOKEN
environment variable is a GitHub token. It can be obtained by creating a personal access token for your GitHub account. It will give you access to the Insiders repository, programmatically, from the command line or GitHub Actions workflows:
repo
scopeNote that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories.
"},{"location":"insiders/installation/#with-pip-self-hosted","title":"with pip (self-hosted)","text":"Self-hosting the Insiders package makes it possible to depend on griffe-pydantic normally, while transparently downloading and installing the Insiders version locally. It means that you can specify your dependencies normally, and your contributors without access to Insiders will get the public version, while you get the Insiders version on your machine.
Limitation
With this method, there is no way to force the installation of an Insiders version rather than a public version. If there is a public version that is more recent than your self-hosted Insiders version, the public version will take precedence. Remember to regularly update your self-hosted versions by uploading latest distributions.
You can build the distributions for Insiders yourself, by cloning the repository and using build to build the distributions, or you can download them from our GitHub Releases. You can upload these distributions to a private PyPI-like registry (Artifactory, Google Cloud, pypiserver, etc.) with Twine:
# download distributions in ~/dists, then upload with:\ntwine upload --repository-url https://your-private-index.com ~/dists/*\n
You might also need to provide a username and password/token to authenticate against the registry. Please check Twine's documentation.
You can then configure pip (or other tools) to look for packages into your package index. For example, with pip:
pip config set global.extra-index-url https://your-private-index.com/simple\n
Note that the URL might differ depending on whether your are uploading a package (with Twine) or installing a package (with pip), and depending on the registry you are using (Artifactory, Google Cloud, etc.). Please check the documentation of your registry to learn how to configure your environment.
We kindly ask that you do not upload the distributions to public registries, as it is against our Terms of use.
Full example withpypiserver
In this example we use pypiserver to serve a local PyPI index.
pip install --user pypiserver\n# or pipx install pypiserver\n\n# create a packages directory\nmkdir -p ~/.local/pypiserver/packages\n\n# run the pypi server without authentication\npypi-server run -p 8080 -a . -P . ~/.local/pypiserver/packages &\n
We can configure the credentials to access the server in ~/.pypirc
:
[distutils]\nindex-servers =\nlocal\n\n[local]\nrepository: http://localhost:8080\nusername:\npassword:\n
We then clone the Insiders repository, build distributions and upload them to our local server:
# clone the repository\ngit clone git@github.com:pawamoy-insiders/griffe-pydantic\ncd griffe-pydantic\n\n# install build\npip install --user build\n# or pipx install build\n\n# checkout latest tag\ngit checkout $(git describe --tags --abbrev=0)\n\n# build the distributions\npyproject-build\n\n# upload them to our local server\ntwine upload -r local dist/* --skip-existing\n
Finally, we configure pip, and for example PDM, to use our local index to find packages:
pip config set global.extra-index-url http://localhost:8080/simple\npdm config pypi.extra.url http://localhost:8080/simple\n
Now when running pip install griffe-pydantic
, or resolving dependencies with PDM, both tools will look into our local index and find the Insiders version. Remember to update your local index regularly!
Of course, you can use griffe-pydantic Insiders directly from git
:
git clone git@github.com:pawamoy-insiders/griffe-pydantic\n
When cloning from git
, the package must be installed:
pip install -e griffe-pydantic\n
"},{"location":"insiders/installation/#upgrading","title":"Upgrading","text":"When upgrading Insiders, you should always check the version of griffe-pydantic which makes up the first part of the version qualifier. For example, a version like 8.x.x.4.x.x
means that Insiders 4.x.x
is currently based on 8.x.x
.
If the major version increased, it's a good idea to consult the changelog and go through the steps to ensure your configuration is up to date and all necessary changes have been made.
"},{"location":"reference/griffe_pydantic/","title":"Index","text":""},{"location":"reference/griffe_pydantic/#griffe_pydantic","title":"griffe_pydantic","text":"griffe-pydantic package.
Griffe extension for Pydantic.
"},{"location":"reference/griffe_pydantic/#griffe_pydantic.PydanticExtension","title":"PydanticExtension","text":"PydanticExtension(*, schema: bool = False) -> None\n
Bases: Extension
Griffe extension for Pydantic.
Parameters:
bool
) \u2013 Whether to compute and store the JSON schema of models.
on_attribute_instance(\n node: ast.AST | ObjectNode, attr: Attribute\n) -> None\n
Handle Pydantic fields.
"},{"location":"reference/griffe_pydantic/#griffe_pydantic.extension.PydanticExtension.on_class_instance","title":"on_class_instance","text":"on_class_instance(\n node: ast.AST | ObjectNode, cls: Class\n) -> None\n
Detect and prepare Pydantic models.
"},{"location":"reference/griffe_pydantic/#griffe_pydantic.extension.PydanticExtension.on_class_members","title":"on_class_members","text":"on_class_members(\n node: ast.AST | ObjectNode, cls: Class\n) -> None\n
Finalize the Pydantic model data.
"},{"location":"reference/griffe_pydantic/#griffe_pydantic.extension.PydanticExtension.on_function_instance","title":"on_function_instance","text":"on_function_instance(\n node: ast.AST | ObjectNode, func: Function\n) -> None\n
Handle Pydantic field validators.
"},{"location":"reference/griffe_pydantic/#griffe_pydantic.get_templates_path","title":"get_templates_path","text":"get_templates_path() -> Path\n
Return the templates directory path.
"},{"location":"reference/griffe_pydantic/extension/","title":"
extension","text":""},{"location":"reference/griffe_pydantic/extension/#griffe_pydantic.extension","title":"extension","text":"Griffe extension for Pydantic.
"},{"location":"reference/griffe_pydantic/extension/#griffe_pydantic.extension.PydanticExtension","title":"PydanticExtension","text":"PydanticExtension(*, schema: bool = False) -> None\n
Bases: Extension
Griffe extension for Pydantic.
Parameters:
bool
) \u2013 Whether to compute and store the JSON schema of models.
on_attribute_instance(\n node: ast.AST | ObjectNode, attr: Attribute\n) -> None\n
Handle Pydantic fields.
"},{"location":"reference/griffe_pydantic/extension/#griffe_pydantic.extension.PydanticExtension.on_class_instance","title":"on_class_instance","text":"on_class_instance(\n node: ast.AST | ObjectNode, cls: Class\n) -> None\n
Detect and prepare Pydantic models.
"},{"location":"reference/griffe_pydantic/extension/#griffe_pydantic.extension.PydanticExtension.on_class_members","title":"on_class_members","text":"on_class_members(\n node: ast.AST | ObjectNode, cls: Class\n) -> None\n
Finalize the Pydantic model data.
"},{"location":"reference/griffe_pydantic/extension/#griffe_pydantic.extension.PydanticExtension.on_function_instance","title":"on_function_instance","text":"on_function_instance(\n node: ast.AST | ObjectNode, func: Function\n) -> None\n
Handle Pydantic field validators.
"},{"location":"coverage/","title":"Coverage","text":""}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index 151d46c..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,63 +0,0 @@ - -