-
Notifications
You must be signed in to change notification settings - Fork 64
/
pyproject.toml
256 lines (231 loc) · 7.35 KB
/
pyproject.toml
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
[build-system]
requires = ["poetry-core>=1.9.0,<2"]
build-backend = "poetry.core.masonry.api"
[project]
name = "pyshacl"
# Black and Ruff both now read target-version from [project.requires-python]
requires-python = ">=3.9"
[tool.poetry]
name = "pyshacl"
version = "0.29.0"
# Don't forget to change the version number in __init__.py, Dockerfile, and CITATION.cff along with this one
description = "Python SHACL Validator"
license = "Apache-2.0"
authors = [
"Ashley Sommer <[email protected]>"
]
readme = "README.md"
repository = "https://github.com/RDFLib/pySHACL"
homepage = "https://github.com/RDFLib/pySHACL"
keywords = ["Linked Data", "Semantic Web", "RDF", "Python", "SHACL", "Shapes", "Schema", "Validate"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Utilities",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent"
]
packages = [
{ include = "pyshacl" },
{ include = "examples", format = "sdist" },
{ include = "benchmarks", format = "sdist" },
{ include = "test", format = "sdist" }
]
include = [
{ path = "pyshacl/assets/*.ttl", format = "sdist" },
{ path = "pyshacl/assets/*.py", format = "sdist" },
{ path = "hooks/*", format = "sdist" },
{ path = "MANIFEST.in", format = "sdist" },
{ path = "pyproject.toml", format = "sdist" },
{ path = "poetry.lock", format = "sdist" },
{ path = "Makefile", format = "sdist" },
{ path = "*.md" },
{ path = "*.txt" },
{ path = "pyshacl/py.typed" },
{ path = "pyshacl/assets/*.pickle" },
{ path = "pyshacl/*.spec" }
]
[tool.poetry.dependencies]
# The <4 is reauired for compatiblity with OWL-RL that requdires Python <4
python = ">=3.9,<4" # Poetry doesn't read from [project.requires-python]
rdflib = {version=">=7.1.1,<8.0", extras=["html"]}
owlrl = ">=7.1.2,<8"
prettytable = [
{version=">=3.5.0", python = ">=3.8,<3.12"},
{version=">=3.7.0", python = ">=3.12"}
]
packaging = ">=21.3"
importlib-metadata = {version=">6", python = "<3.12"}
pyduktape2 = {version="^0.4.6", optional=true}
sanic = {version=">=22.12, <23", optional=true} #For the HTTP service
sanic-ext = {version=">=23.3, <23.6", optional=true} #For the HTTP service
sanic-cors = {version="2.2.0", optional=true} #For the HTTP service
ruff = {version="^0.1.5", optional=true}
black = {version="24.3.0", optional=true}
mypy = {version=">=1.13.0", optional=true}
types-setuptools = {version="*", optional=true}
platformdirs = {version="*", optional=true}
coverage = {version=">6,<7,!=6.0.*,!=6.1,!=6.1.1", optional=true}
pytest-cov = {version="^2.8.1", optional=true}
[tool.poetry.dev-dependencies]
pytest = "^7.2"
coverage = {version=">6,<7,!=6.0.*,!=6.1,!=6.1.1", optional=true}
pytest-cov = {version="^2.8.1", optional=true}
ruff = {version="^0.1.5", optional=true}
black = {version="24.3.0", optional=true}
mypy = {version=">=1.13.0", optional=true}
types-setuptools = {version="*", optional=true}
platformdirs = {version="*", optional=true}
[tool.poetry.extras]
js = ["pyduktape2"]
http = ["sanic", "sanic-ext", "sanic-cors"]
dev-lint = ["ruff", "black", "platformdirs"]
dev-type-checking = ["mypy", "types-setuptools", "platformdirs"]
dev-coverage = ["pytest-cov", "coverage", "platformdirs"]
[tool.poetry.scripts]
pyshacl = "pyshacl.cli:main"
pyshacl_rules = "pyshacl.cli_rules:main"
pyshacl_validate = "pyshacl.cli:main"
pyshacl_server = "pyshacl.http:cli"
[tool.dephell.main]
from = {format = "poetry", path = "pyproject.toml"}
to = {format = "setuppy", path = "setup.py"}
[tool.black]
required-version = "24.3.0"
line-length = "119"
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.ruff_cache
| \.pytest_cache
| \.tox
| \.venv
| _build
| htmlcov
| benchmarks
| examples
| pyshacl.egg-info
| buck-out
| build
| dist
| venv
)/
)
'''
[tool.ruff]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F"]
ignore = ["E501"] # Turn off ruff's too-long-line detection for now, we'll have to enable it again later.
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".pytest_cache",
".svn",
".tox",
".venv",
".idea",
"htmlcov",
"__pypackages__",
"_build",
"buck-out",
"pyshacl.egg-info",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 119
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = [
"test",
]
[tool.tox]
legacy_tox_ini = """
[tox]
skipsdist = true
envlist = py39, py310, py311, py312, lint, type-checking
toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
deps =
poetry>=1.8.4
passenv =
DBUS_SESSION_BUS_ADDRESS
PIP_KEYRING_PROVIDER
PIP_FORCE_KEYRING
PYTHON_KEYRING_BACKEND
skip_install = true
allowlist_externals = python3, ls, pwd, env, poetry
commands_pre =
py39: poetry run pip3 install -U "pip>=21.0"
py310: poetry run pip3 install -U "pip>=21.3"
py311: poetry run pip3 install -U "pip>=22.1"
poetry install -vv -n --no-root --extras "js dev-coverage"
commands =
- poetry show
poetry run pytest -v --log-level=INFO --cov=pyshacl test/
- poetry run coverage combine --append
poetry run coverage report -m
poetry run coverage html -i
[testenv:lint]
commands_pre =
python --version
poetry install -vv -n --no-root --extras "dev-lint"
commands =
- poetry show
poetry run ruff check ./pyshacl
poetry run ruff check --select I ./pyshacl #isort
poetry run black --check --verbose --config ./pyproject.toml pyshacl
[testenv:type-checking]
commands_pre =
python --version
poetry install -vv -n --no-root --extras "dev-type-checking"
poetry run pip3 install "mypy>=0.812" "types-setuptools"
commands =
- poetry show
poetry run python3 -m mypy --python-version 3.9 --ignore-missing-imports pyshacl
[gh]
# Don't include lint or type-checking in gh-actions matrix
python =
3.12 = py312
3.11 = py311
3.10 = py310
3.9 = py39
"""