-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (135 loc) · 4.29 KB
/
pyproject.toml
File metadata and controls
160 lines (135 loc) · 4.29 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
[build-system]
# Must be kept in sync with `dependencies` below
requires = [
"setuptools>=61.0.0,!=74.0.0",
"wheel",
"cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.9'",
"cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.9'",
]
build-backend = "setuptools.build_meta"
[project]
dynamic = ["readme"]
name = "PyNaCl"
# Must be kept in sync with `src/nacl/__init__.py`
version = "1.6.2"
authors = [
{name = "The PyNaCl developers", email = "cryptography-dev@python.org"}
]
description = "Python binding to the Networking and Cryptography (NaCl) library"
license = {text = "Apache-2.0"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Free Threading :: 3 - Stable",
"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",
"Programming Language :: Python :: 3.14",
]
requires-python = ">=3.8"
dependencies = [
"cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.9'",
"cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.9'",
]
[project.optional-dependencies]
tests = [
"pytest >=7.4.0",
"pytest-cov >=2.10.1",
"pytest-xdist >=3.5.0",
"hypothesis>=3.27.0",
]
docs = [
"sphinx<7",
"sphinx_rtd_theme"
]
[project.urls]
"Homepage" = "https://github.com/pyca/pynacl"
"Bug Tracker" = "https://github.com/pyca/pynacl/issues"
"Documentation" = "https://pynacl.readthedocs.io"
[tool.ruff]
line-length = 79
exclude = ["src/libsodium"]
[tool.mypy]
show_error_codes = true
warn_redundant_casts = true
warn_incomplete_stub = true
disallow_any_unimported = true
disallow_any_expr = true # overridden to `false` inside `nacl.bindings`
disallow_any_decorated = true
disallow_any_explicit = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_unused_ignores = true
warn_no_return = true
warn_return_any = true # overridden to `false` inside `nacl.bindings`
warn_unreachable = true
no_implicit_reexport = true
strict_equality = true
files = [
"src/nacl",
"tests",
]
[[tool.mypy.overrides]]
module = [
"nacl._sodium",
]
ignore_missing_imports = true
# Within `nacl.bindings`, all of the C functions exposed via cffi in
# nacl._sodium return `Any` as far as mypy is concerned. It's not worth it to
# stub the C functions or cast() their uses. But this means there are more
# `Any`s floating around. So the more restrictive any checks we'd like to use
# should only be turned on outside of `bindings`.
[[tool.mypy.overrides]]
module = [
"nacl.bindings.*",
]
disallow_any_expr = false
warn_return_any = false
# Loosen some of the checks within the tests. Note that `tests.utils` passes with the
# strict checks on, but it's included here in the list of modules with looser checks
# to keep mypy's config simple(r).
[[tool.mypy.overrides]]
module = [
"tests.*",
]
# Some library helpers types' involve `Any`, in particular `pytest.mark.parameterize`
# and `hypothesis.strategies.sampledfrom`.
disallow_any_expr = false
disallow_any_decorated = false
# It's not useful to annotate each test function as `-> None`.
disallow_untyped_defs = false
disallow_incomplete_defs = false
[tool.coverage.run]
branch = true
relative_files = true
source = ["nacl", "tests/"]
[tool.coverage.paths]
source = [
"src/nacl",
"*.nox/*/lib*/python*/site-packages/nacl",
"*.nox/*/lib*/pypy*/site-packages/nacl",
"*.nox\\*\\Lib\\site-packages\\nacl",
]
tests = ["tests/", "*tests\\"]
[tool.coverage.report]
exclude_also = [
"@abc.abstractmethod",
"@typing.overload",
"if typing.TYPE_CHECKING",
]
[tool.coverage.html]
show_contexts = true
[tool.pytest.ini_options]
addopts = "-r s --capture=no"
console_output_style = "progress-even-when-capture-no"