-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (218 loc) · 7.57 KB
/
Copy pathpyproject.toml
File metadata and controls
258 lines (218 loc) · 7.57 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
248
249
250
251
252
253
254
255
256
257
258
[build-system]
requires = [
"hatchling>=1.24",
"hatch-mypyc; platform_python_implementation == 'CPython'",
# mypy 1.19 is partially broken for us: https://github.com/python/mypy/issues/20329
"mypy>=1.8, != 1.19.*; platform_python_implementation == 'CPython'",
]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
only-include = ["pyjelly"]
artifacts = [
"*__mypyc*.*",
"**/*__mypyc*.*",
"**/*.so",
"**/*.pyd",
"**/*.dylib"
]
[tool.hatch.build.targets.sdist]
include = ["pyjelly"]
[tool.hatch.build.targets.wheel.hooks.mypyc]
require-cpython = true
modules = ["pyjelly"]
include = [
"pyjelly/serialize/ioutils.py",
"pyjelly/integrations/generic/serialize.py",
"pyjelly/parse/lookup.py",
"pyjelly/parse/ioutils.py",
"pyjelly/serialize/streams.py",
"pyjelly/parse/decode.py",
"pyjelly/serialize/encode.py",
"pyjelly/serialize/lookup.py",
]
mypy-args = [
"--ignore-missing-imports",
"--no-warn-no-return"
]
[tool.cibuildwheel]
build = ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
skip = ["*-win32"]
test-extras = ["rdflib"]
test-requires = [
"mypy-extensions",
"pytest", "hypothesis", "inline-snapshot", "pytest-mock",
"pytest-subtests", "pytest-accept", "detect-test-pollution"
]
test-command = "cp -r {project}/pyjelly /tmp/pyjelly && cp -r {project}/tests /tmp/tests && cd /tmp && PYTHONPATH=/tmp python -m pytest -q --import-mode=importlib tests"
[tool.cibuildwheel.windows]
archs = ["AMD64"]
[tool.cibuildwheel.macos]
archs = ["universal2"]
[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
[project]
name = "pyjelly"
version = "0.0.0"
readme = "README.md"
description = "Jelly-RDF implementation for Python"
authors = [
{ name = "NeverBlink et al.", email = "contact@neverblink.eu" }
]
requires-python = ">=3.10, <3.15"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: Apache Software License",
"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",
"Environment :: Console",
"Environment :: Plugins",
"Topic :: Database",
"Topic :: File Formats",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = ["RDF", "Knowledge graph", "Jelly", "Serialization format"]
license = "Apache-2.0"
dependencies = [
"protobuf>=6.30.0",
"typing-extensions>=4.12.2", # revisit after 3.13 is older
"mypy-extensions>=1.0.0",
]
[project.urls]
Homepage = "https://w3id.org/jelly/pyjelly"
Documentation = "https://w3id.org/jelly/pyjelly"
Repository = "https://github.com/Jelly-RDF/pyjelly"
Issues = "https://github.com/Jelly-RDF/pyjelly/issues"
Changelog = "https://github.com/Jelly-RDF/pyjelly/releases"
[project.optional-dependencies]
rdflib = ["rdflib>=7.1.4"]
[project.entry-points."rdf.plugins.parser"]
jelly = "pyjelly.integrations.rdflib.parse:RDFLibJellyParser"
"application/x-jelly-rdf" = "pyjelly.integrations.rdflib.parse:RDFLibJellyParser"
[project.entry-points."rdf.plugins.serializer"]
jelly = "pyjelly.integrations.rdflib.serialize:RDFLibJellySerializer"
"application/x-jelly-rdf" = "pyjelly.integrations.rdflib.serialize:RDFLibJellySerializer"
[dependency-groups]
dev = ["mypy>=1.13.0, != 1.19.*", "pre-commit>=4.2.0", "ruff>=0.11.8"]
# grpc doesn't support PyPy at the time of writing, see grpc/grpc#4221
protoc = ["grpcio-tools>=1.73.0; implementation_name != 'pypy'"]
profiling = ["scalene>=1.5.51", "memray>=1.16.0"]
test = [
"detect-test-pollution>=1.2.0",
"hypothesis>=6.131.0",
"inline-snapshot>=0.20.8",
"pytest>=8.3.4,<9.2.0",
"pytest-cov>=6.2.1",
"pytest-accept>=0.1.12",
"pytest-mock>=3.14.0",
"pytest-subtests>=0.14.1",
"pytest-sugar>=1.0.0",
]
extras = ["pyjelly[rdflib]"] # workaround for astral-sh/uv#8607
types = ["types-protobuf>=5.29.1.20250315"]
docs = [
"markdown-exec>=1.10.3",
"mike>=2.1.3",
"mkdocs>=1.6.1",
"mkdocs-git-revision-date-localized-plugin>=1.4.5",
"mkdocs-macros-plugin>=1.3.7",
"mkdocs-material>=9.6.13",
"mkdocstrings>=0.29.1",
"mkdocstrings-python>=1.16.10",
"jinja2>=3.1,<3.2",
"markupsafe<4.0.0",
"linkchecker~=10.6.0",
]
# version 3.1 required for python 3.14 support
ci = ["cibuildwheel>=3.1.0,<4 ; python_version >= '3.11'"]
[tool.uv]
required-version = ">=0.11,<0.12"
default-groups = ["dev", "extras", "test", "types"]
[tool.mypy]
strict = true
explicit_package_bases = true
exclude = [
"build/",
"docs/",
".*_pb2(_grpc)?\\.pyi?",
"examples/"
]
[[tool.mypy.overrides]]
module = "google.protobuf.proto"
ignore_errors = true
ignore_missing_imports = true
[tool.ruff.lint.isort]
extra-standard-library = ["typing_extensions"]
[tool.pytest.ini_options]
pythonpath = "."
addopts = ["--import-mode=importlib", "--doctest-modules", "--ignore-glob=docs/examples/**", "--ignore-glob=examples/**"]
[tool.ruff]
extend-exclude = ["*{_pb2,_pb2_grpc}.{py,pyi}"]
[tool.setuptools]
packages = ["pyjelly"]
[tool.ruff.lint]
extend-per-file-ignores = { "tests/unit_tests/**" = ["PLR2004"] }
exclude = [
"**examples/**",
]
select = ["ALL"]
ignore = [
# Description: Dynamically typed expressions (typing.Any) are disallowed
# Rationale:
# We use Any to allow user to constrain return types of our functions on their own.
# For example, having a function `def foo() -> Any: ...` allows user to write
# `my_foo: int = foo()` and have it passed type checking, since `Any` as a gradual
# form is assignable to any type
"ANN401",
# Description: 1 blank line required before class docstring
# Rationale: Remove the warning -- D211 (no-blank-line-before-class) preferred
"D203",
# Description: Multi-line docstring summary should start at the second line
# Rationale: Remove the warning -- D213 (multi-line-summary-second-line) preferred
"D212",
# Description: Line contains TODO, consider resolving the issue
# Rationale: Not appropriate for the project
"FIX002",
# Description: Implicitly concatenated string literals on one line
# Rationale: Conflicts with the formatter
"ISC001",
# Description: Trailing comma missing
# Rationale: Conflicts with the formatter
"COM812",
# Description: Missing copyright notice at top of file
# Rationale: incorrect expectation
"CPY001",
# Description: File is part of an implicit namespace package. Add an `__init__.py`
# Rationale: Implicit namespace packages are a feature
"INP001",
# Description: Missing documentation
# Rationale: Important, but secondary concern
"D100", # Public module
"D101", # Public class
"D102", # Public method
"D103", # Public function
"D104", # Public package
"D105", # Magic method
"D107", # __init__
# Description: Use of `assert` detected
# Rationale: Assertions aren't bad and can be disabled with `python -O`
"S101",
# Description: Missing issue link on the line following this TODO
# Rationale: Own semantics
"TD003",
# Description: Wildcard imports used
# Rationale: Waiting for red knot to understand them
"F403",
# Description: Move third-party import into a type-checking block
# Rationale: Start-up time is not yet that important
"TC",
# Description: Private member accessed
# Rationale: In reality, this check causes more trouble than prevents bad things
"SLF001",
]