Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
257 lines (241 loc) · 9.87 KB
/
Copy pathpyproject.toml
File metadata and controls
257 lines (241 loc) · 9.87 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
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "pycubrid"
dynamic = ["version"]
description = "Pure Python DB-API 2.0 driver for CUBRID database"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{name = "Yeongseon Choe", email = "yeongseon.choe@gmail.com"},
{name = "Gyeongjun Paik", email = "paikend@gmail.com"},
]
keywords = ["CUBRID", "database", "driver", "DB-API", "PEP 249", "tls", "ssl", "starttls", "asyncio"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Typing :: Typed",
]
dependencies = [
# Windows ships no IANA time zone database; zoneinfo needs it for
# TIMESTAMPTZ/DATETIMETZ region names (#413).
"tzdata; sys_platform == 'win32'",
]
# Contributor tooling lives in PEP 735 dependency groups, not in extras, so it
# never reaches the published package metadata (#784). Install a group with
# `pip install -e . --group dev` (pip 25.1 or later) or
# `uv pip install -e . --group dev`. Each pin is declared once, here.
[dependency-groups]
test = [
"pytest>=7.0",
"pytest-asyncio>=0.21",
"pytest-cov",
"pytest-benchmark>=5.0",
"hypothesis>=6.0",
# Imported directly by the repository-tooling tests (workflow YAML, version
# specifiers); tests/test_workflow_pins.py keeps this list complete.
"packaging",
"pyyaml",
# scripts/check_docs_links.py and check_agents_docs.py parse Markdown (#927).
"markdown-it-py>=4",
# tests/test_docs_channel_notice.py renders the site notice template (#971);
# MkDocs renders it with the same library.
"jinja2>=3.1",
]
lint = [
"ruff==0.17.5",
"mypy==2.4.1",
"pre-commit",
]
security = [
"bandit[toml]==1.9.4",
]
build = [
"build",
"setuptools==84.2.1",
]
release = [
{include-group = "build"},
"twine",
]
docs = [
"mkdocs==1.6.1",
"mkdocs-material==9.8.1",
"pymdown-extensions==12.3",
# The deterministic documentation checks in the docs-check CI job (#927).
"markdown-it-py==4.3.0",
]
mutation = [
"mutmut>=3.8,<4",
]
# Everything a contributor needs for `make check` and `make test`; the same
# set the former `dev` extra installed.
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "security"},
{include-group = "release"},
]
[project.urls]
Homepage = "https://github.com/cubrid-lab/pycubrid"
Repository = "https://github.com/cubrid-lab/pycubrid"
Documentation = "https://cubrid-lab.github.io/pycubrid/"
Changelog = "https://github.com/cubrid-lab/pycubrid/blob/main/CHANGELOG.md"
Issues = "https://github.com/cubrid-lab/pycubrid/issues"
[tool.uv.sources]
# PyYAML 6.0.3 has no CPython 3.15 wheel. This contains its unchanged Python
# modules with the optional native extension removed; see the wheel provenance.
pyyaml = {path = ".github/ci-wheels/pyyaml-6.0.3-1-py3-none-any.whl", marker = "python_version == '3.15'"}
[tool.uv.dependency-groups]
# Matches the existing make mutation Python guard.
mutation = {requires-python = ">=3.12"}
[tool.setuptools]
packages = ["pycubrid", "pycubrid.aio", "pycubrid.compat"]
include-package-data = true
[tool.setuptools.dynamic]
version = {attr = "pycubrid.__version__"}
[tool.ruff]
line-length = 100
target-version = "py311"
# Keep CLI discovery aligned with the Python/pyi-only pre-commit hooks.
include = ["*.py", "*.pyi"]
[tool.ruff.lint]
# Pin the rule set explicitly instead of inheriting ruff's implicit defaults.
# Ruff expanded its default selection in 0.16 (59 -> 413 rules against this
# config), which turns every routine ruff bump into a CI-breaking change
# unrelated to our own code. These four groups are exactly what ruff selected
# by default through 0.15.x.
select = ["E4", "E7", "E9", "F"]
[tool.ruff.lint.isort]
known-first-party = ["pycubrid"]
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"]
[tool.coverage.run]
source = ["pycubrid"]
[tool.coverage.report]
show_missing = true
fail_under = 95
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb native -v -r fxX --maxfail=25 -p no:warnings"
python_files = "tests/*test_*.py"
markers = [
"integration: requires a live CUBRID server",
"slow: long-running tests (soak, stress, chaos) excluded from the standard full matrix",
"tls: TLS-specific integration tests run in the dedicated integration-tls job",
"version_matrix: cross-version differential run against every CUBRID in CUBRID_VERSION_MATRIX (version-differential job)",
"official_differential: claims-driven comparison with the pinned official CUBRIDdb driver (official-differential job, #446)",
"benchmark: performance benchmark (requires a live CUBRID server)",
"no_escape_pin: opt out of the autouse backslash-escape-mode default pin to exercise real negotiation (#524)",
"repo_tooling: repository policy/tooling check (docs, release scripts, CI workflow contracts, PR title) with no pycubrid driver behavior, run in the repo-tooling-tests job (#558)",
]
[tool.mutmut]
# Mutation testing scopes the driver core — the modules where a wrong constant,
# flipped comparison, or dropped cleanup silently corrupts data or leaks
# resources. The offline suite is the test command (no DB), so mutants are
# killed by the property/protocol/state-machine tests, not live integration.
#
# mutmut 3 keys (#612). The 2.x spelling (paths_to_mutate / tests_dir / runner)
# crashed mutmut 3 on import, and its comma-joined strings were read as one
# Path per character, so nothing was ever measured.
source_paths = ["pycubrid"]
only_mutate = [
"pycubrid/packet.py",
"pycubrid/protocol.py",
"pycubrid/_prepared_binding.py",
"pycubrid/_cursor_common.py",
"pycubrid/_connection_common.py",
"pycubrid/cursor.py",
"pycubrid/connection.py",
"pycubrid/lob.py",
"pycubrid/aio/connection.py",
"pycubrid/aio/cursor.py",
]
# Into mutants/ mutmut copies source_paths plus a built-in list (tests/, test/,
# pyproject.toml, lock files) and nothing else; entries here are added to that
# list, not substituted for it. The offline suite imports scripts/ and reads
# .github/workflows/ and docs/, tests/test_record_demo.py imports demos/,
# tests/test_makefile_integration_cleanup.py runs the real Makefile and reads
# docker-compose.yml, tests/test_third_party_licenses.py reads
# THIRD_PARTY_LICENSES.md, tests/test_agent_eval.py lists agent-evals/ at import
# time, tests/test_compat_deprecation.py reads mkdocs.yml and
# tests/test_makefile_targets.py reads .gitignore, so the sandbox needs them. A
# missing entry fails the stats run before any mutant is tested ("failed to
# collect stats"), and mutmut hides the pytest output that names the file.
also_copy = [
"scripts",
".github",
"docs",
"demos",
"agent-evals",
"Makefile",
"THIRD_PARTY_LICENSES.md",
"docker-compose.yml",
"mkdocs.yml",
".gitignore",
]
# mutmut 3 adds -x -q itself. repo_tooling checks exercise repository policy and
# carry no driver behavior (see the marker definition above), so they cannot kill
# a driver mutant; they only lengthen the run. This is the same selection CI's
# offline job uses.
#
# The deselected tests inspect pycubrid's own functions and modules rather than
# their behavior, so mutmut's trampoline wrapping defeats them no matter which
# mutant is active:
# - two warning tests assert that a warning is blamed on the caller's file, but
# the trampoline adds a stack frame, so warnings.warn(stacklevel=...) lands in
# mutmut's trampoline.py or in pycubrid itself;
# - the option allow-list test compares against inspect.signature() of the
# connection constructors, and the executemany test reads
# Cursor.executemany.__kwdefaults__; the trampoline replaces both functions
# with wrappers that have a different signature and no keyword defaults;
# - the re-export test parses every name defined in _prepared_binding.py, and
# the mutated copy also defines the generated mutant functions, which
# protocol does not import.
# Running the offline lane inside mutants/ without -x shows these are the only
# ones, so the rest of the lane stays selected. All are covered normally by
# every other lane.
pytest_add_cli_args = [
"-m",
"not integration and not repo_tooling",
"-p",
"no:cacheprovider",
"--deselect",
"tests/test_unknown_options.py::TestUnknownOptionsWarn::test_warning_points_at_the_caller_not_at_pycubrid",
"--deselect",
"tests/test_unknown_options.py::TestAllowListDoesNotDrift::test_allow_list_matches_public_signatures_and_kwargs_reads",
"--deselect",
"tests/test_aio_cursor_parity.py::test_fetchmany_nonpositive_deprecation_names_the_caller_line",
"--deselect",
"tests/test_execute_array.py::test_cursor_type_is_exported",
"--deselect",
"tests/test_import_boundaries.py::test_prepared_binding_names_are_reexported_from_protocol_as_the_same_objects",
]
pytest_add_cli_args_test_selection = ["tests"]
# Default "fork" isolation forks each mutant from a process that has already run
# the suite, so Hypothesis sees the same test executed under a second executor and
# fails HealthCheck.differing_executors (observed on
# tests/test_property.py::TestRoundTripProperties::test_byte_round_trip during the
# clean-test phase). forkserver forks from a process that has collected but not run
# the tests, which keeps that state out of the children.
process_isolation = "forkserver"