-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathpyproject.toml
More file actions
294 lines (256 loc) · 10.4 KB
/
Copy pathpyproject.toml
File metadata and controls
294 lines (256 loc) · 10.4 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
[build-system]
requires = [
# NOTE: The following build dependencies are necessary for initial
# NOTE: provisioning of the in-tree build backend located under
# NOTE: `packaging/pep517_backend/`.
# Essentials
"expandvars", # needed by in-tree build backend for env vars interpolation
"setuptools>=45", # needed by in-tree build backend `packaging/pep517_backend.py`
"tomli; python_version < '3.11'", # needed by in-tree build backend `packaging/pep517_backend.py`
# Plugins
"setuptools-scm >= 7.0.0",
]
backend-path = ["packaging"] # requires 'Pip>=20' or 'pep517>=0.6.0'
build-backend = "pep517_backend.hooks"
[tool.local.cython]
# This attr can contain multiple globs
src = ["src/**/*.pyx"]
[tool.local.cython.env]
# Env vars provisioned during cythonize call
#ANSIBLE_PYLIBSSH_CYTHON_TRACING = "1"
#CFLAGS = "-DCYTHON_TRACE=1 ${CFLAGS}"
LDFLAGS = "-lssh ${LDFLAGS}"
[tool.local.cython.flags]
# This section can contain the following booleans:
# * annotate — generate annotated HTML page for source files
# * build — build extension modules using distutils
# * inplace — build extension modules in place using distutils (implies -b)
# * force — force recompilation
# * quiet — be less verbose during compilation
# * lenient — increase Python compat by ignoring some compile time errors
# * keep-going — compile as much as possible, ignore compilation failures
annotate = false
build = false
inplace = true
force = true
quiet = false
lenient = false
keep-going = false
[tool.local.cython.kwargs]
# This section can contain args that have values:
# * exclude=PATTERN exclude certain file patterns from the compilation
# * parallel=N run builds in N parallel jobs (default: calculated per system)
# exclude = "**.py"
[tool.local.cython.kwargs.directive]
# This section can contain compiler directives
# Ref: https://github.com/cython/cython/blob/d6e6de9/Cython/Compiler/Options.py#L170-L242
embedsignature = "True"
emit_code_comments = "True"
linetrace = "True"
profile = "True"
[tool.local.cython.kwargs.compile-time-env]
# This section can contain compile time env vars
[tool.local.cython.kwargs.option]
# This section can contain cythonize options
# Ref: https://github.com/cython/cython/blob/d6e6de9/Cython/Compiler/Options.py#L694-L730
#docstrings = "True"
#embed_pos_in_docstring = "True"
#warning_errors = "True"
#error_on_unknown_names = "True"
#error_on_uninitialized = "True"
[tool.local.cythonize]
# This attr can contain multiple globs
src = ["src/**/*.pyx"]
[tool.local.cythonize.env]
# Env vars provisioned during cythonize call
#ANSIBLE_PYLIBSSH_CYTHON_TRACING = "1"
#CFLAGS = "-DCYTHON_TRACE=1 ${CFLAGS}"
LDFLAGS = "-lssh ${LDFLAGS}"
[tool.local.cythonize.flags]
# This section can contain the following booleans:
# * annotate — generate annotated HTML page for source files
# * build — build extension modules using distutils
# * inplace — build extension modules in place using distutils (implies -b)
# * force — force recompilation
# * quiet — be less verbose during compilation
# * lenient — increase Python compat by ignoring some compile time errors
# * keep-going — compile as much as possible, ignore compilation failures
annotate = false
build = false
inplace = true
force = true
quiet = false
lenient = false
keep-going = false
[tool.local.cythonize.kwargs]
# This section can contain args that have values:
# * exclude=PATTERN exclude certain file patterns from the compilation
# * parallel=N run builds in N parallel jobs (default: calculated per system)
# exclude = "**.py"
#
# NOTE: Setting parallelism to 1 works around a bug in the ``cythonize``
# NOTE: script that hangs on macOS under Python 3.8+ due to the use of
# NOTE: the ``spawn`` method in ``multiprocessing``. This patch can be
# NOTE: reverted once the fix PR is usable upstream.
# Ref: https://github.com/cython/cython/pull/7183
parallel = 1
[tool.local.cythonize.kwargs.directive]
# This section can contain compiler directives
# Ref: https://github.com/cython/cython/blob/d6e6de9/Cython/Compiler/Options.py#L170-L242
embedsignature = "True"
emit_code_comments = "True"
linetrace = "True"
profile = "True"
[tool.local.cythonize.kwargs.compile-time-env]
# This section can contain compile time env vars
[tool.local.cythonize.kwargs.option]
# This section can contain cythonize options
# Ref: https://github.com/cython/cython/blob/d6e6de9/Cython/Compiler/Options.py#L694-L730
#docstrings = "True"
#embed_pos_in_docstring = "True"
#warning_errors = "True"
#error_on_unknown_names = "True"
#error_on_uninitialized = "True"
[tool.towncrier]
# ATTENTION: Do not specify "package" setting because towncrier
# ATTENTION: tries to import it and fails if it's not pre-compiled
directory = "docs/changelog-fragments"
filename = "CHANGELOG.rst"
issue_format = "{issue}"
package_dir = "src"
template = "docs/changelog-fragments/template.j2"
title_format = "v{version}"
# NOTE: The types are declared because:
# NOTE: - there is no mechanism to override just the value of
# NOTE: `tool.towncrier.type.misc.showcontent`;
# NOTE: - and, we want to declare extra non-default types for
# NOTE: clarity and flexibility.
[[tool.towncrier.section]]
path = ""
[[tool.towncrier.type]]
# Something we deemed an improper undesired behavior that got corrected
# in the release to match pre-agreed expectations.
directory = "bugfix"
name = "Bug fixes"
showcontent = true
[[tool.towncrier.type]]
# New behaviors, public APIs. That sort of stuff.
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
# Declarations of future API removals and breaking changes in behavior.
directory = "deprecation"
name = "Deprecations (removal in next major release)"
showcontent = true
[[tool.towncrier.type]]
# When something public gets removed in a breaking way. Could be
# deprecated in an earlier release.
directory = "breaking"
name = "Removals and backward incompatible breaking changes"
showcontent = true
[[tool.towncrier.type]]
# Notable updates to the documentation structure or build process.
directory = "doc"
name = "Improved documentation"
showcontent = true
[[tool.towncrier.type]]
# Notes for downstreams about unobvious side effects and tooling. Changes
# in the test invocation considerations and runtime assumptions.
directory = "packaging"
name = "Packaging updates and notes for downstreams"
showcontent = true
[[tool.towncrier.type]]
# Stuff that affects the contributor experience. e.g. Running tests,
# building the docs, setting up the development environment.
directory = "contrib"
name = "Contributor-facing changes"
showcontent = true
[[tool.towncrier.type]]
# Changes that are hard to assign to any of the above categories.
directory = "misc"
name = "Miscellaneous internal changes"
showcontent = true
[tool.cibuildwheel]
build-frontend = "build"
# container-engine = "podman" # FIXME?
test-requires = "pytest pytest-cov pytest-xdist"
test-command = "python -Im pytest -m smoke --no-cov {project}/tests"
skip = [
"*t-*", # FIXME: Add support for free-threading / see issue #822
]
[tool.cibuildwheel.environment]
COLOR = "yes"
FORCE_COLOR = "1"
MYPY_FORCE_COLOR = "1"
# PIP_CONSTRAINT = "{package}/requirements-build.txt"
# PIP_CONSTRAINT = "{project}/requirements-build.txt"
PIP_CONSTRAINT = "requirements-build.txt"
PIP_DISABLE_PIP_VERSION_CHECK = "1"
PIP_NO_PYTHON_VERSION_WARNING = "1"
PIP_NO_WARN_SCRIPT_LOCATION = "1"
PRE_COMMIT_COLOR = "always"
PY_COLORS = "1"
[tool.cibuildwheel.linux]
manylinux-aarch64-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_aarch64:libssh-v0.12.0"
manylinux-armv7l-image = "ghcr.io/ansible/pylibssh-manylinux_2_31_armv7l:libssh-v0.12.0"
manylinux-ppc64le-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_ppc64le:libssh-v0.12.0"
manylinux-s390x-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_s390x:libssh-v0.12.0"
manylinux-x86_64-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_x86_64:libssh-v0.12.0"
skip = [
"*-musllinux_*", # FIXME: musllinux needs us to provide with containers pre-built libssh
# The support for 32-bit wheels has been dropped long ago:
"*-manylinux_i686",
"*-musllinux_i686",
"*-*_riscv64", # FIXME: RISC-V requires us to provide a build container
"*t-*", # FIXME: Add support for free-threading / see issue #822
]
[tool.cibuildwheel.linux.environment]
STATIC_DEPS_DIR = "$(cat /root/.static-deps-path)"
# LDFLAGS = "'-L${STATIC_DEPS_PREFIX}/lib64' '-L${STATIC_DEPS_PREFIX}/lib'"
# LD_LIBRARY_PATH = "${STATIC_DEPS_PREFIX}/lib64:${STATIC_DEPS_PREFIX}/lib:${LD_LIBRARY_PATH}"
CFLAGS="'-I$(cat /root/.static-deps-path)/include'"
LDFLAGS = "'-L$(cat /root/.static-deps-path)/lib64' '-L$(cat /root/.static-deps-path)/lib'"
LD_LIBRARY_PATH = "$(cat /root/.static-deps-path)/lib64:$(cat /root/.static-deps-path)/lib:${LD_LIBRARY_PATH}"
[tool.cibuildwheel.macos]
before-build = [
"brew install libssh", # @0.9.4 # pinning the version does not work
# FIXME: can we pre-build libssh once in a pre-requisite job?
# NOTE: Currently we use a brew-installed libssh build that also
# NOTE: pulls-in openssl@1.1 as well. In the future we may want to
# NOTE: be in control of what and how we build. This is what the
# NOTE: commented out code below is for. Doing own builds may help
# NOTE: us produce a smaller footprint by not building the server-
# NOTE: side APIs. Controlling the supply chain is also safer from
# NOTE: the security perspective. Also, it breaks when brew replaces
# NOTE: the versions.
# - name: Fetch libssh src
# env:
# LIBSSH_VERSION: 0.9.3
# run: >-
# git clone --depth=1
# -b "libssh-${{ env.LIBSSH_VERSION }}"
# https://git.libssh.org/projects/libssh.git
# - name: Make libssh build dir
# run: mkdir -pv build
# working_directory: libssh
# - name: Build libssh
# env:
# CFLAGS: -I/usr/local/opt/openssl/include
# LDFLAGS: -L/usr/local/opt/openssl/lib
# run: |
# cmake ..
# make
# make install/strip
# working_directory: libssh/build
]
[tool.cibuildwheel.macos.environment]
# delocate (bundled with cibuildwheel v3) enforces that the wheel's
# deployment target matches the bundled dylibs. The brew-installed
# openssl@3 bottle on macos-15-intel targets macOS 15.0.
# FIXME: eventually, we may want to lower the target: see PR #795 and others
MACOSX_DEPLOYMENT_TARGET = "15.0"
[tool.cibuildwheel.windows]
skip = "*"
[tool.setuptools_scm]
write_to = "src/pylibsshext/_scm_version.py"