Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
212 lines (176 loc) · 5.17 KB
/
Copy pathpyproject.toml
File metadata and controls
212 lines (176 loc) · 5.17 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
# SPDX-License-Identifier: MIT
[project]
name = "dave.py"
version = "1.0.0"
description = "Python bindings for libdave, Discord's audio & video end-to-end encryption"
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
authors = [{ name = "Disnake Development" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python :: 3.15",
"Topic :: Internet",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed",
]
[project.urls]
Repository = "https://github.com/DisnakeDev/dave.py"
Changelog = "https://github.com/DisnakeDev/dave.py/blob/main/docs/CHANGELOG.md"
[dependency-groups]
dev = [
{ include-group = "build" },
{ include-group = "nox" },
{ include-group = "tools" },
{ include-group = "typing" },
]
# note: these should match `build-system.requires`
build = [
"nanobind~=2.14.0",
"scikit-build-core>=1.0.0"
]
nox = [
"nox==2025.5.1",
]
test = [
"pytest~=8.0",
]
tools = [
"poethepoet>=0.30.0",
"prek~=0.2.1",
"ruff==0.13.0",
]
typing = [
"pyright==1.1.405",
]
[build-system]
requires = ["nanobind~=2.14.0", "scikit-build-core>=1.0.0"]
build-backend = "scikit_build_core.build"
[tool.poe.tasks]
lint = { cmd = "nox -Rs lint --", help = "Check all files for linting errors" }
pyright = { cmd = "nox -Rs pyright --", help = "Run pyright" }
[tool.pyright]
typeCheckingMode = "strict"
include = [
"scripts/",
"src/",
"tests/",
"*.py",
]
[tool.ruff]
line-length = 100
extend-exclude = [
"libdave/",
"src/**/*.pyi",
]
[tool.ruff.lint]
future-annotations = true
select = ["ALL"]
unfixable = ["ERA001"]
ignore = [
# flake8-commas
"COM812", # mostly managed by the formatter
# flake8-todos
"TD", # similar to flake8-fixme, though they may conflict
# pydocstyle
"D",
# flake8-errmsg
"EM",
# flake8-no-pep420
"INP",
# tryceratops
"TRY003", # long error messages
#
"ERA",
"PLR2004",
"TC001", "TC002", "TC003"
]
[tool.ruff.lint.per-file-ignores]
"scripts/**.py" = ["S101", "T201"]
"tests/**.py" = ["S101"] # allow asserts in tests
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--strict-markers -Werror"
xfail_strict = true
[tool.uv]
cache-keys = [
{ file = "pyproject.toml" },
{ file = "src/**/*.{h,c,hpp,cpp}" },
{ file = "CMakeLists.txt" },
]
[tool.scikit-build]
minimum-version = "build-system.requires"
# Setuptools-style build caching in a local directory
build-dir = "build/{wheel_tag}"
sdist.exclude = ["libdave/cpp/vcpkg"]
wheel.packages = ["src/dave"]
cmake.build-type = "Release"
cmake.define = { BUILD_SHARED_LIBS = "OFF" }
# Default to debug builds in devcontainer (which sets this env variable globally)
[[tool.scikit-build.overrides]]
if.env.BUILD_DEBUG = true
cmake.build-type = "Debug"
[[tool.scikit-build.generate]]
# this will also automatically be added to sdist includes
path = "src/dave/_version.py"
location = "source"
template = '''
__version__ = "${version}"
'''
[tool.cibuildwheel]
skip = [
# 32-bit windows
"*-win32",
# 32-bit linux
"*_armv7l",
# free-threaded python versions
"cp*t-*",
]
build-verbosity = 1
environment-pass = ["CI", "VCPKG_BINARY_SOURCES", "COPY_VCPKG_BINARY_PATH"]
test-command = "pytest {project}/tests"
test-groups = ["test"] # see [dependency-groups]
[tool.cibuildwheel.macos]
before-all = "brew install zip unzip curl pkgconfig nasm go"
[tool.cibuildwheel.linux]
# all of this is configured step by step through the overrides below due to package manager differences.
# manylinux is RHEL-based (i.e. dnf/yum), except armv7l which is Debian-based (i.e. apt-get), musllinux obviously uses apk
before-all = []
# - see https://learn.microsoft.com/en-us/vcpkg/concepts/supported-hosts#dependencies
# - perl-IPC-Cmd + perl-FindBin are needed to build openssl in RHEL
[[tool.cibuildwheel.overrides]]
select = ["*-manylinux_*"]
before-all = [
"dnf install -y git curl zip unzip pkgconfig nasm golang perl-IPC-Cmd ninja-build",
# needed on newer perl streams (currently, only in manylinux_2_39 used by riscv64 image)
"sh -c 'dnf install -y perl-FindBin || true'",
]
[[tool.cibuildwheel.overrides]]
select = ["*-musllinux_*"]
before-all = ["apk add git curl zip unzip pkgconfig nasm go ninja-build ninja-is-really-ninja"]
# this runs last, for all linux builds
[[tool.cibuildwheel.overrides]]
select = ["*-????linux_*"]
inherit.before-all = "append"
before-all = ["./scripts/ci/setup-vcpkg.sh"]
# required to build vcpkg on other platforms
[[tool.cibuildwheel.overrides]]
select = "*linux_{aarch64,ppc64le,s390x,riscv64}"
environment = { VCPKG_FORCE_SYSTEM_BINARIES = "1" }
# Needed for full C++17 support on macOS
[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.14"