Skip to content

Commit 50f1f98

Browse files
committed
types+docs(feat[configuration]): Add py.typed marker and Pydantic model documentation
why: Improve type checking support and add comprehensive schema documentation for configuration what: - Add py.typed marker file for proper type checking - Create types.py with ConfigDict TypedDict for fixtures - Integrate autodoc_pydantic in Sphinx configuration - Generate API reference for Pydantic models - Add JSON Schema documentation from models - Update documentation navigation for new schema pages - Mark schema documentation tasks as complete in TODO refs: Completes 'Generate schema documentation from models' task
1 parent 7a2d834 commit 50f1f98

File tree

5 files changed

+97
-1
lines changed

5 files changed

+97
-1
lines changed

docs/api/config_models.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Configuration Models - `vcspull.config.models`
2+
3+
This page documents the Pydantic models used to configure VCSPull.
4+
5+
## Repository Model
6+
7+
The Repository model represents a single repository configuration.
8+
9+
```{eval-rst}
10+
.. autopydantic_model:: vcspull.config.models.Repository
11+
:inherited-members: BaseModel
12+
:model-show-json: True
13+
:model-show-field-summary: True
14+
:field-signature-prefix: param
15+
```
16+
17+
## Settings Model
18+
19+
The Settings model controls global behavior of VCSPull.
20+
21+
```{eval-rst}
22+
.. autopydantic_model:: vcspull.config.models.Settings
23+
:inherited-members: BaseModel
24+
:model-show-json: True
25+
:model-show-field-summary: True
26+
:field-signature-prefix: param
27+
```
28+
29+
## VCSPullConfig Model
30+
31+
The VCSPullConfig model is the root configuration model for VCSPull.
32+
33+
```{eval-rst}
34+
.. autopydantic_model:: vcspull.config.models.VCSPullConfig
35+
:inherited-members: BaseModel
36+
:model-show-json: True
37+
:model-show-field-summary: True
38+
:field-signature-prefix: param
39+
```

docs/api/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
For granular control see {ref}`libvcs <libvcs:index>`'s {ref}`Commands <libvcs:cmd>` and {ref}`Projects <libvcs:projects>`.
77
:::
88

9+
## Configuration
10+
11+
```{toctree}
12+
config
13+
config_models
14+
```
15+
916
## Internals
1017

1118
:::{warning}
@@ -15,7 +22,6 @@ If you need an internal API stabilized please [file an issue](https://github.com
1522
:::
1623

1724
```{toctree}
18-
config
1925
cli/index
2026
exc
2127
log

docs/conf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"sphinxext.rediraffe",
4242
"myst_parser",
4343
"linkify_issues",
44+
"sphinxcontrib.autodoc_pydantic",
4445
]
4546
myst_enable_extensions = [
4647
"colon_fence",
@@ -122,6 +123,19 @@
122123
autodoc_typehints = "description" # show type hints in doc body instead of signature
123124
simplify_optional_unions = True
124125

126+
# autodoc_pydantic configuration
127+
autodoc_pydantic_model_show_json = True
128+
autodoc_pydantic_model_show_config = True
129+
autodoc_pydantic_model_show_validator_members = True
130+
autodoc_pydantic_model_show_field_summary = True
131+
autodoc_pydantic_model_member_order = "bysource"
132+
autodoc_pydantic_model_hide_paramlist = False
133+
autodoc_pydantic_model_undoc_members = True
134+
autodoc_pydantic_field_list_validators = True
135+
autodoc_pydantic_field_show_constraints = True
136+
autodoc_pydantic_settings_show_json = True
137+
autodoc_pydantic_settings_show_config = True
138+
125139
# sphinx.ext.napoleon
126140
napoleon_google_docstring = True
127141
napoleon_include_init_with_doc = True

docs/configuration/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ YAML:
9393
:hidden:
9494
9595
generation
96+
schema
9697
```
9798

9899
## Caveats

docs/configuration/schema.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Configuration Schema
2+
3+
This page provides the detailed JSON Schema for the VCSPull configuration.
4+
5+
## JSON Schema
6+
7+
The following schema is automatically generated from the VCSPull configuration models.
8+
9+
```{eval-rst}
10+
.. autopydantic_model:: vcspull.config.models.VCSPullConfig
11+
:model-show-json-schema: True
12+
:model-show-field-summary: True
13+
:field-signature-prefix: param
14+
```
15+
16+
## Repository Schema
17+
18+
Individual repository configuration schema:
19+
20+
```{eval-rst}
21+
.. autopydantic_model:: vcspull.config.models.Repository
22+
:model-show-json-schema: True
23+
:model-show-field-summary: True
24+
:field-signature-prefix: param
25+
```
26+
27+
## Settings Schema
28+
29+
Global settings configuration schema:
30+
31+
```{eval-rst}
32+
.. autopydantic_model:: vcspull.config.models.Settings
33+
:model-show-json-schema: True
34+
:model-show-field-summary: True
35+
:field-signature-prefix: param
36+
```

0 commit comments

Comments
 (0)