pymergetic-cppdantic 0.0.10__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.
@@ -0,0 +1,78 @@
1
+ # sdist (Linux) + manylinux + Windows wheels (cibuildwheel), upload to PyPI on tag v*.
2
+ # Requires repository secret: PYPI_API_TOKEN
3
+
4
+ name: Publish to PyPI
5
+
6
+ on:
7
+ push:
8
+ tags:
9
+ - "v*"
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ os: [ubuntu-latest, windows-latest]
20
+ runs-on: ${{ matrix.os }}
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.12"
29
+
30
+ - name: Wait for pinned pymergetic-easybind on PyPI
31
+ run: |
32
+ python -m pip install "pymergetic-common[release]>=0.0.0"
33
+ python -m pymergetic.common.devtools.wait_pypi --project-root .
34
+
35
+ - name: Preflight consumer repair (easybind path without import)
36
+ run: |
37
+ python -m pip install "pymergetic-common[release]>=0.0.0"
38
+ python -m pymergetic.common.devtools.repair_wheel --verify-consumer --project-root .
39
+
40
+ - name: Install build tools
41
+ run: pip install --upgrade build twine
42
+
43
+ - name: Build sdist
44
+ if: runner.os == 'Linux'
45
+ run: python -m build --sdist
46
+
47
+ - name: Build wheels
48
+ uses: pypa/cibuildwheel@v3.4.0
49
+
50
+ - name: Stage wheels next to sdist
51
+ shell: bash
52
+ run: |
53
+ mkdir -p dist
54
+ cp wheelhouse/*.whl dist/
55
+
56
+ - name: Check distributions
57
+ run: twine check dist/*
58
+
59
+ - uses: actions/upload-artifact@v4
60
+ with:
61
+ name: dist-${{ matrix.os }}
62
+ path: dist/
63
+
64
+ publish:
65
+ needs: build
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/download-artifact@v4
69
+ with:
70
+ pattern: dist-*
71
+ path: dist
72
+ merge-multiple: true
73
+
74
+ - name: Publish to PyPI
75
+ uses: pypa/gh-action-pypi-publish@release/v1
76
+ with:
77
+ password: ${{ secrets.PYPI_API_TOKEN }}
78
+ skip-existing: true
@@ -0,0 +1,212 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ uv.lock
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # nanobind stubgen (regenerated by CMake `nanobind_add_stub`)
12
+ src/pymergetic/cppdantic/__init__.pyi
13
+
14
+ # setuptools-scm (see RELEASING.md)
15
+ src/pymergetic/cppdantic/_version.py
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ share/python-wheels/
32
+ *.egg-info/
33
+ .installed.cfg
34
+ *.egg
35
+ MANIFEST
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py.cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV — not committing the lockfile for this project
106
+ uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ #poetry.lock
114
+ #poetry.toml
115
+
116
+ # pdm
117
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
119
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
120
+ #pdm.lock
121
+ #pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # pixi
126
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
127
+ #pixi.lock
128
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
129
+ # in the .venv directory. It is recommended not to include this directory in version control.
130
+ .pixi
131
+
132
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
133
+ __pypackages__/
134
+
135
+ # Celery stuff
136
+ celerybeat-schedule
137
+ celerybeat.pid
138
+
139
+ # SageMath parsed files
140
+ *.sage.py
141
+
142
+ # Environments
143
+ .env
144
+ .envrc
145
+ .venv
146
+ env/
147
+ venv/
148
+ ENV/
149
+ env.bak/
150
+ venv.bak/
151
+
152
+ # Spyder project settings
153
+ .spyderproject
154
+ .spyproject
155
+
156
+ # Rope project settings
157
+ .ropeproject
158
+
159
+ # mkdocs documentation
160
+ /site
161
+
162
+ # mypy
163
+ .mypy_cache/
164
+ .dmypy.json
165
+ dmypy.json
166
+
167
+ # Pyre type checker
168
+ .pyre/
169
+
170
+ # pytype static type analyzer
171
+ .pytype/
172
+
173
+ # Cython debug symbols
174
+ cython_debug/
175
+
176
+ # PyCharm
177
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
178
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
179
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
180
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
181
+ #.idea/
182
+
183
+ # Abstra
184
+ # Abstra is an AI-powered process automation framework.
185
+ # Ignore directories containing user credentials, local state, and settings.
186
+ # Learn more at https://abstra.io/docs
187
+ .abstra/
188
+
189
+ # Visual Studio Code
190
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
191
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
192
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
193
+ # you could uncomment the following to ignore the entire vscode folder
194
+ # .vscode/
195
+
196
+ # Ruff stuff:
197
+ .ruff_cache/
198
+
199
+ # PyPI configuration file
200
+ .pypirc
201
+
202
+ # Cursor
203
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
204
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
205
+ # refer to https://docs.cursor.com/context/ignore-files
206
+ .cursorignore
207
+ .cursorindexingignore
208
+
209
+ # Marimo
210
+ marimo/_static/
211
+ marimo/_lsp/
212
+ __marimo__/
@@ -0,0 +1,57 @@
1
+ cmake_minimum_required(VERSION 3.25)
2
+
3
+ project(pymergetic_cppdantic LANGUAGES CXX)
4
+
5
+ set(CMAKE_CXX_STANDARD 20)
6
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
+
8
+ include(GNUInstallDirs)
9
+
10
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
11
+ execute_process(
12
+ COMMAND "${Python_EXECUTABLE}" -c
13
+ "import pathlib, pymergetic.easybind; print(pathlib.Path(pymergetic.easybind.__file__).resolve().parent / 'cmake' / 'easybind_pip.cmake')"
14
+ OUTPUT_STRIP_TRAILING_WHITESPACE
15
+ OUTPUT_VARIABLE _eb_pip
16
+ COMMAND_ERROR_IS_FATAL ANY
17
+ )
18
+ include("${_eb_pip}")
19
+ easybind_pip_setup()
20
+ easybind_fetch_magic_enum()
21
+
22
+ nanobind_add_module(cppdantic__init__ NB_SHARED src/pymergetic/cppdantic/hello.cpp)
23
+ # Headers are #include <pymergetic/easybind/...> — include root is site-packages (parent of pymergetic/).
24
+ get_filename_component(_eb_include_root "${EASYBIND_PKG_DIR}/../.." ABSOLUTE)
25
+ target_include_directories(cppdantic__init__ PRIVATE "${_eb_include_root}")
26
+ target_link_libraries(cppdantic__init__ PRIVATE "${EASYBIND_CORE_LIB}")
27
+ easybind_pip_link_magic_enum(cppdantic__init__)
28
+
29
+ set_target_properties(cppdantic__init__ PROPERTIES
30
+ OUTPUT_NAME "__init__"
31
+ LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pymergetic/cppdantic"
32
+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pymergetic/cppdantic"
33
+ )
34
+
35
+ easybind_pip_set_rpath_next_to_easybind(cppdantic__init__ "${EASYBIND_PKG_DIR}")
36
+
37
+ # Stubs are committed; skip on Windows (nanobind_add_stub import often fails in CI — same as easybind).
38
+ if(NOT WIN32)
39
+ set(_cppdantic_pyi "${CMAKE_CURRENT_SOURCE_DIR}/src/pymergetic/cppdantic/__init__.pyi")
40
+ get_filename_component(_cppdantic_pyi_dir "${_cppdantic_pyi}" DIRECTORY)
41
+ file(MAKE_DIRECTORY "${_cppdantic_pyi_dir}")
42
+ nanobind_add_stub(cppdantic_stub
43
+ MODULE pymergetic.cppdantic
44
+ OUTPUT ${_cppdantic_pyi}
45
+ PYTHON_PATH $<TARGET_FILE_DIR:cppdantic__init__>
46
+ DEPENDS cppdantic__init__
47
+ )
48
+ endif()
49
+
50
+ install(TARGETS cppdantic__init__
51
+ LIBRARY DESTINATION pymergetic/cppdantic
52
+ RUNTIME DESTINATION pymergetic/cppdantic
53
+ ARCHIVE DESTINATION pymergetic/cppdantic
54
+ )
55
+ if(NOT WIN32)
56
+ install(FILES ${_cppdantic_pyi} DESTINATION pymergetic/cppdantic)
57
+ endif()
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymergetic-cppdantic
3
+ Version: 0.0.10
4
+ Summary: Hello-world nanobind extension built against pymergetic.easybind (import pymergetic.cppdantic)
5
+ Keywords: cppdantic,pymergetic-cppdantic,nanobind,easybind,bindings,pymergetic
6
+ Author-Email: PymergeticOS Maintainers <raudzus@pymergetic.com>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: C++
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Typing :: Typed
19
+ Project-URL: Homepage, https://github.com/pymergetic/cppdantic
20
+ Project-URL: Repository, https://github.com/pymergetic/cppdantic
21
+ Project-URL: Issues, https://github.com/pymergetic/cppdantic/issues
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: pymergetic-common[easybind]>=0.0.0
24
+ Provides-Extra: test
25
+ Requires-Dist: pymergetic-common[test]; extra == "test"
26
+ Description-Content-Type: text/markdown
27
+
28
+ # cppdantic
29
+
30
+ Small demo that **builds against `pymergetic.easybind`** from PyPI (`pymergetic-easybind`). **PyPI distribution:** **`pymergetic-cppdantic`**. **Import:** **`pymergetic.cppdantic`**. The repo directory stays **`packages/cppdantic/`** in the os-sdk monorepo.
31
+
32
+ **PyPI:** [`pymergetic-cppdantic`](https://pypi.org/project/pymergetic-cppdantic/) (when published). Versioning and tags: **`RELEASING.md`**.
33
+
34
+ **Platforms:** CI publishes **manylinux** and **Windows amd64** wheels (CPython 3.11–3.14). Install with `pip install pymergetic-cppdantic` on those platforms once wheels exist for your release.
35
+
36
+ **Bumping `pymergetic-easybind~=…`:** **`pymergetic-pin-pyproject --project-root .`** (from **pymergetic-common** devtools on PyPI). Default = latest **`v*`** tag on **GitHub**. Use **`--from-pypi`** for PyPI’s published latest instead — see **`RELEASING.md`**.
37
+
38
+ ## Build / test
39
+
40
+ You need **`pymergetic-easybind`** installed (matching the pin in **`pyproject.toml`**), plus CMake ≥ 3.25, Ninja, and a C++20 compiler on `PATH`:
41
+
42
+ ```bash
43
+ python -m pip install -U pip
44
+ python -m pip install "pymergetic-easybind~=0.2.15" # align with pyproject.toml
45
+ python -m pip install -e '.[test]'
46
+ python -m pytest tests -q
47
+ ```
48
+
49
+ `CMake` loads **`easybind/cmake/easybind_pip.cmake`** from the installed **`pymergetic.easybind`** package. PyPI must ship the **`cmake/`** tree for the version you pin.
50
+
51
+ ### os-sdk workspace (editable easybind)
52
+
53
+ From the **os-sdk repo root**:
54
+
55
+ ```bash
56
+ uv sync
57
+ python -m pytest packages/cppdantic/tests -q
58
+ ```
59
+
60
+ Or install only **pymergetic-cppdantic** after syncing **`pymergetic-common[easybind]`** in a venv with editable easybind (standalone checkout).
61
+
62
+ ### uv
63
+
64
+ From the **cppdantic repo root**:
65
+
66
+ ```bash
67
+ uv pip install "pymergetic-easybind~=0.2.15"
68
+ uv pip install -e ".[test]"
69
+ ```
70
+
71
+ (`pyproject.toml` sets **`[tool.uv] no-build-isolation-package = ["pymergetic-cppdantic"]`** so editable builds use your venv.)
72
+
73
+ If **`uv pip install`** fails with **`Metadata mismatch in METADATA`** (setuptools-scm version differs between build phases), clear stale artifacts and install **pymergetic-easybind** first, then **pymergetic-cppdantic**:
74
+
75
+ ```bash
76
+ rm -rf build dist *.egg-info src/pymergetic/cppdantic/*.egg-info
77
+ uv pip install -e ../easybind # monorepo sibling, or pymergetic-easybind from PyPI
78
+ uv pip install -e ".[test]"
79
+ ```
80
+
81
+ Ensure **`src/pymergetic/cppdantic/_version.py`** is not tracked by git (it is gitignored).
82
+
83
+ ## Tagging
84
+
85
+ Create an annotated **`v*`** tag on **`main`** after your pins commit (see **`RELEASING.md`**).
@@ -0,0 +1,58 @@
1
+ # cppdantic
2
+
3
+ Small demo that **builds against `pymergetic.easybind`** from PyPI (`pymergetic-easybind`). **PyPI distribution:** **`pymergetic-cppdantic`**. **Import:** **`pymergetic.cppdantic`**. The repo directory stays **`packages/cppdantic/`** in the os-sdk monorepo.
4
+
5
+ **PyPI:** [`pymergetic-cppdantic`](https://pypi.org/project/pymergetic-cppdantic/) (when published). Versioning and tags: **`RELEASING.md`**.
6
+
7
+ **Platforms:** CI publishes **manylinux** and **Windows amd64** wheels (CPython 3.11–3.14). Install with `pip install pymergetic-cppdantic` on those platforms once wheels exist for your release.
8
+
9
+ **Bumping `pymergetic-easybind~=…`:** **`pymergetic-pin-pyproject --project-root .`** (from **pymergetic-common** devtools on PyPI). Default = latest **`v*`** tag on **GitHub**. Use **`--from-pypi`** for PyPI’s published latest instead — see **`RELEASING.md`**.
10
+
11
+ ## Build / test
12
+
13
+ You need **`pymergetic-easybind`** installed (matching the pin in **`pyproject.toml`**), plus CMake ≥ 3.25, Ninja, and a C++20 compiler on `PATH`:
14
+
15
+ ```bash
16
+ python -m pip install -U pip
17
+ python -m pip install "pymergetic-easybind~=0.2.15" # align with pyproject.toml
18
+ python -m pip install -e '.[test]'
19
+ python -m pytest tests -q
20
+ ```
21
+
22
+ `CMake` loads **`easybind/cmake/easybind_pip.cmake`** from the installed **`pymergetic.easybind`** package. PyPI must ship the **`cmake/`** tree for the version you pin.
23
+
24
+ ### os-sdk workspace (editable easybind)
25
+
26
+ From the **os-sdk repo root**:
27
+
28
+ ```bash
29
+ uv sync
30
+ python -m pytest packages/cppdantic/tests -q
31
+ ```
32
+
33
+ Or install only **pymergetic-cppdantic** after syncing **`pymergetic-common[easybind]`** in a venv with editable easybind (standalone checkout).
34
+
35
+ ### uv
36
+
37
+ From the **cppdantic repo root**:
38
+
39
+ ```bash
40
+ uv pip install "pymergetic-easybind~=0.2.15"
41
+ uv pip install -e ".[test]"
42
+ ```
43
+
44
+ (`pyproject.toml` sets **`[tool.uv] no-build-isolation-package = ["pymergetic-cppdantic"]`** so editable builds use your venv.)
45
+
46
+ If **`uv pip install`** fails with **`Metadata mismatch in METADATA`** (setuptools-scm version differs between build phases), clear stale artifacts and install **pymergetic-easybind** first, then **pymergetic-cppdantic**:
47
+
48
+ ```bash
49
+ rm -rf build dist *.egg-info src/pymergetic/cppdantic/*.egg-info
50
+ uv pip install -e ../easybind # monorepo sibling, or pymergetic-easybind from PyPI
51
+ uv pip install -e ".[test]"
52
+ ```
53
+
54
+ Ensure **`src/pymergetic/cppdantic/_version.py`** is not tracked by git (it is gitignored).
55
+
56
+ ## Tagging
57
+
58
+ Create an annotated **`v*`** tag on **`main`** after your pins commit (see **`RELEASING.md`**).
@@ -0,0 +1,98 @@
1
+ # Releasing pymergetic-cppdantic to PyPI
2
+
3
+ **PyPI / pip:** **`pymergetic-cppdantic`**. **Import:** **`import pymergetic.cppdantic`**.
4
+
5
+ **Pins vs installs:** **`pymergetic-pin-pyproject --project-root .`** sets pins from the **latest `v*`** tag on **GitHub**. Wait until the pinned dependency exists on PyPI before isolated installs or CI (**`pymergetic-wait-pypi --project-root .`** in publish workflow).
6
+
7
+ ## Renamed from `cppdantic` on PyPI
8
+
9
+ Older releases were published as **`cppdantic`** (`pypi.org/project/cppdantic/`). New releases use **`pymergetic-cppdantic`**. PyPI does not rename projects in place — the next **`v*`** tag creates/uploads under the new name automatically (same CI workflow; `[project].name` in `pyproject.toml` drives the target).
10
+
11
+ **Downstream pins:** change `cppdantic` / `import cppdantic` → `pymergetic-cppdantic` / `import pymergetic.cppdantic`. Optionally publish one final **`cppdantic`** metapackage release that depends on **`pymergetic-cppdantic==X.Y.Z`** for a soft migration window.
12
+
13
+ ## End-to-end workflow (pymergetic-easybind → PyPI → bump → tag)
14
+
15
+ Do this in order.
16
+
17
+ ### 1) Release **pymergetic-easybind**
18
+
19
+ ```bash
20
+ cd /path/to/easybind # e.g. ~/Devel/os-sdk/packages/easybind
21
+
22
+ pymergetic-release-tag --dry-run
23
+ pymergetic-release-tag
24
+ ```
25
+
26
+ - Wait until GitHub **Publish to PyPI** on **easybind** finishes.
27
+ - Check PyPI: **https://pypi.org/project/pymergetic-easybind/** shows that version.
28
+
29
+ ### 2) Bump **pymergetic-cppdantic** `pyproject.toml` pins (manual; not CI)
30
+
31
+ ```bash
32
+ cd /path/to/cppdantic
33
+ python -m pip install -U "pymergetic-common[release]>=0.0.0"
34
+
35
+ pymergetic-pin-pyproject --project-root . --dry-run
36
+ pymergetic-pin-pyproject --project-root .
37
+
38
+ git add pyproject.toml
39
+ git commit -m "Bump pymergetic-easybind pins"
40
+ git push origin main
41
+ ```
42
+
43
+ ### 3) Tag **pymergetic-cppdantic**
44
+
45
+ ```bash
46
+ cd /path/to/cppdantic
47
+ git fetch --tags
48
+ export TAG=v0.1.1 # choose the next version
49
+ git tag -a "$TAG" -m "pymergetic-cppdantic ${TAG#v}"
50
+ git push origin main
51
+ git push origin "$TAG"
52
+ ```
53
+
54
+ **GitHub vs PyPI:** the tag can exist while the publish workflow fails; **`PYPI_API_TOKEN`** must be set on the **cppdantic** repo. CI uses **`pymergetic-wait-pypi --project-root .`**.
55
+
56
+ **CI wait:** the **Publish to PyPI** workflow installs **`pymergetic-common[release]`** from PyPI and runs **`pymergetic-wait-pypi --project-root .`**, which infers **`pymergetic-easybind`** from pins in **`pyproject.toml`**. Keep **`pymergetic-easybind~=…`** pins in sync when you bump.
57
+
58
+ ---
59
+
60
+ ## Order: pymergetic-easybind first, then bump pins
61
+
62
+ **pymergetic-cppdantic** builds against whatever **`pymergetic.easybind`** you install; CI and wheels must see a matching release on PyPI.
63
+
64
+ 1. **easybind** repo: tag **`vA.B.C`**, push, wait until **`pymergetic-easybind==A.B.C`** is on PyPI.
65
+ 2. **cppdantic** repo: bump **every** `pymergetic-easybind~=…` in **`pyproject.toml`**. Automate with:
66
+
67
+ ```bash
68
+ pymergetic-pin-pyproject --project-root . --dry-run
69
+ pymergetic-pin-pyproject --project-root .
70
+ ```
71
+
72
+ 3. **Commit that bump on `main` before you create the tag.**
73
+
74
+ If you tag before the matching **pymergetic-easybind** wheel exists, isolated builds and cibuildwheel tests can fail.
75
+
76
+ ## Version
77
+
78
+ Setuptools-scm reads the version from **`v*`** tags. Runtime: **`importlib.metadata.version("pymergetic-cppdantic")`**.
79
+
80
+ ## CI publish
81
+
82
+ Pushing a tag **`v*`** runs **`.github/workflows/publish.yml`**: sdist, **cibuildwheel** (manylinux + Windows amd64), **twine check**, upload to PyPI.
83
+
84
+ Set the **`PYPI_API_TOKEN`** repository secret.
85
+
86
+ ## Manual dry run
87
+
88
+ ```bash
89
+ python -m pip install build twine
90
+ git fetch --tags
91
+ python -m build
92
+ twine check dist/*
93
+ # twine upload dist/*
94
+ ```
95
+
96
+ ## Notes
97
+
98
+ - **Runtime:** the extension expects **`pymergetic-easybind`** at the pinned version so **`libeasybind.so`** / **`easybind.dll`** and headers resolve under **`site-packages/pymergetic/easybind/`**.
@@ -0,0 +1,99 @@
1
+ [build-system]
2
+ # Sole pymergetic-easybind pin — bump with: pymergetic-pin-pyproject -d pymergetic-easybind
3
+ requires = [
4
+ "pymergetic-common[bind]~=0.0.11",
5
+ "pymergetic-easybind~=0.3.17",
6
+ ]
7
+ build-backend = "scikit_build_core.build"
8
+
9
+ [tool.pymergetic.pins]
10
+ pymergetic-easybind = { wait = true }
11
+
12
+ # uv: build in the project venv so `import pymergetic.easybind` matches editable easybind.
13
+ [tool.uv]
14
+ no-build-isolation-package = ["pymergetic-cppdantic"]
15
+
16
+ [project]
17
+ name = "pymergetic-cppdantic"
18
+ dynamic = ["version"]
19
+ description = "Hello-world nanobind extension built against pymergetic.easybind (import pymergetic.cppdantic)"
20
+ readme = "README.md"
21
+ requires-python = ">=3.11"
22
+ license = "Apache-2.0"
23
+ license-files = ["LICENSE"]
24
+ authors = [
25
+ { name = "PymergeticOS Maintainers", email = "raudzus@pymergetic.com" }
26
+ ]
27
+ keywords = ["cppdantic", "pymergetic-cppdantic", "nanobind", "easybind", "bindings", "pymergetic"]
28
+ classifiers = [
29
+ "Development Status :: 3 - Alpha",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Programming Language :: Python :: 3.14",
35
+ "Programming Language :: C++",
36
+ "Operating System :: Microsoft :: Windows",
37
+ "Operating System :: POSIX :: Linux",
38
+ "Typing :: Typed",
39
+ ]
40
+
41
+ dependencies = [
42
+ "pymergetic-common[easybind]>=0.0.0",
43
+ ]
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/pymergetic/cppdantic"
47
+ Repository = "https://github.com/pymergetic/cppdantic"
48
+ Issues = "https://github.com/pymergetic/cppdantic/issues"
49
+
50
+ [project.optional-dependencies]
51
+ test = ["pymergetic-common[test]"]
52
+
53
+ [tool.pyright]
54
+ extraPaths = ["src"]
55
+
56
+ [tool.pytest.ini_options]
57
+ testpaths = ["tests"]
58
+
59
+ # Linux + Windows wheels: see .github/workflows/publish.yml
60
+ [tool.cibuildwheel]
61
+ build = "cp311-* cp312-* cp313-* cp314-*"
62
+ skip = "*musllinux* *win32*"
63
+ manylinux-x86_64-image = "manylinux_2_28"
64
+ build-verbosity = 1
65
+ test-requires = ["pymergetic-common[test]"]
66
+ test-command = "python -m pytest {project}/tests -q"
67
+ repair-wheel-command = "python -m pymergetic.common.devtools.repair_wheel {dest_dir} {wheel} --project-root {project}"
68
+
69
+ [tool.cibuildwheel.linux]
70
+ before-build = [
71
+ "python -m pip install --upgrade pip",
72
+ "python -m pip install 'cmake>=3.25' ninja 'pymergetic-common[release]>=0.0.0'",
73
+ ]
74
+
75
+ [tool.cibuildwheel.windows]
76
+ before-build = [
77
+ "python -m pip install --upgrade pip",
78
+ "python -m pip install \"cmake>=3.25\" ninja \"pymergetic-common[release]>=0.0.0\"",
79
+ ]
80
+
81
+ [tool.scikit-build]
82
+ cmake.version = ">=3.25"
83
+ logging.level = "INFO"
84
+ minimum-version = "0.10"
85
+ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
86
+ build-dir = "build"
87
+
88
+ [tool.scikit-build.cmake.define]
89
+ CMAKE_EXPORT_COMPILE_COMMANDS = "ON"
90
+
91
+ [tool.scikit-build.wheel]
92
+ packages = { "pymergetic" = "src/pymergetic" }
93
+
94
+ [tool.setuptools_scm]
95
+ version_scheme = "no-guess-dev"
96
+ local_scheme = "no-local-version"
97
+ fallback_version = "0.0.0"
98
+ root = "."
99
+ version_file = "src/pymergetic/cppdantic/_version.py"
@@ -0,0 +1,7 @@
1
+ from importlib.metadata import version
2
+
3
+ __package_name__ = "pymergetic-cppdantic"
4
+ __package_module__ = "pymergetic.cppdantic"
5
+ __version__ = version(__package_name__)
6
+
7
+ __all__ = ["__package_name__", "__package_module__", "__version__"]
@@ -0,0 +1,6 @@
1
+ #include <pymergetic/easybind/bind.hpp>
2
+
3
+ EASYBIND_NS_MODULE_SHARED_OBJECT(pymergetic::cppdantic, cppdantic, m, true, {
4
+ m.doc() = "pymergetic.cppdantic hello-world (built against pymergetic.easybind)";
5
+ m.def("hello", []() { return std::string("hello from pymergetic.cppdantic"); });
6
+ });
@@ -0,0 +1,4 @@
1
+ def test_hello():
2
+ import pymergetic.cppdantic as cppdantic
3
+
4
+ assert cppdantic.hello() == "hello from pymergetic.cppdantic"