-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
184 lines (171 loc) · 5.95 KB
/
Copy pathpyproject.toml
File metadata and controls
184 lines (171 loc) · 5.95 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
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[project]
name = "ktav"
description = "Python bindings for Ktav — a plain configuration format. No required quotes, no commas, dotted keys."
readme = "README.md"
license = "MIT OR Apache-2.0"
authors = [
{ name = "Marat K", email = "phpcraftdream@gmail.com" },
]
maintainers = [
{ name = "Marat K", email = "phpcraftdream@gmail.com" },
]
requires-python = ">=3.9"
keywords = ["config", "configuration", "parser", "ktav", "serialization", "serde"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Rust",
"Topic :: File Formats",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing",
"Typing :: Typed",
]
# Version is read from Cargo.toml by maturin so there is exactly one source
# of truth for the crate and the wheel.
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/ktav-lang/python"
Repository = "https://github.com/ktav-lang/python"
Changelog = "https://github.com/ktav-lang/python/blob/main/CHANGELOG.md"
Issues = "https://github.com/ktav-lang/python/issues"
Specification = "https://github.com/ktav-lang/spec"
[project.optional-dependencies]
test = [
"pytest>=7.0",
"pytest-cov>=4.0",
]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
# Exact pin, not a lower bound: this is the lint/format GATE, so its
# own version must move only when someone deliberately moves it. Ruff
# 0.16 grew a Markdown-code-fence formatting mode that fired on
# committed docs nobody had touched — see the CI workflow's install
# step and [tool.ruff]'s extend-exclude comment.
"ruff==0.16.8",
"mypy>=1.10",
"maturin>=1.7",
"pre-commit>=3.5",
]
[tool.maturin]
exclude = [
{ path = "spec/**", format = "sdist" },
{ path = "root-docs/**", format = "sdist" },
{ path = ".github/**", format = "sdist" },
{ path = "tests/**", format = "sdist" },
{ path = "scripts/**", format = "sdist" },
{ path = "package*.json", format = "sdist" },
{ path = ".gitmodules", format = "sdist" },
{ path = ".pre-commit-config.yaml", format = "sdist" },
{ path = "Makefile", format = "sdist" },
]
# Mixed layout: pure-Python stubs and helpers live under `python/ktav/`, the
# compiled extension is produced as `ktav._core`.
python-source = "python"
module-name = "ktav._core"
# Strip release artefacts for smaller wheels.
strip = true
# abi3 wheels target Python 3.9 and up, so one wheel per platform serves
# every supported interpreter.
features = ["pyo3/extension-module", "pyo3/abi3-py39"]
# ------------------------------------------------------------------
# Ruff — lint + format (rules intentionally strict for a small library).
# ------------------------------------------------------------------
[tool.ruff]
line-length = 100
target-version = "py39"
# "spec" is the ktav-lang/spec git submodule — its own Python tooling has
# its own lint policy in its own repo; linting it here just imports 1577
# unrelated findings. "*.md" excludes every Markdown file everywhere: this
# repo formats Python, not documentation, and ruff's formatter growing a
# Markdown-code-fence mode in 0.16 is not something a doc's manually
# aligned example comments should be at the mercy of.
extend-exclude = ["target", "docs_local", "spec", "*.md"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"N", # pep8-naming
"SIM", # flake8-simplify
"RUF", # ruff-specific
"PT", # flake8-pytest-style
"PIE", # flake8-pie
"PERF", # perflint
"PTH", # flake8-use-pathlib
"D", # pydocstyle (docstrings)
]
ignore = [
"D100", # missing module docstring
"D104", # missing package docstring
"D203", # one-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["D", "PT004"]
"examples/*" = ["D"]
[tool.ruff.lint.pydocstyle]
convention = "google"
# ------------------------------------------------------------------
# Mypy — strict typing on the Python-source layer.
# ------------------------------------------------------------------
[tool.mypy]
python_version = "3.9"
strict = true
warn_unused_configs = true
warn_return_any = true
warn_unreachable = true
show_error_codes = true
show_column_numbers = true
[[tool.mypy.overrides]]
module = "ktav._core"
ignore_missing_imports = false
# `_core` is backed by a .pyi; mypy resolves it that way.
# ------------------------------------------------------------------
# Pytest.
# ------------------------------------------------------------------
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
addopts = [
"-ra",
"--strict-config",
"--strict-markers",
]
filterwarnings = [
"error",
]
# ------------------------------------------------------------------
# Coverage.
# ------------------------------------------------------------------
[tool.coverage.run]
branch = true
source = ["ktav"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]