-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpyproject.toml
More file actions
218 lines (196 loc) · 6.24 KB
/
Copy pathpyproject.toml
File metadata and controls
218 lines (196 loc) · 6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
[build-system]
requires = ["maturin>=1.0,<2.0", "setuptools_scm"]
build-backend = "_build_backend"
backend-path = ["."]
[project]
dependencies = [
"pyyaml == 6.0.*",
"pydantic >= 2.10, < 3",
]
name = "openjd-model"
authors = [
{ name = "Amazon Web Services" }
]
dynamic = ["version"]
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.9"
description = "Provides a Python implementation of the data model for Open Job Description's template schemas."
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries"
]
[project.urls]
Homepage = "https://github.com/OpenJobDescription/openjd-model-for-python"
Source = "https://github.com/OpenJobDescription/openjd-model-for-python"
[tool.maturin]
python-source = "src"
module-name = "openjd._openjd_rs"
manifest-path = "rust-bindings/Cargo.toml"
features = ["extension-module"]
# Files outside maturin's default sdist/wheel walk that we need
# bundled anyway:
#
# * `src/openjd/model/_version.py` — generated at build time by
# `_build_backend.py` (or `scripts/generate_version.py`) and is
# gitignored. Maturin honors `.gitignore` when walking
# `python-source`, so without this entry the file is excluded
# from the wheel and `from .._version import version` fails at
# import time on the deploy target. Needs to be in the wheel.
#
# * `_build_backend.py` and `scripts/generate_version.py` —
# required when pip builds a wheel from the extracted sdist
# (PEP 517 build-from-sdist, which is what `hatch build` does
# in CI). `pyproject.toml` declares
# `build-backend = "_build_backend"` with `backend-path = ["."]`,
# and `_build_backend.py` imports `generate_version` from the
# `scripts/` directory. Without these entries the file isn't
# shipped in the sdist and the second-stage wheel build fails
# with `BackendUnavailable: Cannot find module '_build_backend'`.
# These only need to be in the sdist; they're build-time
# tooling, not runtime code.
include = [
{ path = ".gitignore", format = "sdist" },
{ path = "LICENSE", format = "sdist" },
{ path = "NOTICE", format = "sdist" },
"src/openjd/model/_version.py",
{ path = "_build_backend.py", format = "sdist" },
{ path = "scripts/generate_version.py", format = "sdist" },
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
version_scheme = "post-release"
[tool.mypy]
check_untyped_defs = false
show_error_codes = false
pretty = true
ignore_missing_imports = true
disallow_incomplete_defs = false
disallow_untyped_calls = false
show_error_context = true
strict_equality = false
python_version = "3.10"
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = false
# Tell mypy that there's a namespace package at src/openjd
namespace_packages = true
explicit_package_bases = true
mypy_path = "src"
# Skip the pure-Python pydantic v0 reference test suite. It carries
# pre-existing typing debt (Literal[str] vs Literal[Enum]
# discrimination, dict-vs-model fixture shapes, etc.) that pydantic
# accepts at runtime but mypy flags. The v0 reference is slated for
# retirement once the bindings stabilise.
exclude = [
"test/openjd/model_v0/",
]
# `_openjd_rs.pyi` is auto-generated by PyO3's `gen-stub` from the
# Rust binding macros (see `scripts/generate_stubs.sh`). It's an
# interface declaration regenerated on every binding rebuild, not
# source under review. Stubgen produces constructs mypy flags as
# soft violations (e.g. narrow-typed
# `__eq__(self, other: SameType)` overrides that violate Liskov,
# enum-member annotations on class-level revision constants), and
# none of those are actionable from the Python wrapper side. Treat
# the module as opaque and silence those nits — the wrappers
# themselves (`src/openjd/expr/__init__.py`,
# `src/openjd/model/_v1/__init__.py`, etc.) are still checked
# normally.
[[tool.mypy.overrides]]
module = "openjd._openjd_rs"
ignore_errors = true
[tool.ruff]
line-length = 100
[tool.ruff.lint]
ignore = [
"E501",
# Double Check if this should be fixed
"E731",
]
[tool.ruff.lint.isort]
known-first-party = [
"openjd",
]
[tool.black]
line-length = 100
[tool.pytest.ini_options]
xfail_strict = false
markers = [
"fuzz: Hypothesis-based fuzz tests (test/openjd/expr/test_fuzz.py)",
]
# Use importlib import mode so test files with identical names in different
# directories (e.g. test/openjd/model_v0/test_parse.py and
# test/openjd/model_v1/test_parse.py) coexist in the same pytest run. The
# default rootdir-based import mode synthesizes a top-level module name from
# the test filename and breaks on collisions; importlib mode imports each file
# under its full filesystem path.
addopts = [
"-rfEx",
"--durations=5",
"--cov=src/openjd",
"--color=yes",
"--cov-report=html:build/coverage",
"--cov-report=xml:build/coverage/coverage.xml",
"--cov-report=term-missing",
"--numprocesses=auto",
"--timeout=30",
"--import-mode=importlib",
]
[tool.coverage.run]
branch = true
parallel = true
[tool.coverage.paths]
source = [
"src/"
]
[tool.coverage.report]
show_missing = true
[tool.semantic_release]
# Can be removed or set to true once we are v1
major_on_zero = false
tag_format = "{version}"
allow_zero_version = true
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"style",
"refactor",
"test",
]
minor_tags = []
patch_tags = [
"chore",
"feat",
"fix",
"refactor",
"perf",
]
[tool.semantic_release.publish]
upload_to_vcs_release = false
[tool.semantic_release.changelog]
template_dir = ".semantic_release"
[tool.semantic_release.changelog.environment]
trim_blocks = true
lstrip_blocks = true
[tool.semantic_release.branches.release]
match = "(mainline|release|patch_.*)"