-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
136 lines (119 loc) · 4.02 KB
/
pyproject.toml
File metadata and controls
136 lines (119 loc) · 4.02 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
[tool.poetry]
name = "denokv"
version = "0.1.0-alpha-dev"
description = "Connect to Deno KV databases from Python."
authors = ["Hal Blackburn <hwtb2@cam.ac.uk>"]
license = "MIT"
readme = "README.md"
packages = [{ include = "denokv", from = "src" }]
homepage = "https://github.com/h4l/denokv-python"
repository = "https://github.com/h4l/denokv-python"
documentation = "https://github.com/h4l/denokv-python"
classifiers = [
"Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries :: Python Modules",
"Framework :: AsyncIO",
"Development Status :: 2 - Pre-Alpha",
]
[tool.poetry.dependencies]
python = "^3.9"
aiohttp = "^3"
yarl = "^1"
protobuf = ">=4.22.0,<6"
# We only use fdb.tuple from foundationdb, and the most-recent significant
# change was in 6.2.4 (which is late 2019)
# https://github.com/apple/foundationdb/commits/main/bindings/python/fdb/tuple.py
foundationdb = ">=6.2.4,<8"
v8serialize = "^0.2.0-alpha.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.2"
ruff = "^0.8.4"
isort = "^5.13.2"
mypy = "^1.14.0"
pytest-asyncio = "^0.25.0"
pytest-aiohttp = "^1.0.5"
types-protobuf = ">=4.22,<4.23" # should be pinned to match lower bound of non-dev protobuf dep
typing-extensions = "^4.12.2"
hypothesis = "^6.112.2"
pytest-cov = "^6.0.0"
[tool.poetry.group.dev-extra.dependencies]
jupyterlab = "^4.2.5"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.flake8]
max-line-length = 80
extend-select = "B950"
extend-ignore = "E203,E501,E701"
[tool.isort]
profile = "black"
extra_standard_library = ["typing_extensions"]
[tool.mypy]
strict = true
enable_error_code = [
'possibly-undefined'
]
mypy_path = "./stubs"
[[tool.mypy.overrides]]
module = "denokv._datapath_pb2"
# Generated protocol buffers stubs don't specify generic type params
disallow_any_generics = false
ignore_errors = true
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff]
exclude = [
# Generated protobuf files
"src/denokv/_datapath_pb2.py",
"src/denokv/_datapath_pb2.pyi",
]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"D", # pydocstyle
"E",
"F",
"FA", # flake8-future-annotations
"PYI", # flake8-pyi
"I",
"TID", # flake8-tidy-imports
]
ignore = [
"D100", # "Missing docstring in public module" — not everything is documented yet
"D101", # "Missing docstring in public class" — not everything is documented yet
"D102", # "Missing docstring in public method" — not everything is documented yet
"D103", # "Missing docstring in public function" — not everything is documented yet
"D104", # "Missing docstring in public package" — not everything is documented yet
"D105", # "Missing docstring in magic method" — not everything is documented yet
# Allow annotating int | float (which is technically redundant, but IMO
# valuable as it communicates intent, given that int and float are not used
# interchangeably).
"PYI041",
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"typing_extensions".msg = "use denokv._pycompat.typing instead, typing_extensions is not a runtime dependency."
"typing".msg = "Use denokv._pycompat.typing instead (apart from overload and Literal), using typing is error-prone as it has many differences between python versions."
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.pytest.ini_options]
addopts = ["--doctest-modules"]
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
# Treat warnings emitted during tests as errors. (This way we can explicitly
# ignore warnings we know to be OK.)
"error",
# Triggered by the fairly old version of protobuf we use
'ignore:_SixMetaPathImporter\.find_spec\(\)\ not\ found;\ falling\ back\ to\ find_module\(\):ImportWarning:importlib._bootstrap'
]
[tool.coverage.run]
source = ["denokv"]
omit = [
# generated Protocol Buffers module
"*/denokv/_datapath_pb2.py",
]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"^\\s*def .+: [.]{3}$", # def foo(): ... (... instead of pass)
"^\\s*assert_never\\(.*\\)$", # unreachable assertion, expected to not execute
]