-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
pyproject.toml
200 lines (182 loc) · 5.44 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
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling>=1.24.2",
"cffi",
"setuptools",
"scikit-build-core>=0.9.0",
"pypkgconf; sys_platform == 'win32'",
]
[project]
name = "coincurve"
authors = [
{ name = "Ofek Lev", email = "oss@ofek.dev" },
]
description = "Cross-platform Python CFFI bindings for libsecp256k1"
keywords = ["secp256k1", "crypto", "elliptic curves", "bitcoin", "ethereum", "cryptocurrency"]
readme = "README.md"
license = "MIT OR Apache-2.0"
requires-python = ">=3.8"
dependencies = [
"asn1crypto",
"cffi>=1.3.0",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
"Topic :: Security :: Cryptography",
]
dynamic = ["version"]
[project.optional-dependencies]
dev = [
"coverage",
"pytest",
"pytest-benchmark"
]
[project.urls]
Homepage = "https://github.com/ofek/coincurve"
Documentation = "https://ofek.dev/coincurve/"
Repository = "https://github.com/ofek/coincurve"
"Bug Tracker" = "https://github.com/ofek/coincurve/issues"
# --- hatch ---
[tool.hatch.version]
path = "src/coincurve/__about__.py"
[tool.hatch.build.targets.wheel.hooks.scikit-build]
experimental = true
cmake.verbose = true
cmake.build-type = "Release"
cmake.source-dir = "."
wheel.py-api = ""
wheel.packages = []
# --- scikit-build-core ---
[tool.scikit-build.cmake.define]
CMAKE_BUILD_TYPE = "Release"
# Coincurve build options - This may be better extracted from the ENV by the CMake directly?
PROJECT_IGNORE_SYSTEM_LIB = { env = "COINCURVE_IGNORE_SYSTEM_LIB", default = "ON" }
PROJECT_CROSS_COMPILE_TARGET = { env = "COINCURVE_CROSS_HOST", default = "" }
# Vendored library: SECP256K1
VENDORED_LIBRARY_CMAKE_TARGET = "secp256k1"
VENDORED_LIBRARY_PKG_CONFIG = "libsecp256k1"
VENDORED_LIBRARY_PKG_CONFIG_VERSION = "0.5.0"
VENDORED_UPSTREAM_URL = "https://github.com/bitcoin-core/secp256k1/archive/"
VENDORED_UPSTREAM_REF = { env = "COINCURVE_UPSTREAM_REF", default = "e3a885d42a7800c1ccebad94ad1e2b82c4df5c65" }
VENDORED_UPSTREAM_SHA = { env = "COINCURVE_UPSTREAM_SHA", default = "183b9f0417beea4d9c826ca324b5a464faca7446ef39a13a6abbe602df8d934b" }
# SECP256K1 library specific build options
# `VENDORED_OPTION` is reserved prefix for vendored library build options
VENDORED_LIBRARY_OPTION_PREFIX = "SECP256K1"
VENDORED_OPTION_DISABLE_SHARED = { env = "COINCURVE_SECP256K1_STATIC", default = "ON" }
VENDORED_OPTION_BUILD_BENCHMARK = "OFF"
VENDORED_OPTION_BUILD_TESTS = "OFF"
VENDORED_OPTION_BUILD_CTIME_TESTS = "OFF"
VENDORED_OPTION_BUILD_EXHAUSTIVE_TESTS = "OFF"
VENDORED_OPTION_BUILD_EXAMPLES = "OFF"
VENDORED_OPTION_ENABLE_MODULE_ECDH = "ON"
VENDORED_OPTION_ENABLE_MODULE_RECOVERY = "ON"
VENDORED_OPTION_ENABLE_MODULE_SCHNORRSIG = "ON"
VENDORED_OPTION_ENABLE_MODULE_EXTRAKEYS = "ON"
VENDORED_OPTION_EXPERIMENTAL = "ON"
# Vendored library build options (cmake, compiler, linker, etc.)
# VENDORED_CMAKE is reserved prefix for vendored library cmake options
# VENDORED_CMAKE_<STATIC|SHARED>_<CMAKE_OPTION> = <VALUE>
VENDORED_LIBRARY_STATIC_BUILD = { env = "COINCURVE_SECP256K1_STATIC", default = "ON" }
# --- Coverage ---
[tool.coverage.run]
branch = true
source = [
"src/coincurve",
"tests",
]
omit = [
"*/_version.py",
"*/test_bench.py",
]
[tool.coverage.report]
exclude_lines =[
"no cov",
"no qa",
# Ignore missing debug-only code
"def __repr__",
"if self\\.debug",
# Ignore non-runnable code
"if __name__ == .__main__.:",
]
[tool.coverage.paths]
source = [
"src/coincurve",
".tox/*/lib/python*/site-packages/coincurve",
".tox/pypy*/site-packages/coincurve",
]
# --- Pytest ---
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
]
# --- Black ---
[tool.black]
target-version = ["py38"]
line-length = 120
skip-string-normalization = true
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
# --- Ruff ---
[tool.ruff]
target-version = "py38"
line-length = 120
lint.select = ["A", "B", "C", "E", "F", "I", "M", "N", "Q", "RUF", "S", "T", "U", "W", "YTT"]
lint.ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Ignore McCabe complexity
"C901",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
]
lint.unfixable = [
# Don't touch unused imports
"F401",
]
extend-exclude = [
"tests/conftest.py",
]
[tool.ruff.lint.isort]
known-first-party = ["coincurve"]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.per-file-ignores]
# Tests can use assertions
"tests/*" = ["S101"]
"tests/**/*" = ["S101"]
# --- Mypy ---
[tool.mypy]
disallow_untyped_defs = false
follow_imports = "normal"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
warn_no_return = false
warn_unused_ignores = true