Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
247 lines (230 loc) · 7.74 KB
/
Copy pathpyproject.toml
File metadata and controls
247 lines (230 loc) · 7.74 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
[project]
name = "prov"
dynamic = ["version"]
description = "A library for W3C Provenance Data Model supporting PROV-N, PROV-JSON, PROV-XML, PROV-O (RDF) and PROV-JSONLD"
readme = "README.md"
authors = [
{ name = "Trung Dong Huynh", email = "trungdong@donggiang.com" }
]
keywords = ["provenance", "graph", "model", "PROV", "PROV-DM", "PROV-JSON", "W3C", "PROV-XML", "PROV-N", "PROV-O", "RDF", "PROV-JSONLD", "JSON-LD"]
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security",
"Topic :: System :: Logging",
]
requires-python = ">=3.10"
# No unconditional runtime dependencies as of 3.0.
dependencies = []
[project.optional-dependencies]
rdf = [
"rdflib>=7.0.0,<8",
]
xml = [
"lxml>=3.3.5",
]
# Graphical export (prov.dot / prov_to_dot); needs a local graphviz binary.
# prov.dot renders via prov.graph, so this extra carries networkx too.
dot = [
"pydot>=1.2.0",
"networkx>=2.0",
]
# NetworkX graph interop (prov.graph, prov_to_graph()/graph_to_prov()).
graph = [
"networkx>=2.0",
]
# Interactive display path of ProvBundle.plot(); calls prov.dot internally.
plot = [
"matplotlib>=3.6",
"pydot>=1.2.0",
"networkx>=2.0",
]
[project.scripts]
prov-convert = "prov.scripts.convert:main"
prov-compare = "prov.scripts.compare:main"
[project.urls]
Homepage = "https://github.com/trungdong/prov"
Documentation = "https://prov.readthedocs.io"
Repository = "https://github.com/trungdong/prov"
Issues = "https://github.com/trungdong/prov/issues"
Changelog = "https://prov.readthedocs.io/en/latest/history.html"
Discussions = "https://github.com/trungdong/prov/discussions"
[build-system]
requires = ["setuptools>=40.8.0", "wheel"] # PEP 508 specifications.
build-backend = "setuptools.build_meta"
[tool.setuptools.dynamic]
version = {attr = "prov.__version__"}
[tool.setuptools.package-data]
prov = ["py.typed"]
"prov.serializers" = ["*.jsonld"]
"prov.tests" = [
"json/*.json",
"xml/*.xml",
"rdf/*.ttl",
"rdf/*.trig",
"jsonld/*",
"unification/*.json",
"unification/constraints/*",
"malformed/*",
"schemas/*",
"provn/README.md",
"provn/spec/prov-n/*.provn",
"provn/spec/prov-dm/*.provn",
"provn/provtoolbox/*.provn",
"provn/provtoolbox-corpus/*.provn",
]
[dependency-groups]
dev = [
"coverage>=7.6.10",
"hypothesis>=6.156.1",
"jsonschema>=4",
"lxml-stubs>=0.5.1",
"mypy>=1.19.1",
"pre-commit>=4.0.1",
"pyld>=2.0.4",
"pytest>=8.4.2",
"pytest-cov>=7.1.0",
"ruff>=0.15.20",
"types-networkx>=3.4.2.20250509",
]
bench = [
"pytest-benchmark>=5.1.0",
]
docs = [
"sphinx>=8.1.3",
"furo",
"myst-parser",
"sphinx-copybutton",
]
[tool.uv]
# numpy is a transitive typing dependency (via types-networkx/matplotlib), not
# something prov imports itself. numpy 2.5 switched its inline stubs to
# unconditional PEP 695 `type` statements, which mypy refuses to parse once
# `[tool.mypy] python_version` is below 3.12 (see below) regardless of the
# interpreter actually running mypy. Cap it below that until numpy's stubs
# gate the new syntax on `python_version`, or this project's mypy floor rises
# to 3.12. If a Dependabot bump of matplotlib or types-networkx ever fails to
# resolve, this pin is the likely cause: lift it, run `uv run mypy src`, and
# keep it lifted only if mypy stays green.
constraint-dependencies = ["numpy<2.5"]
[tool.ruff]
line-length = 88
target-version = "py310"
extend-exclude = ["build"] # dist/.eggs are already in ruff's default excludes
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort (import sorting)
"SIM", # flake8-simplify
"UP", # pyupgrade (3.10-safe)
"RUF", # ruff-specific rules
]
ignore = [
"E203", # whitespace before ':' (black/ruff-format compatible)
"E501", # line length handled by the formatter
]
[tool.ruff.lint.isort]
combine-as-imports = true # keep multi-name `X as X` re-export blocks compact
[tool.ruff.lint.per-file-ignores]
# These modules intentionally re-export everything from another module with
# `import *`; pyflakes can't tell which of the resulting names are "used".
"src/prov/model/__init__.py" = ["F403", "F405"]
"src/prov/serializers/provjson.py" = ["F403", "F405"]
"src/prov/serializers/provxml.py" = ["F403", "F405"]
"src/prov/tests/test_statements.py" = ["F403", "F405"]
"src/prov/tests/test_dot.py" = ["E402"]
"src/prov/tests/test_graphs.py" = ["E402"]
[tool.pytest.ini_options]
testpaths = ["src/prov/tests"]
[tool.coverage.run]
branch = true
source = ["prov"]
omit = ["*/prov/tests/*"]
[tool.coverage.report]
# Coverage ratchet (planning/test-gap-checklist.md). T13 fixed the `omit` glob
# above (it previously did not exclude src/prov/tests/, inflating TOTAL by
# ~3.8pt with near-fully-covered test code) and closed the remaining
# checklist gaps; the honest package-only TOTAL measured after that work is
# 97.42%, rounded down to this floor. Never lower without a documented
# reason. Remaining misses are individually annotated as "defer" in the
# checklist (dead/defensive branches unreachable via the public API, plus
# the matplotlib-requiring interactive plot() path not installed in the
# test env).
fail_under = 97
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.mypy]
python_version = "3.10"
strict = true
# Test modules that do not yet pass strict mypy. The list only shrinks. A PR
# that makes a module pass deletes its name, and a new test module never joins.
[[tool.mypy.overrides]]
module = [
"prov.tests.conftest",
"prov.tests.examples",
"prov.tests.strategies",
"prov.tests.test_attribute_merging",
"prov.tests.test_attributes",
"prov.tests.test_chaining",
"prov.tests.test_cli_smoke",
"prov.tests.test_conformance_dm",
"prov.tests.test_datetime_parsing",
"prov.tests.test_dot",
"prov.tests.test_examples",
"prov.tests.test_extras",
"prov.tests.test_graphs",
"prov.tests.test_identifier",
"prov.tests.test_identifier_slots",
"prov.tests.test_json",
"prov.tests.test_json_schema",
"prov.tests.test_jsonld",
"prov.tests.test_jsonld_schema",
"prov.tests.test_jsonld_semantics",
"prov.tests.test_literal_semantics",
"prov.tests.test_malformed",
"prov.tests.test_model",
"prov.tests.test_namespace_cache",
"prov.tests.test_numeric_typing",
"prov.tests.test_property_roundtrip",
"prov.tests.test_provn",
"prov.tests.test_provn_corpus",
"prov.tests.test_provn_escaping",
"prov.tests.test_provn_lexer",
"prov.tests.test_provn_profiles",
"prov.tests.test_public_api",
"prov.tests.test_qnames",
"prov.tests.test_rdf",
"prov.tests.test_read",
"prov.tests.test_scripts",
"prov.tests.test_statements",
"prov.tests.test_unification_constraints",
"prov.tests.test_unification_rules",
"prov.tests.test_xml",
"prov.tests.test_xml_schema",
]
ignore_errors = true