dynamic-metadata 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.
@@ -0,0 +1,4 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
+ ref-names: $Format:%D$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,101 @@
1
+ See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed
2
+ description of best practices for developing scientific packages.
3
+
4
+ [spc-dev-intro]: https://scientific-python-cookie.readthedocs.io/guide/intro
5
+
6
+ # Quick development
7
+
8
+ The fastest way to start with development is to use nox. If you don't have nox,
9
+ you can use `pipx run nox` to run it without installing, or `pipx install nox`.
10
+ If you don't have pipx (pip for applications), then you can install with with
11
+ `pip install pipx` (the only case were installing an application with regular
12
+ pip is reasonable). If you use macOS, then pipx and nox are both in brew, use
13
+ `brew install pipx nox`.
14
+
15
+ To use, run `nox`. This will lint and test using every installed version of
16
+ Python on your system, skipping ones that are not installed. You can also run
17
+ specific jobs:
18
+
19
+ ```console
20
+ $ nox -s lint # Lint only
21
+ $ nox -s tests # Python tests
22
+ $ nox -s docs -- serve # Build and serve the docs
23
+ $ nox -s build # Make an SDist and wheel
24
+ ```
25
+
26
+ Nox handles everything for you, including setting up an temporary virtual
27
+ environment for each run.
28
+
29
+ # Setting up a development environment manually
30
+
31
+ You can set up a development environment by running:
32
+
33
+ ```bash
34
+ python3 -m venv .venv
35
+ source ./.venv/bin/activate
36
+ pip install -v -e .[dev]
37
+ ```
38
+
39
+ If you have the
40
+ [Python Launcher for Unix](https://github.com/brettcannon/python-launcher), you
41
+ can instead do:
42
+
43
+ ```bash
44
+ py -m venv .venv
45
+ py -m install -v -e .[dev]
46
+ ```
47
+
48
+ # Post setup
49
+
50
+ You should prepare pre-commit, which will help you by checking that commits pass
51
+ required checks:
52
+
53
+ ```bash
54
+ pip install pre-commit # or brew install pre-commit on macOS
55
+ pre-commit install # Will install a pre-commit hook into the git repo
56
+ ```
57
+
58
+ You can also/alternatively run `pre-commit run` (changes only) or
59
+ `pre-commit run --all-files` to check even without installing the hook.
60
+
61
+ # Testing
62
+
63
+ Use pytest to run the unit checks:
64
+
65
+ ```bash
66
+ pytest
67
+ ```
68
+
69
+ # Coverage
70
+
71
+ Use pytest-cov to generate coverage reports:
72
+
73
+ ```bash
74
+ pytest --cov=dynamic-metadata
75
+ ```
76
+
77
+ # Building docs
78
+
79
+ You can build the docs using:
80
+
81
+ ```bash
82
+ nox -s docs
83
+ ```
84
+
85
+ You can see a preview with:
86
+
87
+ ```bash
88
+ nox -s docs -- serve
89
+ ```
90
+
91
+ # Pre-commit
92
+
93
+ This project uses pre-commit for all style checking. While you can run it with
94
+ nox, this is such an important tool that it deserves to be installed on its own.
95
+ Install pre-commit and run:
96
+
97
+ ```bash
98
+ pre-commit run -a
99
+ ```
100
+
101
+ to check all files.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
@@ -0,0 +1,32 @@
1
+ {
2
+ "problemMatcher": [
3
+ {
4
+ "severity": "warning",
5
+ "pattern": [
6
+ {
7
+ "regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
8
+ "file": 1,
9
+ "line": 2,
10
+ "column": 3,
11
+ "code": 4,
12
+ "message": 5
13
+ }
14
+ ],
15
+ "owner": "pylint-warning"
16
+ },
17
+ {
18
+ "severity": "error",
19
+ "pattern": [
20
+ {
21
+ "regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
22
+ "file": 1,
23
+ "line": 2,
24
+ "column": 3,
25
+ "code": 4,
26
+ "message": 5
27
+ }
28
+ ],
29
+ "owner": "pylint-error"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,46 @@
1
+ name: CD
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types:
7
+ - published
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ FORCE_COLOR: 3
15
+
16
+ jobs:
17
+ dist:
18
+ name: Distribution build
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Build sdist and wheel
27
+ uses: hynek/build-and-inspect-python-package@v1
28
+
29
+ publish:
30
+ needs: [dist]
31
+ name: Publish to PyPI
32
+ environment:
33
+ name: pypi
34
+ url: https://pypi.org/p/dynamic-metadata
35
+ permissions:
36
+ id-token: write
37
+ runs-on: ubuntu-latest
38
+ if: github.event_name == 'release' && github.event.action == 'published'
39
+
40
+ steps:
41
+ - uses: actions/download-artifact@v3
42
+ with:
43
+ name: Packages
44
+ path: dist
45
+
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,69 @@
1
+ name: CI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ FORCE_COLOR: 3
16
+
17
+ jobs:
18
+ pre-commit:
19
+ name: Format
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ with:
24
+ fetch-depth: 0
25
+ - uses: actions/setup-python@v4
26
+ with:
27
+ python-version: "3.x"
28
+ - uses: pre-commit/action@v3.0.0
29
+ with:
30
+ extra_args: --hook-stage manual --all-files
31
+ - name: Run PyLint
32
+ run: |
33
+ echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
34
+ pipx run nox -s pylint
35
+
36
+ checks:
37
+ name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
38
+ runs-on: ${{ matrix.runs-on }}
39
+ needs: [pre-commit]
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ python-version: ["3.8", "3.11", "3.12"]
44
+ runs-on: [ubuntu-latest, macos-latest, windows-latest]
45
+
46
+ include:
47
+ - python-version: pypy-3.9
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v3
52
+ with:
53
+ fetch-depth: 0
54
+
55
+ - uses: actions/setup-python@v4
56
+ with:
57
+ python-version: ${{ matrix.python-version }}
58
+ allow-prereleases: true
59
+
60
+ - name: Install package
61
+ run: python -m pip install .[test]
62
+
63
+ - name: Test package
64
+ run: >-
65
+ python -m pytest -ra --cov --cov-report=xml --cov-report=term
66
+ --durations=20
67
+
68
+ - name: Upload coverage report
69
+ uses: codecov/codecov-action@v3.1.4
@@ -0,0 +1,158 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/
133
+
134
+ # pytype static type analyzer
135
+ .pytype/
136
+
137
+ # Cython debug symbols
138
+ cython_debug/
139
+
140
+ # setuptools_scm
141
+ src/*/_version.py
142
+
143
+
144
+ # ruff
145
+ .ruff_cache/
146
+
147
+ # OS specific stuff
148
+ .DS_Store
149
+ .DS_Store?
150
+ ._*
151
+ .Spotlight-V100
152
+ .Trashes
153
+ ehthumbs.db
154
+ Thumbs.db
155
+
156
+ # Common editor files
157
+ *~
158
+ *.swp
@@ -0,0 +1,78 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ repos:
6
+ - repo: https://github.com/psf/black
7
+ rev: "23.3.0"
8
+ hooks:
9
+ - id: black-jupyter
10
+
11
+ - repo: https://github.com/pre-commit/pre-commit-hooks
12
+ rev: "v4.4.0"
13
+ hooks:
14
+ - id: check-added-large-files
15
+ - id: check-case-conflict
16
+ - id: check-merge-conflict
17
+ - id: check-symlinks
18
+ - id: check-yaml
19
+ - id: debug-statements
20
+ - id: end-of-file-fixer
21
+ - id: mixed-line-ending
22
+ - id: name-tests-test
23
+ args: ["--pytest-test-first"]
24
+ - id: requirements-txt-fixer
25
+ - id: trailing-whitespace
26
+
27
+ - repo: https://github.com/pre-commit/pygrep-hooks
28
+ rev: "v1.10.0"
29
+ hooks:
30
+ - id: rst-backticks
31
+ - id: rst-directive-colons
32
+ - id: rst-inline-touching-normal
33
+
34
+ - repo: https://github.com/pre-commit/mirrors-prettier
35
+ rev: "v2.7.1"
36
+ hooks:
37
+ - id: prettier
38
+ types_or: [yaml, markdown, html, css, scss, javascript, json]
39
+ args: [--prose-wrap=always]
40
+
41
+ - repo: https://github.com/asottile/blacken-docs
42
+ rev: "1.14.0"
43
+ hooks:
44
+ - id: blacken-docs
45
+ additional_dependencies: [black==23.3.0]
46
+
47
+ - repo: https://github.com/astral-sh/ruff-pre-commit
48
+ rev: "v0.0.276"
49
+ hooks:
50
+ - id: ruff
51
+ args: ["--fix", "--show-fixes"]
52
+
53
+ - repo: https://github.com/pre-commit/mirrors-mypy
54
+ rev: "v1.4.1"
55
+ hooks:
56
+ - id: mypy
57
+ files: src|tests
58
+ args: []
59
+ additional_dependencies:
60
+ - pytest
61
+
62
+ - repo: https://github.com/codespell-project/codespell
63
+ rev: "v2.2.5"
64
+ hooks:
65
+ - id: codespell
66
+
67
+ - repo: https://github.com/shellcheck-py/shellcheck-py
68
+ rev: "v0.9.0.5"
69
+ hooks:
70
+ - id: shellcheck
71
+
72
+ - repo: local
73
+ hooks:
74
+ - id: disallow-caps
75
+ name: Disallow improper capitalization
76
+ language: pygrep
77
+ entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
78
+ exclude: .pre-commit-config.yaml
@@ -0,0 +1,18 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ version: 2
5
+
6
+ build:
7
+ os: ubuntu-22.04
8
+ tools:
9
+ python: "3.11"
10
+ sphinx:
11
+ configuration: docs/conf.py
12
+
13
+ python:
14
+ install:
15
+ - method: pip
16
+ path: .
17
+ extra_requirements:
18
+ - docs
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2023 Henry Schreiner
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.1
2
+ Name: dynamic-metadata
3
+ Version: 0.1.0
4
+ Summary: This project is intended to document dynamic-metadata support.
5
+ Project-URL: Homepage, https://github.com/scikit-build/dynamic-metadata
6
+ Project-URL: Bug Tracker, https://github.com/scikit-build/dynamic-metadata/issues
7
+ Project-URL: Discussions, https://github.com/scikit-build/dynamic-metadata/discussions
8
+ Project-URL: Changelog, https://github.com/scikit-build/dynamic-metadata/releases
9
+ Author-email: Henry Schreiner <henryschreineriii@gmail.com>
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 1 - Planning
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Topic :: Scientific/Engineering
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.8
27
+ Requires-Dist: typing-extensions>=4.6; python_version < '3.11'
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest-cov>=3; extra == 'dev'
30
+ Requires-Dist: pytest>=6; extra == 'dev'
31
+ Provides-Extra: docs
32
+ Requires-Dist: furo; extra == 'docs'
33
+ Requires-Dist: myst-parser>=0.13; extra == 'docs'
34
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
35
+ Requires-Dist: sphinx-book-theme>=0.1.0; extra == 'docs'
36
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
37
+ Requires-Dist: sphinx>=4.0; extra == 'docs'
38
+ Provides-Extra: test
39
+ Requires-Dist: pytest-cov>=3; extra == 'test'
40
+ Requires-Dist: pytest>=6; extra == 'test'
41
+ Description-Content-Type: text/markdown
42
+
43
+ # dynamic-metadata
44
+
45
+ [![Actions Status][actions-badge]][actions-link]
46
+ [![Documentation Status][rtd-badge]][rtd-link]
47
+
48
+ [![PyPI version][pypi-version]][pypi-link]
49
+ [![PyPI platforms][pypi-platforms]][pypi-link]
50
+
51
+ [![GitHub Discussion][github-discussions-badge]][github-discussions-link]
52
+
53
+ <!-- SPHINX-START -->
54
+
55
+ This repo is to support
56
+ https://github.com/scikit-build/scikit-build-core/issues/230.
57
+
58
+ <!-- prettier-ignore-start -->
59
+ [actions-badge]: https://github.com/scikit-build/dynamic-metadata/workflows/CI/badge.svg
60
+ [actions-link]: https://github.com/scikit-build/dynamic-metadata/actions
61
+ [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
62
+ [github-discussions-link]: https://github.com/scikit-build/scikit-build/discussions
63
+ [pypi-link]: https://pypi.org/project/dynamic-metadata/
64
+ [pypi-platforms]: https://img.shields.io/pypi/pyversions/dynamic-metadata
65
+ [pypi-version]: https://img.shields.io/pypi/v/dynamic-metadata
66
+ [rtd-badge]: https://readthedocs.org/projects/dynamic-metadata/badge/?version=latest
67
+ [rtd-link]: https://dynamic-metadata.readthedocs.io/en/latest/?badge=latest
68
+
69
+ <!-- prettier-ignore-end -->
@@ -0,0 +1,27 @@
1
+ # dynamic-metadata
2
+
3
+ [![Actions Status][actions-badge]][actions-link]
4
+ [![Documentation Status][rtd-badge]][rtd-link]
5
+
6
+ [![PyPI version][pypi-version]][pypi-link]
7
+ [![PyPI platforms][pypi-platforms]][pypi-link]
8
+
9
+ [![GitHub Discussion][github-discussions-badge]][github-discussions-link]
10
+
11
+ <!-- SPHINX-START -->
12
+
13
+ This repo is to support
14
+ https://github.com/scikit-build/scikit-build-core/issues/230.
15
+
16
+ <!-- prettier-ignore-start -->
17
+ [actions-badge]: https://github.com/scikit-build/dynamic-metadata/workflows/CI/badge.svg
18
+ [actions-link]: https://github.com/scikit-build/dynamic-metadata/actions
19
+ [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
20
+ [github-discussions-link]: https://github.com/scikit-build/scikit-build/discussions
21
+ [pypi-link]: https://pypi.org/project/dynamic-metadata/
22
+ [pypi-platforms]: https://img.shields.io/pypi/pyversions/dynamic-metadata
23
+ [pypi-version]: https://img.shields.io/pypi/v/dynamic-metadata
24
+ [rtd-badge]: https://readthedocs.org/projects/dynamic-metadata/badge/?version=latest
25
+ [rtd-link]: https://dynamic-metadata.readthedocs.io/en/latest/?badge=latest
26
+
27
+ <!-- prettier-ignore-end -->
@@ -0,0 +1,45 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib.metadata
4
+
5
+ project = "dynamic-metadata"
6
+ copyright = "2023, Henry Schreiner"
7
+ author = "Henry Schreiner"
8
+ version = release = importlib.metadata.version("dynamic_metadata")
9
+
10
+ extensions = [
11
+ "myst_parser",
12
+ "sphinx.ext.autodoc",
13
+ "sphinx.ext.intersphinx",
14
+ "sphinx.ext.mathjax",
15
+ "sphinx.ext.napoleon",
16
+ "sphinx_autodoc_typehints",
17
+ "sphinx_copybutton",
18
+ ]
19
+
20
+ source_suffix = [".rst", ".md"]
21
+ exclude_patterns = [
22
+ "_build",
23
+ "**.ipynb_checkpoints",
24
+ "Thumbs.db",
25
+ ".DS_Store",
26
+ ".env",
27
+ ".venv",
28
+ ]
29
+
30
+ html_theme = "furo"
31
+
32
+ myst_enable_extensions = [
33
+ "colon_fence",
34
+ ]
35
+
36
+ intersphinx_mapping = {
37
+ "python": ("https://docs.python.org/3", None),
38
+ }
39
+
40
+ nitpick_ignore = [
41
+ ("py:class", "_io.StringIO"),
42
+ ("py:class", "_io.BytesIO"),
43
+ ]
44
+
45
+ always_document_param_types = True
@@ -0,0 +1,17 @@
1
+ # dynamic-metadata
2
+
3
+ ```{toctree}
4
+ :maxdepth: 2
5
+ :hidden:
6
+
7
+ ```
8
+
9
+ ```{include} ../README.md
10
+ :start-after: <!-- SPHINX-START -->
11
+ ```
12
+
13
+ ## Indices and tables
14
+
15
+ - {ref}`genindex`
16
+ - {ref}`modindex`
17
+ - {ref}`search`
@@ -0,0 +1,116 @@
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import shutil
5
+ from pathlib import Path
6
+
7
+ import nox
8
+
9
+ DIR = Path(__file__).parent.resolve()
10
+
11
+ nox.options.sessions = ["lint", "pylint", "tests"]
12
+
13
+
14
+ @nox.session
15
+ def lint(session: nox.Session) -> None:
16
+ """
17
+ Run the linter.
18
+ """
19
+ session.install("pre-commit")
20
+ session.run("pre-commit", "run", "--all-files", *session.posargs)
21
+
22
+
23
+ @nox.session
24
+ def pylint(session: nox.Session) -> None:
25
+ """
26
+ Run PyLint.
27
+ """
28
+ # This needs to be installed into the package environment, and is slower
29
+ # than a pre-commit check
30
+ session.install(".", "pylint")
31
+ session.run("pylint", "src", *session.posargs)
32
+
33
+
34
+ @nox.session
35
+ def tests(session: nox.Session) -> None:
36
+ """
37
+ Run the unit and regular tests. Use --cov to activate coverage.
38
+ """
39
+ session.install(".[test]")
40
+ session.run("pytest", *session.posargs)
41
+
42
+
43
+ @nox.session
44
+ def docs(session: nox.Session) -> None:
45
+ """
46
+ Build the docs. Pass "--serve" to serve.
47
+ """
48
+
49
+ parser = argparse.ArgumentParser()
50
+ parser.add_argument("--serve", action="store_true", help="Serve after building")
51
+ parser.add_argument(
52
+ "-b", dest="builder", default="html", help="Build target (default: html)"
53
+ )
54
+ args, posargs = parser.parse_known_args(session.posargs)
55
+
56
+ if args.builder != "html" and args.serve:
57
+ session.error("Must not specify non-HTML builder with --serve")
58
+
59
+ session.install(".[docs]")
60
+ session.chdir("docs")
61
+
62
+ if args.builder == "linkcheck":
63
+ session.run(
64
+ "sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *posargs
65
+ )
66
+ return
67
+
68
+ session.run(
69
+ "sphinx-build",
70
+ "-n", # nitpicky mode
71
+ "-T", # full tracebacks
72
+ "-W", # Warnings as errors
73
+ "--keep-going", # See all errors
74
+ "-b",
75
+ args.builder,
76
+ ".",
77
+ f"_build/{args.builder}",
78
+ *posargs,
79
+ )
80
+
81
+ if args.serve:
82
+ session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
83
+ session.run("python", "-m", "http.server", "8000", "-d", "_build/html")
84
+
85
+
86
+ @nox.session
87
+ def build_api_docs(session: nox.Session) -> None:
88
+ """
89
+ Build (regenerate) API docs.
90
+ """
91
+
92
+ session.install("sphinx")
93
+ session.chdir("docs")
94
+ session.run(
95
+ "sphinx-apidoc",
96
+ "-o",
97
+ "api/",
98
+ "--module-first",
99
+ "--no-toc",
100
+ "--force",
101
+ "../src/dynamic_metadata",
102
+ )
103
+
104
+
105
+ @nox.session
106
+ def build(session: nox.Session) -> None:
107
+ """
108
+ Build an SDist and wheel.
109
+ """
110
+
111
+ build_p = DIR.joinpath("build")
112
+ if build_p.exists():
113
+ shutil.rmtree(build_p)
114
+
115
+ session.install("build")
116
+ session.run("python", "-m", "build")
@@ -0,0 +1,162 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+
6
+ [project]
7
+ name = "dynamic-metadata"
8
+ authors = [
9
+ { name = "Henry Schreiner", email = "henryschreineriii@gmail.com" },
10
+ ]
11
+ description = "This project is intended to document dynamic-metadata support."
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ classifiers = [
15
+ "Development Status :: 1 - Planning",
16
+ "Intended Audience :: Science/Research",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: Apache Software License",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.8",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Topic :: Scientific/Engineering",
29
+ "Typing :: Typed",
30
+ ]
31
+ dynamic = ["version"]
32
+ dependencies = [
33
+ "typing_extensions >=4.6; python_version<'3.11'",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ test = [
38
+ "pytest >=6",
39
+ "pytest-cov >=3",
40
+ ]
41
+ dev = [
42
+ "pytest >=6",
43
+ "pytest-cov >=3",
44
+ ]
45
+ docs = [
46
+ "sphinx>=4.0",
47
+ "myst_parser>=0.13",
48
+ "sphinx_book_theme>=0.1.0",
49
+ "sphinx_copybutton",
50
+ "sphinx_autodoc_typehints",
51
+ "furo",
52
+ ]
53
+
54
+ [project.urls]
55
+ Homepage = "https://github.com/scikit-build/dynamic-metadata"
56
+ "Bug Tracker" = "https://github.com/scikit-build/dynamic-metadata/issues"
57
+ Discussions = "https://github.com/scikit-build/dynamic-metadata/discussions"
58
+ Changelog = "https://github.com/scikit-build/dynamic-metadata/releases"
59
+ [tool.hatch]
60
+ version.path = "src/dynamic_metadata/__init__.py"
61
+ envs.default.dependencies = [
62
+ "pytest",
63
+ "pytest-cov",
64
+ ]
65
+
66
+
67
+ [tool.pytest.ini_options]
68
+ minversion = "6.0"
69
+ addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
70
+ xfail_strict = true
71
+ filterwarnings = [
72
+ "error",
73
+ "ignore:(ast.Str|Attribute s|ast.NameConstant|ast.Num) is deprecated:DeprecationWarning:_pytest",
74
+ ]
75
+ log_cli_level = "INFO"
76
+ testpaths = [
77
+ "tests",
78
+ ]
79
+
80
+
81
+ [tool.coverage]
82
+ run.source = ["dynamic_metadata"]
83
+ port.exclude_lines = [
84
+ 'pragma: no cover',
85
+ '\.\.\.',
86
+ 'if typing.TYPE_CHECKING:',
87
+ ]
88
+
89
+ [tool.mypy]
90
+ files = ["src", "tests"]
91
+ python_version = "3.8"
92
+ warn_unused_configs = true
93
+ strict = true
94
+ show_error_codes = true
95
+ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
96
+ warn_unreachable = true
97
+ disallow_untyped_defs = false
98
+ disallow_incomplete_defs = false
99
+
100
+ [[tool.mypy.overrides]]
101
+ module = "dynamic_metadata.*"
102
+ disallow_untyped_defs = true
103
+ disallow_incomplete_defs = true
104
+
105
+
106
+ [tool.ruff]
107
+ select = [
108
+ "E", "F", "W", # flake8
109
+ "B", # flake8-bugbear
110
+ "I", # isort
111
+ "ARG", # flake8-unused-arguments
112
+ "C4", # flake8-comprehensions
113
+ "EM", # flake8-errmsg
114
+ "ICN", # flake8-import-conventions
115
+ "ISC", # flake8-implicit-str-concat
116
+ "G", # flake8-logging-format
117
+ "PGH", # pygrep-hooks
118
+ "PIE", # flake8-pie
119
+ "PL", # pylint
120
+ "PT", # flake8-pytest-style
121
+ "PTH", # flake8-use-pathlib
122
+ "RET", # flake8-return
123
+ "RUF", # Ruff-specific
124
+ "SIM", # flake8-simplify
125
+ "T20", # flake8-print
126
+ "UP", # pyupgrade
127
+ "YTT", # flake8-2020
128
+ "EXE", # flake8-executable
129
+ "NPY", # NumPy specific rules
130
+ "PD", # pandas-vet
131
+ ]
132
+ extend-ignore = [
133
+ "PLR", # Design related pylint codes
134
+ "E501", # Line too long
135
+ ]
136
+ typing-modules = ["dynamic_metadata._compat.typing"]
137
+ src = ["src"]
138
+ unfixable = [
139
+ "T20", # Removes print statements
140
+ "F841", # Removes unused variables
141
+ ]
142
+ exclude = []
143
+ flake8-unused-arguments.ignore-variadic-names = true
144
+ isort.required-imports = ["from __future__ import annotations"]
145
+
146
+ [tool.ruff.per-file-ignores]
147
+ "tests/**" = ["T20"]
148
+ "noxfile.py" = ["T20"]
149
+
150
+
151
+ [tool.pylint]
152
+ py-version = "3.8"
153
+ ignore-paths= ["src/dynamic_metadata/_version.py"]
154
+ reports.output-format = "colorized"
155
+ similarities.ignore-imports = "yes"
156
+ messages_control.disable = [
157
+ "design",
158
+ "fixme",
159
+ "line-too-long",
160
+ "missing-module-docstring",
161
+ "wrong-import-position",
162
+ ]
@@ -0,0 +1,12 @@
1
+ """
2
+ Copyright (c) 2023 Henry Schreiner. All rights reserved.
3
+
4
+ dynamic-metadata: This project is intended to document dynamic-metadata support.
5
+ """
6
+
7
+
8
+ from __future__ import annotations
9
+
10
+ __version__ = "0.1.0"
11
+
12
+ __all__ = ("__version__",)
@@ -0,0 +1,8 @@
1
+ """
2
+ Copyright (c) 2023 Henry Schreiner. All rights reserved.
3
+
4
+ dynamic-metadata: This project is intended to document dynamic-metadata support.
5
+ """
6
+
7
+
8
+ from __future__ import annotations
@@ -0,0 +1,26 @@
1
+ """
2
+ Copyright (c) 2023 Henry Schreiner. All rights reserved.
3
+
4
+ dynamic-metadata: This project is intended to document dynamic-metadata support.
5
+ """
6
+
7
+
8
+ from __future__ import annotations
9
+
10
+ import sys
11
+
12
+ if sys.version_info < (3, 10):
13
+ from typing_extensions import TypeAlias
14
+ else:
15
+ from typing import TypeAlias
16
+
17
+ if sys.version_info < (3, 11):
18
+ from typing_extensions import Self, assert_never
19
+ else:
20
+ from typing import Self, assert_never
21
+
22
+ __all__ = ["TypeAlias", "Self", "assert_never"]
23
+
24
+
25
+ def __dir__() -> list[str]:
26
+ return __all__
File without changes
@@ -0,0 +1,14 @@
1
+ from __future__ import annotations
2
+
3
+ import dynamic_metadata as m
4
+ import dynamic_metadata._compat.typing as typing_backports
5
+
6
+
7
+ def test_version():
8
+ assert m.__version__
9
+
10
+
11
+ def test_has_typing():
12
+ assert hasattr(typing_backports, "TypeAlias")
13
+ assert hasattr(typing_backports, "Self")
14
+ assert hasattr(typing_backports, "assert_never")