-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (190 loc) · 6.57 KB
/
Copy pathpyproject.toml
File metadata and controls
203 lines (190 loc) · 6.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
[build-system]
requires = ["hatchling>=1.26"]
build-backend = "hatchling.build"
[tool.hatch.build]
ignore-vcs = false
skip-excluded-dirs = true
exclude = [
"__pycache__/",
"*.py[cod]",
".pytest_cache/",
".mypy_cache/",
".ruff_cache/",
"build/",
"dist/",
"*.egg-info/",
"docs/_build/",
"docs/superpowers/",
"docs/glpi_api_contract.json",
".venv/",
"venv/",
".env",
".env.*",
".coverage",
"secrets/",
"integration_tests/",
# Unit tests live beside the modules they test, so they sit inside the
# package directory. Both patterns are gitignore-style and match at any
# depth; "tests/" matches only a directory named exactly that, so
# glpi_python_client/testing/ -- a documented downstream helper -- is
# untouched.
"tests/",
"conftest.py",
]
[project]
name = "glpi-python-client"
version = "0.4.3"
description = "A typed Python client for GLPI ITSM APIs."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [{ name = "glpi-python-client contributors" }]
keywords = ["glpi", "itsm", "api", "client"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"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",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"beautifulsoup4>=4.12",
"httpx>=0.28",
"lxml>=4.9",
"markdown>=3.6",
"markdownify>=0.13",
"pydantic>=2.8",
# Never imported by this package, and deliberately so. httpcore decides
# whether it is running under asyncio or trio by probing for sniffio on
# every async request (`try: import sniffio / except ImportError`).
# Nothing else in the chain requires it -- anyio 4.14 dropped the
# dependency and httpx does not replace it -- and Python never caches a
# failed import, so when sniffio is absent each request re-walks
# sys.path instead. Measured at a fan-out of 128 against a 50ms server:
# 3354ms without it, 1304ms with. `pip check` reports no broken
# requirements either way, so this pin is the only thing holding the fix.
"sniffio>=1.3",
# Required because `server_timezone` takes an IANA zone name, and a name
# is what makes DST correct -- a fixed offset would be wrong for half the
# year against an instance that emits both +01:00 and +02:00. Windows
# ships no system tz database, so `zoneinfo` finds nothing there while
# Linux reads /usr/share/zoneinfo: without this pin the client works in
# CI and raises ZoneInfoNotFoundError on a developer machine.
"tzdata>=2024.1; platform_system == 'Windows'",
"tenacity>=8.2",
"typing-extensions>=4.7; python_version < '3.11'",
]
[project.optional-dependencies]
docs = [
"numpydoc>=1.8",
"sphinx>=7.2,<8.2",
"sphinx-rtd-theme>=2.0",
"tomli>=2.0; python_version < '3.11'",
]
dev = [
"build>=1.2",
"mypy>=1.11",
"numpydoc>=1.8",
"pre-commit>=4.0",
"pytest>=8.0",
"pytest-asyncio>=0.23",
"pytest-cov>=5.0",
"ruff>=0.6",
"sphinx>=7.2,<8.2",
"sphinx-rtd-theme>=2.0",
"tomli>=2.0; python_version < '3.11'",
"twine>=5.1",
"unasync>=0.6",
"vulture>=2.11",
]
[project.urls]
Homepage = "https://github.com/baraline/glpi_python_client"
Documentation = "https://glpi-python-client.readthedocs.io/en/latest/"
Issues = "https://github.com/baraline/glpi_python_client/issues"
Source = "https://github.com/baraline/glpi_python_client"
[tool.hatch.build.targets.wheel]
packages = ["glpi_python_client"]
[tool.hatch.build.targets.sdist]
include = [
"/docs",
"/glpi_python_client",
"/skills",
"/.pre-commit-config.yaml",
"/.readthedocs.yaml",
"/CHANGELOG.md",
"/CONTRIBUTING.md",
"/LICENSE",
"/README.md",
"/pyproject.toml",
]
[tool.pytest.ini_options]
testpaths = ["glpi_python_client", "integration_tests"]
addopts = "--strict-markers --strict-config"
asyncio_mode = "auto"
markers = [
"integration: tests that call a live GLPI instance using local secrets",
]
[tool.coverage.run]
branch = false
source = ["glpi_python_client"]
omit = [
"*/tests/*",
# Only the suites, not the helpers. `glpi_python_client/testing/*` used
# to sit here, which silently excluded utils.py and fixtures.py too --
# published API that downstream test suites import, measured by nothing.
# The first pattern already covers testing/tests/, so this is belt and
# braces against that line being reintroduced.
"glpi_python_client/testing/tests/*",
# The sync tree is generated from the async one by a 1:1 token transform
# that only strips async/await, so every statement exists in both.
# Measuring both would count the same logic twice and let real gaps hide
# behind a doubled denominator.
#
# Measure the async tree: it is the one a person edits, so it is the one
# a coverage report should be about. An uncovered line there is a line
# nobody wrote a test for; an uncovered line in _sync/ is an artefact of
# which surface a test happened to run on. Both trees are exercised --
# the client suites are generated in step with the code -- and the
# correspondence is enforced separately: unasync_build.py --check proves
# the trees match and mypy strict checks both.
"glpi_python_client/_sync/*",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
fail_under = 95
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
[tool.ruff]
line-length = 88
target-version = "py310"
# The sync client tree is generated by unasync_build.py from _async/ and
# must stay byte-identical to what regeneration produces -- that identity
# is what the CI gate checks. Formatting it would fight the generator, and
# reformatting the generated output is meaningless anyway: style is
# enforced on the hand-written source it comes from. mypy still checks it.
extend-exclude = ["glpi_python_client/_sync"]
[tool.ruff.lint]
select = ["B", "E", "F", "I", "RUF", "UP"]
[tool.mypy]
python_version = "3.10"
packages = ["glpi_python_client"]
strict = true
warn_unreachable = true
warn_unused_ignores = true
ignore_missing_imports = true
exclude = ['(^|/)tests/']
[tool.vulture]
min_confidence = 80
paths = ["glpi_python_client"]