dynapydantic 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. dynapydantic-0.1.0/.github/workflows/ci.yml +48 -0
  2. dynapydantic-0.1.0/.github/workflows/pre-commit.yml +14 -0
  3. dynapydantic-0.1.0/.gitignore +17 -0
  4. dynapydantic-0.1.0/.pre-commit-config.yaml +31 -0
  5. dynapydantic-0.1.0/.python-version +1 -0
  6. dynapydantic-0.1.0/LICENSE +21 -0
  7. dynapydantic-0.1.0/PKG-INFO +21 -0
  8. dynapydantic-0.1.0/README.md +11 -0
  9. dynapydantic-0.1.0/htmlcov/.gitignore +2 -0
  10. dynapydantic-0.1.0/htmlcov/class_index.html +213 -0
  11. dynapydantic-0.1.0/htmlcov/coverage_html_cb_6fb7b396.js +733 -0
  12. dynapydantic-0.1.0/htmlcov/favicon_32_cb_58284776.png +0 -0
  13. dynapydantic-0.1.0/htmlcov/function_index.html +283 -0
  14. dynapydantic-0.1.0/htmlcov/index.html +146 -0
  15. dynapydantic-0.1.0/htmlcov/keybd_closed_cb_ce680311.png +0 -0
  16. dynapydantic-0.1.0/htmlcov/status.json +1 -0
  17. dynapydantic-0.1.0/htmlcov/style_cb_81f8c14c.css +337 -0
  18. dynapydantic-0.1.0/htmlcov/z_f3e6dac33013b94d___init___py.html +118 -0
  19. dynapydantic-0.1.0/htmlcov/z_f3e6dac33013b94d_exceptions_py.html +116 -0
  20. dynapydantic-0.1.0/htmlcov/z_f3e6dac33013b94d_subclass_tracking_model_py.html +218 -0
  21. dynapydantic-0.1.0/htmlcov/z_f3e6dac33013b94d_tracking_group_py.html +302 -0
  22. dynapydantic-0.1.0/pyproject.toml +58 -0
  23. dynapydantic-0.1.0/src/dynapydantic/__init__.py +19 -0
  24. dynapydantic-0.1.0/src/dynapydantic/exceptions.py +17 -0
  25. dynapydantic-0.1.0/src/dynapydantic/py.typed +0 -0
  26. dynapydantic-0.1.0/src/dynapydantic/subclass_tracking_model.py +119 -0
  27. dynapydantic-0.1.0/src/dynapydantic/tracking_group.py +203 -0
  28. dynapydantic-0.1.0/tests/__init__.py +1 -0
  29. dynapydantic-0.1.0/tests/example/animal-plugins/animal_plugins/__init__.py +30 -0
  30. dynapydantic-0.1.0/tests/example/animal-plugins/pyproject.toml +7 -0
  31. dynapydantic-0.1.0/tests/example/base-package/base_package/__init__.py +16 -0
  32. dynapydantic-0.1.0/tests/example/base-package/base_package/__main__.py +6 -0
  33. dynapydantic-0.1.0/tests/example/base-package/base_package/animal.py +22 -0
  34. dynapydantic-0.1.0/tests/example/base-package/base_package/cat.py +16 -0
  35. dynapydantic-0.1.0/tests/example/base-package/base_package/circle.py +15 -0
  36. dynapydantic-0.1.0/tests/example/base-package/base_package/cli.py +70 -0
  37. dynapydantic-0.1.0/tests/example/base-package/base_package/shape.py +23 -0
  38. dynapydantic-0.1.0/tests/example/base-package/pyproject.toml +7 -0
  39. dynapydantic-0.1.0/tests/example/shape-plugins/pyproject.toml +7 -0
  40. dynapydantic-0.1.0/tests/example/shape-plugins/shape_plugins/__init__.py +4 -0
  41. dynapydantic-0.1.0/tests/example/shape-plugins/shape_plugins/plugin_classes.py +31 -0
  42. dynapydantic-0.1.0/tests/example/shape-plugins/shape_plugins/registration.py +15 -0
  43. dynapydantic-0.1.0/tests/test_plugins.py +96 -0
  44. dynapydantic-0.1.0/tests/test_subclass_tracking_model.py +67 -0
  45. dynapydantic-0.1.0/tests/test_tracking_group.py +184 -0
  46. dynapydantic-0.1.0/uv.lock +753 -0
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ release:
8
+ types: [published]
9
+
10
+ jobs:
11
+ test:
12
+ name: Run tests
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
17
+ env:
18
+ UV_PYTHON: ${{ matrix.python-version }}
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v6
23
+ - name: Install the project
24
+ run: uv sync --locked --all-extras --dev
25
+ - name: Run tests
26
+ run: uv run pytest
27
+
28
+ publish-pypi:
29
+ name: Publish to PyPI
30
+ if: github.event_name == 'release' && github.event.action == 'published'
31
+ runs-on: ubuntu-latest
32
+ environment:
33
+ name: pypi
34
+ url: https://pypi.org/p/dynapydantic
35
+ permissions:
36
+ id-token: write
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - name: Install uv
40
+ uses: astral-sh/setup-uv@v6
41
+ - name: Install the project
42
+ run: uv sync --locked --all-extras --dev
43
+ - name: Run tests
44
+ run: uv run pytest tests
45
+ - name: Build package
46
+ run: uv build
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ name: pre-commit
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ pre-commit:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - uses: actions/setup-python@v3
14
+ - uses: pre-commit/action@v3.0.1
@@ -0,0 +1,17 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+ .coverage*
9
+
10
+ # Virtual environments
11
+ .venv
12
+
13
+ # Editor-related files
14
+ *.swp
15
+
16
+ # OS files
17
+ .DS_Store
@@ -0,0 +1,31 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.12.3
4
+ hooks:
5
+ - id: ruff-check
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v5.0.0
11
+ hooks:
12
+ - id: check-added-large-files
13
+ - id: check-case-conflict
14
+ - id: check-executables-have-shebangs
15
+ - id: check-illegal-windows-names
16
+ - id: check-json
17
+ - id: check-merge-conflict
18
+ - id: check-shebang-scripts-are-executable
19
+ - id: check-symlinks
20
+ - id: check-toml
21
+ - id: check-xml
22
+ - id: check-yaml
23
+ - id: debug-statements
24
+ - id: detect-private-key
25
+ - id: end-of-file-fixer
26
+ - id: trailing-whitespace
27
+
28
+ - repo: https://github.com/astral-sh/uv-pre-commit
29
+ rev: 0.7.20
30
+ hooks:
31
+ - id: uv-lock
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Philip Salvaggio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: dynapydantic
3
+ Version: 0.1.0
4
+ Summary: Dyanmic pydantic models
5
+ Author-email: Philip Salvaggio <salvaggio.philip@gmail.com>
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: pydantic>=2.0
9
+ Description-Content-Type: text/markdown
10
+
11
+ # dynapydantic
12
+
13
+ [![CI](https://github.com/psalvaggio/dynapydantic/actions/workflows/ci.yml/badge.svg)](https://github.com/psalvaggio/dynapydantic/actions/workflows/ci.yml)
14
+ [![Pre-commit](https://github.com/psalvaggio/dynapydantic/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/psalvaggio/dynapydantic/actions/workflows/pre-commit.yml)
15
+
16
+ This is a demonstration about how `pydantic` models can track their subclasses
17
+ and round-trip through serialization, both within the package in which they are
18
+ defined and in other packages via `pluggy`.
19
+
20
+ This package is not intended for public use yet. It's strictly a
21
+ proof-of-concept.
@@ -0,0 +1,11 @@
1
+ # dynapydantic
2
+
3
+ [![CI](https://github.com/psalvaggio/dynapydantic/actions/workflows/ci.yml/badge.svg)](https://github.com/psalvaggio/dynapydantic/actions/workflows/ci.yml)
4
+ [![Pre-commit](https://github.com/psalvaggio/dynapydantic/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/psalvaggio/dynapydantic/actions/workflows/pre-commit.yml)
5
+
6
+ This is a demonstration about how `pydantic` models can track their subclasses
7
+ and round-trip through serialization, both within the package in which they are
8
+ defined and in other packages via `pluggy`.
9
+
10
+ This package is not intended for public use yet. It's strictly a
11
+ proof-of-concept.
@@ -0,0 +1,2 @@
1
+ # Created by coverage.py
2
+ *
@@ -0,0 +1,213 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Coverage report</title>
6
+ <link rel="icon" sizes="32x32" href="favicon_32_cb_58284776.png">
7
+ <link rel="stylesheet" href="style_cb_81f8c14c.css" type="text/css">
8
+ <script src="coverage_html_cb_6fb7b396.js" defer></script>
9
+ </head>
10
+ <body class="indexfile">
11
+ <header>
12
+ <div class="content">
13
+ <h1>Coverage report:
14
+ <span class="pc_cov">100%</span>
15
+ </h1>
16
+ <aside id="help_panel_wrapper">
17
+ <input id="help_panel_state" type="checkbox">
18
+ <label for="help_panel_state">
19
+ <img id="keyboard_icon" src="keybd_closed_cb_ce680311.png" alt="Show/hide keyboard shortcuts">
20
+ </label>
21
+ <div id="help_panel">
22
+ <p class="legend">Shortcuts on this page</p>
23
+ <div class="keyhelp">
24
+ <p>
25
+ <kbd>f</kbd>
26
+ <kbd>n</kbd>
27
+ <kbd>s</kbd>
28
+ <kbd>m</kbd>
29
+ <kbd>x</kbd>
30
+ <kbd>b</kbd>
31
+ <kbd>p</kbd>
32
+ <kbd>c</kbd>
33
+ &nbsp; change column sorting
34
+ </p>
35
+ <p>
36
+ <kbd>[</kbd>
37
+ <kbd>]</kbd>
38
+ &nbsp; prev/next file
39
+ </p>
40
+ <p>
41
+ <kbd>?</kbd> &nbsp; show/hide this help
42
+ </p>
43
+ </div>
44
+ </div>
45
+ </aside>
46
+ <form id="filter_container">
47
+ <input id="filter" type="text" value="" placeholder="filter...">
48
+ <div>
49
+ <input id="hide100" type="checkbox" >
50
+ <label for="hide100">hide covered</label>
51
+ </div>
52
+ </form>
53
+ <h2>
54
+ <a class="button" href="index.html">Files</a>
55
+ <a class="button" href="function_index.html">Functions</a>
56
+ <a class="button current">Classes</a>
57
+ </h2>
58
+ <p class="text">
59
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.9.2">coverage.py v7.9.2</a>,
60
+ created at 2025-07-11 18:47 +0000
61
+ </p>
62
+ </div>
63
+ </header>
64
+ <main id="index">
65
+ <table class="index" data-sortable>
66
+ <thead>
67
+ <tr class="tablehead" title="Click to sort">
68
+ <th id="file" class="name left" aria-sort="none" data-shortcut="f">File<span class="arrows"></span></th>
69
+ <th id="region" class="name left" aria-sort="none" data-default-sort-order="ascending" data-shortcut="n">class<span class="arrows"></span></th>
70
+ <th id="statements" aria-sort="none" data-default-sort-order="descending" data-shortcut="s">statements<span class="arrows"></span></th>
71
+ <th id="missing" aria-sort="none" data-default-sort-order="descending" data-shortcut="m">missing<span class="arrows"></span></th>
72
+ <th id="excluded" aria-sort="none" data-default-sort-order="descending" data-shortcut="x">excluded<span class="arrows"></span></th>
73
+ <th id="branches" aria-sort="none" data-default-sort-order="descending" data-shortcut="b">branches<span class="arrows"></span></th>
74
+ <th id="partial" aria-sort="none" data-default-sort-order="descending" data-shortcut="p">partial<span class="arrows"></span></th>
75
+ <th id="coverage" class="right" aria-sort="none" data-shortcut="c">coverage<span class="arrows"></span></th>
76
+ </tr>
77
+ </thead>
78
+ <tbody>
79
+ <tr class="region">
80
+ <td class="name left"><a href="z_f3e6dac33013b94d___init___py.html">src/dynapydantic/__init__.py</a></td>
81
+ <td class="name left"><a href="z_f3e6dac33013b94d___init___py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
82
+ <td>4</td>
83
+ <td>0</td>
84
+ <td>0</td>
85
+ <td>0</td>
86
+ <td>0</td>
87
+ <td class="right" data-ratio="4 4">100%</td>
88
+ </tr>
89
+ <tr class="region">
90
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t4">src/dynapydantic/exceptions.py</a></td>
91
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t4"><data value='Error'>Error</data></a></td>
92
+ <td>0</td>
93
+ <td>0</td>
94
+ <td>0</td>
95
+ <td>0</td>
96
+ <td>0</td>
97
+ <td class="right" data-ratio="0 0">100%</td>
98
+ </tr>
99
+ <tr class="region">
100
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t8">src/dynapydantic/exceptions.py</a></td>
101
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t8"><data value='RegistrationError'>RegistrationError</data></a></td>
102
+ <td>0</td>
103
+ <td>0</td>
104
+ <td>0</td>
105
+ <td>0</td>
106
+ <td>0</td>
107
+ <td class="right" data-ratio="0 0">100%</td>
108
+ </tr>
109
+ <tr class="region">
110
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t12">src/dynapydantic/exceptions.py</a></td>
111
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t12"><data value='AmbiguousDiscriminatorValueError'>AmbiguousDiscriminatorValueError</data></a></td>
112
+ <td>0</td>
113
+ <td>0</td>
114
+ <td>0</td>
115
+ <td>0</td>
116
+ <td>0</td>
117
+ <td class="right" data-ratio="0 0">100%</td>
118
+ </tr>
119
+ <tr class="region">
120
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t16">src/dynapydantic/exceptions.py</a></td>
121
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html#t16"><data value='ConfigurationError'>ConfigurationError</data></a></td>
122
+ <td>0</td>
123
+ <td>0</td>
124
+ <td>0</td>
125
+ <td>0</td>
126
+ <td>0</td>
127
+ <td class="right" data-ratio="0 0">100%</td>
128
+ </tr>
129
+ <tr class="region">
130
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html">src/dynapydantic/exceptions.py</a></td>
131
+ <td class="name left"><a href="z_f3e6dac33013b94d_exceptions_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
132
+ <td>4</td>
133
+ <td>0</td>
134
+ <td>0</td>
135
+ <td>0</td>
136
+ <td>0</td>
137
+ <td class="right" data-ratio="4 4">100%</td>
138
+ </tr>
139
+ <tr class="region">
140
+ <td class="name left"><a href="z_f3e6dac33013b94d_subclass_tracking_model_py.html#t28">src/dynapydantic/subclass_tracking_model.py</a></td>
141
+ <td class="name left"><a href="z_f3e6dac33013b94d_subclass_tracking_model_py.html#t28"><data value='SubclassTrackingModel'>SubclassTrackingModel</data></a></td>
142
+ <td>27</td>
143
+ <td>0</td>
144
+ <td>0</td>
145
+ <td>10</td>
146
+ <td>0</td>
147
+ <td class="right" data-ratio="37 37">100%</td>
148
+ </tr>
149
+ <tr class="region">
150
+ <td class="name left"><a href="z_f3e6dac33013b94d_subclass_tracking_model_py.html">src/dynapydantic/subclass_tracking_model.py</a></td>
151
+ <td class="name left"><a href="z_f3e6dac33013b94d_subclass_tracking_model_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
152
+ <td>10</td>
153
+ <td>0</td>
154
+ <td>0</td>
155
+ <td>0</td>
156
+ <td>0</td>
157
+ <td class="right" data-ratio="10 10">100%</td>
158
+ </tr>
159
+ <tr class="region">
160
+ <td class="name left"><a href="z_f3e6dac33013b94d_tracking_group_py.html#t37">src/dynapydantic/tracking_group.py</a></td>
161
+ <td class="name left"><a href="z_f3e6dac33013b94d_tracking_group_py.html#t37"><data value='TrackingGroup'>TrackingGroup</data></a></td>
162
+ <td>41</td>
163
+ <td>0</td>
164
+ <td>0</td>
165
+ <td>22</td>
166
+ <td>0</td>
167
+ <td class="right" data-ratio="63 63">100%</td>
168
+ </tr>
169
+ <tr class="region">
170
+ <td class="name left"><a href="z_f3e6dac33013b94d_tracking_group_py.html">src/dynapydantic/tracking_group.py</a></td>
171
+ <td class="name left"><a href="z_f3e6dac33013b94d_tracking_group_py.html"><data value=''><span class='no-noun'>(no class)</span></data></a></td>
172
+ <td>20</td>
173
+ <td>0</td>
174
+ <td>0</td>
175
+ <td>0</td>
176
+ <td>0</td>
177
+ <td class="right" data-ratio="20 20">100%</td>
178
+ </tr>
179
+ </tbody>
180
+ <tfoot>
181
+ <tr class="total">
182
+ <td class="name left">Total</td>
183
+ <td class="name left">&nbsp;</td>
184
+ <td>106</td>
185
+ <td>0</td>
186
+ <td>0</td>
187
+ <td>32</td>
188
+ <td>0</td>
189
+ <td class="right" data-ratio="138 138">100%</td>
190
+ </tr>
191
+ </tfoot>
192
+ </table>
193
+ <p id="no_rows">
194
+ No items found using the specified filter.
195
+ </p>
196
+ </main>
197
+ <footer>
198
+ <div class="content">
199
+ <p>
200
+ <a class="nav" href="https://coverage.readthedocs.io/en/7.9.2">coverage.py v7.9.2</a>,
201
+ created at 2025-07-11 18:47 +0000
202
+ </p>
203
+ </div>
204
+ <aside class="hidden">
205
+ <a id="prevFileLink" class="nav" href=""></a>
206
+ <a id="nextFileLink" class="nav" href=""></a>
207
+ <button type="button" class="button_prev_file" data-shortcut="["></button>
208
+ <button type="button" class="button_next_file" data-shortcut="]"></button>
209
+ <button type="button" class="button_show_hide_help" data-shortcut="?"></button>
210
+ </aside>
211
+ </footer>
212
+ </body>
213
+ </html>