File: pyproject.toml

package info (click to toggle)
python-rdflib-endpoint 0.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 744 kB
  • sloc: python: 1,197; sh: 21; makefile: 5
file content (264 lines) | stat: -rw-r--r-- 7,517 bytes parent folder | download
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
259
260
261
262
263
264
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
requires-python = ">=3.8"
name = "rdflib-endpoint"
description = "A package to deploy SPARQL endpoint to serve local RDF files, machine learning models, or any other logic implemented in Python, using RDFLib and FastAPI."
readme = "README.md"
license = { file = "LICENSE.txt" }
authors = [
    { name = "Vincent Emonet", email = "vincent.emonet@gmail.com" },
]
maintainers = [
    { name = "Vincent Emonet", email = "vincent.emonet@gmail.com" },
]
keywords = [
    "Python",
    "SPARQL",
    "RDF",
    "RDFLib",
    "endpoint",
]
classifiers = [
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "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",
    "Programming Language :: Python :: 3.13",
]
dynamic = ["version"]

dependencies = [
    "rdflib >=6.0.0",
    "fastapi >=0.51.0",
]


[project.scripts]
rdflib-endpoint = "rdflib_endpoint.__main__:cli"


[project.optional-dependencies]
cli = [
    "uvicorn[standard] >=0.12.0",
    "click",
]
web = [
    "uvicorn[standard] >=0.12.0",
]
oxigraph = [
    "oxrdflib",
]


[dependency-groups]
dev = [
    "pytest >=8.3.4",
    "pytest-cov >=5.0.0",
    "ruff >=0.11.7",
    "mypy >=1.4.1",
    "pre-commit",
    "requests",
    "httpx",
    "git-cliff",
    "testcontainers",
    "types-PyYAML",
    "types-setuptools",
    "types-ujson",
    "types-click",
]


[project.urls]
Homepage = "https://github.com/vemonet/rdflib-endpoint"
Documentation = "https://github.com/vemonet/rdflib-endpoint"
History = "https://github.com/vemonet/rdflib-endpoint/releases"
Tracker = "https://github.com/vemonet/rdflib-endpoint/issues"
Source = "https://github.com/vemonet/rdflib-endpoint"


# ENVIRONMENTS AND SCRIPTS, not used anymore, checkout scripts/ folder
[tool.hatch.envs.default]
installer = "uv"
features = [
    "cli",
    "web",
    "oxigraph",
]
post-install-commands = [
    "pre-commit install",
]


[tool.hatch.envs.default.scripts]
dev = "uvicorn example.main:app --reload {args}"
fmt = [
    "pre-commit run --all --all-files",
    "mypy",
]
test = [
    "fmt",
    "pytest --cov-fail-under=85 {args}",
]
cov = [
    "pytest --cov-report html {args}",
    "python -c 'import webbrowser; webbrowser.open(\"http://0.0.0.0:3000\")'",
    "python -m http.server 3000 --directory ./htmlcov",
]


[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]


# TOOLS
[tool.hatch.build.targets.wheel]
packages = ["src/rdflib_endpoint"]

[tool.hatch.version]
path = "src/rdflib_endpoint/__init__.py"

[tool.pytest.ini_options]
addopts = [
    "-vvv",
    "--color=yes",
]
filterwarnings = [
    "ignore::DeprecationWarning:httpx.*:"
]


[tool.mypy]
files = ["src/"]
strict = true
implicit_reexport = true
follow_imports = "normal"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
warn_no_return = true
warn_unused_ignores = true
warn_redundant_casts = true
disallow_untyped_defs = true
disallow_any_generics = true
disallow_untyped_calls = false # needed due to _eval() not being typed in rdflib

# https://docs.astral.sh/ruff/rules/
[tool.ruff]
src = ["src", "tests"]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
    "I",     # isort
    "N",     # pep8-naming
    "S",     # bandit
    "A",     # flake8-builtins
    "YTT",   # flake8-2020
    "B",     # flake8-bugbear
    "C",     # flake8-comprehensions
    "ICN",   # flake8-import-conventions
    "SIM",   # flake8-simplify
    "TID",   # flake8-tidy-imports
    "Q",     # flake8-quotes
    # "FBT",   # flake8-boolean-trap
    "F",     # pyflakes
    "UP",    # pyupgrade
    "E",     # pycodestyle errors
    "W",     # pycodestyle warnings
    "PLC",   # pylint convention
    "PLE",   # pylint error
    # "PLR",   # pylint refactor Magic value used in comparison, consider replacing 400 with a constant variable
    "PLW",   # pylint warning
    "RUF",   # ruff specific
    "T",
]

ignore = [
    "B008", # do not perform function calls in argument defaults (required for FastAPI afaik)
    "E501", # line too long
    "C901", # too complex
    "S101", # Use of `assert` detected
    "T201", "T203", # remove print and pprint
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["I", "F401"] # module imported but unused


[tool.git-cliff.git]
# NOTE: Add an exclamation mark in your commit message prefix to indicate a BREAKING change
# e.g. `feat!: changed things` or `feat(python)!: changed things`
# More details about the standard at https://www.conventionalcommits.org
commit_parsers = [
    { message = "^feat", group = "โ›ฐ๏ธ Features" },
    { message = "^fix", group = "๐Ÿ› Bug Fixes" },
    { message = "^doc", group = "๐Ÿ“š Documentation" },
    { message = "^perf|DataOriented", group = "โšก Performance" },
    { message = "^refactor", group = "๐Ÿšœ Refactor" },
    { message = "^style|Formatting", group = "๐ŸŽจ Styling" },
    { message = "^test", group = "๐Ÿงช Testing" },
    { message = "^ci", group = "โš™๏ธ Continuous Integration" },
    { message = "^chore\\(release\\): prepare for", skip = true },
    { message = "^chore\\(deps\\)", skip = true },
    { message = "^chore\\(pr\\)", skip = true },
    { message = "^chore\\(pull\\)", skip = true },
    { message = "^chore", group = "๐Ÿ› ๏ธ Miscellaneous Tasks" },
    { body = ".*security", group = "๐Ÿ›ก๏ธ Security" },
    { message = "^revert", group = "โ—€๏ธ Revert" },
]
conventional_commits = true
filter_unconventional = false
split_commits = false
# Protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
filter_commits = true
tag_pattern = "v?[0-9].*"
# Sort the tags topologically
topo_order = false
sort_commits = "oldest"
# skip_tags = "0.1.0-beta.1"    # regex for skipping tags
# ignore_tags = ""  # regex for ignoring tags
# limit_commits = 42    # limit the number of commits included in the changelog.
# regex for preprocessing the commit messages:
# commit_preprocessors = [
#   # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers
# ]

[tool.git-cliff.changelog]
header = """
# ๐Ÿ“œ Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# Template for the changelog: https://keats.github.io/tera/docs
body = """
{% if version %}\
    {% if previous.version %}\
        ## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
    {% else %}\
        ## [{{ version | trim_start_matches(pat="v") }}](<REPO>/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
    {% endif %}\
{% else %}\
    ## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | upper_first }}
    {% for commit in commits %}
        - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }}))\
    {% endfor %}
{% endfor %}\n
"""
trim = true
footer = """
<!-- generated by git-cliff -->
"""
postprocessors = [
    { pattern = '<REPO>', replace = "https://github.com/vemonet/rdflib-endpoint" },
]