Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/maturin/
Date: Wed, 01 Dec 2021 04:01:26
Message-Id: 1638329824.a65360b017eb01f6c6214db833a9b54a3f30bb09.ionen@gentoo
1 commit: a65360b017eb01f6c6214db833a9b54a3f30bb09
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 29 16:53:03 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 1 03:37:04 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a65360b0
7
8 dev-util/maturin: revamp ebuild
9
10 * use distutils-r1 for a proper installation
11 * add IUSE=doc to build docs rather than install the barely
12 readable .md source files (only available in >=1.12.0)
13 * remove network requirement for tests and lift restriction
14 * respect PYTHON_COMPAT when running tests rather than test
15 all auto-detected installed versions
16 * update HOMEPAGE which uses the new >=1.12.0 guide
17
18 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
19
20 dev-util/maturin/maturin-0.11.5-r1.ebuild | 311 +++++++++++++++++++++++++++
21 dev-util/maturin/maturin-0.12.3-r1.ebuild | 346 ++++++++++++++++++++++++++++++
22 2 files changed, 657 insertions(+)
23
24 diff --git a/dev-util/maturin/maturin-0.11.5-r1.ebuild b/dev-util/maturin/maturin-0.11.5-r1.ebuild
25 new file mode 100644
26 index 000000000000..b2457d9b7798
27 --- /dev/null
28 +++ b/dev-util/maturin/maturin-0.11.5-r1.ebuild
29 @@ -0,0 +1,311 @@
30 +# Copyright 1999-2021 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=8
34 +
35 +CRATES="
36 + addr2line-0.16.0
37 + adler-1.0.2
38 + aes-0.6.0
39 + aes-soft-0.6.4
40 + aesni-0.10.0
41 + aho-corasick-0.7.18
42 + ansi_term-0.11.0
43 + anyhow-1.0.44
44 + atty-0.2.14
45 + autocfg-1.0.1
46 + backtrace-0.3.61
47 + base64-0.10.1
48 + base64-0.13.0
49 + bitflags-1.3.2
50 + block-buffer-0.9.0
51 + block-modes-0.7.0
52 + block-padding-0.2.1
53 + bumpalo-3.7.1
54 + byteorder-1.4.3
55 + bytes-1.1.0
56 + bytesize-1.1.0
57 + bzip2-0.4.3
58 + bzip2-sys-0.1.11+1.0.8
59 + camino-1.0.5
60 + cargo-platform-0.1.2
61 + cargo_metadata-0.14.0
62 + cbindgen-0.20.0
63 + cc-1.0.71
64 + cfg-if-1.0.0
65 + charset-0.1.2
66 + cipher-0.2.5
67 + clap-2.33.3
68 + configparser-2.1.0
69 + core-foundation-0.7.0
70 + core-foundation-sys-0.7.0
71 + cpufeatures-0.2.1
72 + crc32fast-1.2.1
73 + crypto-mac-0.10.1
74 + dbus-0.2.3
75 + digest-0.9.0
76 + dirs-4.0.0
77 + dirs-sys-0.3.6
78 + encoding_rs-0.8.28
79 + env_logger-0.7.1
80 + fat-macho-0.4.4
81 + filetime-0.2.15
82 + flate2-1.0.22
83 + fnv-1.0.7
84 + form_urlencoded-1.0.1
85 + fs-err-2.6.0
86 + futures-channel-0.3.17
87 + futures-core-0.3.17
88 + futures-io-0.3.17
89 + futures-macro-0.3.17
90 + futures-sink-0.3.17
91 + futures-task-0.3.17
92 + futures-util-0.3.17
93 + generic-array-0.14.4
94 + getrandom-0.1.16
95 + getrandom-0.2.3
96 + gimli-0.25.0
97 + glob-0.3.0
98 + goblin-0.4.3
99 + h2-0.3.6
100 + hashbrown-0.11.2
101 + heck-0.3.3
102 + hermit-abi-0.1.19
103 + hkdf-0.10.0
104 + hmac-0.10.1
105 + http-0.2.5
106 + http-body-0.4.3
107 + httparse-1.5.1
108 + httpdate-1.0.1
109 + human-panic-1.0.3
110 + humantime-1.3.0
111 + hyper-0.14.13
112 + hyper-rustls-0.22.1
113 + idna-0.2.3
114 + indexmap-1.7.0
115 + indoc-1.0.3
116 + ipnet-2.3.1
117 + itoa-0.4.8
118 + js-sys-0.3.55
119 + keyring-0.10.1
120 + lazy_static-1.4.0
121 + libc-0.2.103
122 + log-0.4.14
123 + mailparse-0.13.6
124 + matches-0.1.9
125 + memchr-2.4.1
126 + mime-0.3.16
127 + mime_guess-2.0.3
128 + miniz_oxide-0.4.4
129 + mio-0.7.13
130 + miow-0.3.7
131 + ntapi-0.3.6
132 + num-0.3.1
133 + num-bigint-0.3.3
134 + num-complex-0.3.1
135 + num-integer-0.1.44
136 + num-iter-0.1.42
137 + num-rational-0.3.2
138 + num-traits-0.2.14
139 + num_cpus-1.13.0
140 + object-0.26.2
141 + once_cell-1.8.0
142 + opaque-debug-0.3.0
143 + os_type-2.3.0
144 + percent-encoding-2.1.0
145 + pin-project-lite-0.2.7
146 + pin-utils-0.1.0
147 + pkg-config-0.3.20
148 + plain-0.2.3
149 + platform-info-0.1.0
150 + ppv-lite86-0.2.10
151 + pretty_env_logger-0.4.0
152 + proc-macro-error-1.0.4
153 + proc-macro-error-attr-1.0.4
154 + proc-macro-hack-0.5.19
155 + proc-macro-nested-0.1.7
156 + proc-macro2-1.0.30
157 + pyproject-toml-0.2.0
158 + python-pkginfo-0.5.0
159 + quick-error-1.2.3
160 + quote-1.0.10
161 + quoted_printable-0.4.3
162 + rand-0.7.3
163 + rand-0.8.4
164 + rand_chacha-0.2.2
165 + rand_chacha-0.3.1
166 + rand_core-0.5.1
167 + rand_core-0.6.3
168 + rand_hc-0.2.0
169 + rand_hc-0.3.1
170 + redox_syscall-0.2.10
171 + redox_users-0.4.0
172 + regex-1.5.4
173 + regex-syntax-0.6.25
174 + remove_dir_all-0.5.3
175 + reqwest-0.11.5
176 + rfc2047-decoder-0.1.2
177 + ring-0.16.20
178 + rpassword-5.0.1
179 + rustc-demangle-0.1.21
180 + rustls-0.19.1
181 + ryu-1.0.5
182 + same-file-1.0.6
183 + scroll-0.10.2
184 + scroll_derive-0.10.5
185 + sct-0.6.1
186 + secret-service-1.1.3
187 + security-framework-0.4.4
188 + security-framework-sys-0.4.3
189 + semver-1.0.4
190 + serde-1.0.130
191 + serde_derive-1.0.130
192 + serde_json-1.0.68
193 + serde_urlencoded-0.7.0
194 + sha2-0.9.8
195 + shlex-1.1.0
196 + slab-0.4.4
197 + smawk-0.3.1
198 + socket2-0.4.2
199 + spin-0.5.2
200 + strsim-0.8.0
201 + structopt-0.3.23
202 + structopt-derive-0.4.16
203 + subtle-2.4.1
204 + syn-1.0.80
205 + tar-0.4.37
206 + target-lexicon-0.12.2
207 + tempfile-3.2.0
208 + termcolor-1.1.2
209 + textwrap-0.11.0
210 + textwrap-0.14.2
211 + thiserror-1.0.30
212 + thiserror-impl-1.0.30
213 + time-0.1.43
214 + tinyvec-1.5.0
215 + tinyvec_macros-0.1.0
216 + tokio-1.12.0
217 + tokio-rustls-0.22.0
218 + tokio-util-0.6.8
219 + toml-0.5.8
220 + tower-service-0.3.1
221 + tracing-0.1.29
222 + tracing-core-0.1.21
223 + try-lock-0.2.3
224 + typenum-1.14.0
225 + unicase-2.6.0
226 + unicode-bidi-0.3.7
227 + unicode-linebreak-0.1.2
228 + unicode-normalization-0.1.19
229 + unicode-segmentation-1.8.0
230 + unicode-width-0.1.9
231 + unicode-xid-0.2.2
232 + unindent-0.1.7
233 + untrusted-0.7.1
234 + url-2.2.2
235 + uuid-0.8.2
236 + vec_map-0.8.2
237 + version_check-0.9.3
238 + walkdir-2.3.2
239 + want-0.3.0
240 + wasi-0.10.2+wasi-snapshot-preview1
241 + wasi-0.9.0+wasi-snapshot-preview1
242 + wasm-bindgen-0.2.78
243 + wasm-bindgen-backend-0.2.78
244 + wasm-bindgen-futures-0.4.28
245 + wasm-bindgen-macro-0.2.78
246 + wasm-bindgen-macro-support-0.2.78
247 + wasm-bindgen-shared-0.2.78
248 + web-sys-0.3.55
249 + webpki-0.21.4
250 + webpki-roots-0.21.1
251 + winapi-0.3.9
252 + winapi-i686-pc-windows-gnu-0.4.0
253 + winapi-util-0.1.5
254 + winapi-x86_64-pc-windows-gnu-0.4.0
255 + winreg-0.7.0
256 + xattr-0.2.2
257 + zip-0.5.13"
258 +CRATES_TEST="
259 + indoc-0.3.6
260 + indoc-impl-0.3.6
261 + instant-0.1.11
262 + lock_api-0.4.5
263 + parking_lot-0.11.2
264 + parking_lot_core-0.8.5
265 + paste-0.1.18
266 + paste-impl-0.1.18
267 + proc-macro2-1.0.29
268 + pyo3-0.14.5
269 + pyo3-build-config-0.14.5
270 + pyo3-macros-0.14.5
271 + pyo3-macros-backend-0.14.5
272 + scopeguard-1.1.0
273 + smallvec-1.7.0"
274 +PYTHON_COMPAT=( python3_{8..10} )
275 +inherit cargo distutils-r1 flag-o-matic
276 +
277 +DESCRIPTION="Build and publish crates with pyo3, rust-cpython and cffi bindings"
278 +HOMEPAGE="https://maturin.rs/"
279 +SRC_URI="
280 + https://github.com/PyO3/maturin/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
281 + $(cargo_crate_uris)
282 + test? ( $(cargo_crate_uris ${CRATES_TEST}) )"
283 +
284 +LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD ISC MIT MPL-2.0 openssl"
285 +SLOT="0"
286 +KEYWORDS="~amd64 ~arm64 ~x86"
287 +IUSE="test"
288 +RESTRICT="!test? ( test )"
289 +
290 +RDEPEND="dev-python/toml[${PYTHON_USEDEP}]"
291 +BDEPEND="
292 + test? (
293 + dev-python/cffi[${PYTHON_USEDEP}]
294 + dev-python/boltons[${PYTHON_USEDEP}]
295 + dev-python/virtualenv[${PYTHON_USEDEP}]
296 + )"
297 +
298 +QA_FLAGS_IGNORED="usr/bin/${PN}"
299 +
300 +python_prepare_all() {
301 + distutils-r1_python_prepare_all
302 +
303 + # use setup.py only for pure python and handle cargo manually
304 + sed -i 's/cmdclass.*/packages=["'${PN}'"],/' setup.py || die
305 +
306 + if use test; then
307 + # used to prevent use of network during tests
308 + cat > "${T}"/pip.conf <<-EOF || die
309 + [install]
310 + no-index = yes
311 + no-dependencies = yes
312 + EOF
313 +
314 + # run plain 'python' from eclass rather than auto-detect 'python3.x'
315 + sed -i 's/"build",/&"-i","python",/' tests/common/integration.rs || die
316 + fi
317 +}
318 +
319 +python_configure_all() {
320 + filter-flags '-flto*' # undefined references with ring crate
321 +
322 + cargo_src_configure
323 +}
324 +
325 +python_compile_all() {
326 + cargo_src_compile
327 +}
328 +
329 +python_test() {
330 + local -x PIP_CONFIG_FILE=${T}/pip.conf
331 + local -x VIRTUALENV_SYSTEM_SITE_PACKAGES=1
332 +
333 + cargo_src_test -- --skip locked_doesnt_build_without_cargo_lock
334 +}
335 +
336 +python_install_all() {
337 + cargo_src_install
338 +
339 + dodoc Changelog.md Readme.md
340 +}
341
342 diff --git a/dev-util/maturin/maturin-0.12.3-r1.ebuild b/dev-util/maturin/maturin-0.12.3-r1.ebuild
343 new file mode 100644
344 index 000000000000..bbced0e389c3
345 --- /dev/null
346 +++ b/dev-util/maturin/maturin-0.12.3-r1.ebuild
347 @@ -0,0 +1,346 @@
348 +# Copyright 1999-2021 Gentoo Authors
349 +# Distributed under the terms of the GNU General Public License v2
350 +
351 +EAPI=8
352 +
353 +CRATES="
354 + addr2line-0.17.0
355 + adler-1.0.2
356 + aes-0.6.0
357 + aes-soft-0.6.4
358 + aesni-0.10.0
359 + aho-corasick-0.7.18
360 + ansi_term-0.11.0
361 + anyhow-1.0.50
362 + async-io-1.6.0
363 + atty-0.2.14
364 + autocfg-1.0.1
365 + backtrace-0.3.63
366 + base64-0.13.0
367 + bitflags-1.3.2
368 + block-buffer-0.9.0
369 + block-modes-0.7.0
370 + block-padding-0.2.1
371 + bstr-0.2.17
372 + bumpalo-3.8.0
373 + byteorder-1.4.3
374 + bytes-1.1.0
375 + bytesize-1.1.0
376 + bzip2-0.4.3
377 + bzip2-sys-0.1.11+1.0.8
378 + cache-padded-1.1.1
379 + camino-1.0.5
380 + cargo-platform-0.1.2
381 + cargo_metadata-0.14.1
382 + cbindgen-0.20.0
383 + cc-1.0.72
384 + cfg-if-0.1.10
385 + cfg-if-1.0.0
386 + charset-0.1.3
387 + cipher-0.2.5
388 + clap-2.33.3
389 + concurrent-queue-1.2.2
390 + configparser-3.0.0
391 + console-0.15.0
392 + core-foundation-0.9.2
393 + core-foundation-sys-0.8.3
394 + cpufeatures-0.2.1
395 + crc32fast-1.2.2
396 + crossbeam-utils-0.8.5
397 + crypto-mac-0.10.1
398 + derivative-2.2.0
399 + dialoguer-0.9.0
400 + digest-0.9.0
401 + dirs-4.0.0
402 + dirs-sys-0.3.6
403 + encode_unicode-0.3.6
404 + encoding_rs-0.8.29
405 + enumflags2-0.6.4
406 + enumflags2_derive-0.6.4
407 + env_logger-0.7.1
408 + fastrand-1.5.0
409 + fat-macho-0.4.4
410 + filetime-0.2.15
411 + flate2-1.0.22
412 + fnv-1.0.7
413 + form_urlencoded-1.0.1
414 + fs-err-2.6.0
415 + futures-0.3.18
416 + futures-channel-0.3.18
417 + futures-core-0.3.18
418 + futures-executor-0.3.18
419 + futures-io-0.3.18
420 + futures-lite-1.12.0
421 + futures-macro-0.3.18
422 + futures-sink-0.3.18
423 + futures-task-0.3.18
424 + futures-util-0.3.18
425 + generic-array-0.14.4
426 + getrandom-0.2.3
427 + gimli-0.26.1
428 + glob-0.3.0
429 + globset-0.4.8
430 + goblin-0.4.3
431 + h2-0.3.7
432 + hashbrown-0.11.2
433 + heck-0.3.3
434 + hermit-abi-0.1.19
435 + hkdf-0.10.0
436 + hmac-0.10.1
437 + http-0.2.5
438 + http-body-0.4.4
439 + httparse-1.5.1
440 + httpdate-1.0.2
441 + human-panic-1.0.3
442 + humantime-1.3.0
443 + hyper-0.14.15
444 + hyper-rustls-0.22.1
445 + idna-0.2.3
446 + ignore-0.4.18
447 + indexmap-1.7.0
448 + indoc-1.0.3
449 + instant-0.1.12
450 + ipnet-2.3.1
451 + itoa-0.4.8
452 + js-sys-0.3.55
453 + keyring-0.10.4
454 + lazy_static-1.4.0
455 + libc-0.2.108
456 + log-0.4.14
457 + mailparse-0.13.6
458 + matches-0.1.9
459 + memchr-2.4.1
460 + mime-0.3.16
461 + mime_guess-2.0.3
462 + minijinja-0.8.2
463 + miniz_oxide-0.4.4
464 + mio-0.7.14
465 + miow-0.3.7
466 + nb-connect-1.2.0
467 + nix-0.17.0
468 + ntapi-0.3.6
469 + num-0.3.1
470 + num-bigint-0.3.3
471 + num-complex-0.3.1
472 + num-integer-0.1.44
473 + num-iter-0.1.42
474 + num-rational-0.3.2
475 + num-traits-0.2.14
476 + num_cpus-1.13.0
477 + object-0.27.1
478 + once_cell-1.8.0
479 + opaque-debug-0.3.0
480 + os_type-2.3.0
481 + parking-2.0.0
482 + percent-encoding-2.1.0
483 + pin-project-lite-0.2.7
484 + pin-utils-0.1.0
485 + pkg-config-0.3.22
486 + plain-0.2.3
487 + platform-info-0.2.0
488 + polling-2.2.0
489 + ppv-lite86-0.2.15
490 + pretty_env_logger-0.4.0
491 + proc-macro-crate-0.1.5
492 + proc-macro-crate-1.1.0
493 + proc-macro-error-1.0.4
494 + proc-macro-error-attr-1.0.4
495 + proc-macro2-1.0.32
496 + pyproject-toml-0.3.1
497 + python-pkginfo-0.5.0
498 + quick-error-1.2.3
499 + quote-1.0.10
500 + quoted_printable-0.4.5
501 + rand-0.8.4
502 + rand_chacha-0.3.1
503 + rand_core-0.6.3
504 + rand_hc-0.3.1
505 + redox_syscall-0.2.10
506 + redox_users-0.4.0
507 + regex-1.5.4
508 + regex-syntax-0.6.25
509 + remove_dir_all-0.5.3
510 + reqwest-0.11.6
511 + rfc2047-decoder-0.1.2
512 + ring-0.16.20
513 + rpassword-5.0.1
514 + rustc-demangle-0.1.21
515 + rustls-0.19.1
516 + ryu-1.0.6
517 + same-file-1.0.6
518 + scoped-tls-1.0.0
519 + scroll-0.10.2
520 + scroll_derive-0.10.5
521 + sct-0.6.1
522 + secret-service-2.0.1
523 + security-framework-2.4.2
524 + security-framework-sys-2.4.2
525 + semver-1.0.4
526 + serde-1.0.130
527 + serde_derive-1.0.130
528 + serde_json-1.0.72
529 + serde_repr-0.1.7
530 + serde_urlencoded-0.7.0
531 + sha2-0.9.8
532 + shlex-1.1.0
533 + slab-0.4.5
534 + smawk-0.3.1
535 + socket2-0.4.2
536 + spin-0.5.2
537 + static_assertions-1.1.0
538 + strsim-0.8.0
539 + structopt-0.3.25
540 + structopt-derive-0.4.18
541 + subtle-2.4.1
542 + syn-1.0.82
543 + tar-0.4.37
544 + target-lexicon-0.12.2
545 + tempfile-3.2.0
546 + termcolor-1.1.2
547 + terminal_size-0.1.17
548 + textwrap-0.11.0
549 + textwrap-0.14.2
550 + thiserror-1.0.30
551 + thiserror-impl-1.0.30
552 + thread_local-1.1.3
553 + time-0.1.43
554 + tinyvec-1.5.1
555 + tinyvec_macros-0.1.0
556 + tokio-1.14.0
557 + tokio-rustls-0.22.0
558 + tokio-util-0.6.9
559 + toml-0.5.8
560 + tower-service-0.3.1
561 + tracing-0.1.29
562 + tracing-core-0.1.21
563 + try-lock-0.2.3
564 + typenum-1.14.0
565 + unicase-2.6.0
566 + unicode-bidi-0.3.7
567 + unicode-linebreak-0.1.2
568 + unicode-normalization-0.1.19
569 + unicode-segmentation-1.8.0
570 + unicode-width-0.1.9
571 + unicode-xid-0.2.2
572 + unindent-0.1.7
573 + untrusted-0.7.1
574 + url-2.2.2
575 + uuid-0.8.2
576 + vec_map-0.8.2
577 + version_check-0.9.3
578 + void-1.0.2
579 + waker-fn-1.1.0
580 + walkdir-2.3.2
581 + want-0.3.0
582 + wasi-0.10.2+wasi-snapshot-preview1
583 + wasm-bindgen-0.2.78
584 + wasm-bindgen-backend-0.2.78
585 + wasm-bindgen-futures-0.4.28
586 + wasm-bindgen-macro-0.2.78
587 + wasm-bindgen-macro-support-0.2.78
588 + wasm-bindgen-shared-0.2.78
589 + web-sys-0.3.55
590 + webpki-0.21.4
591 + webpki-roots-0.21.1
592 + wepoll-ffi-0.1.2
593 + winapi-0.3.9
594 + winapi-i686-pc-windows-gnu-0.4.0
595 + winapi-util-0.1.5
596 + winapi-x86_64-pc-windows-gnu-0.4.0
597 + winreg-0.7.0
598 + xattr-0.2.2
599 + zbus-1.9.1
600 + zbus_macros-1.9.1
601 + zeroize-1.4.3
602 + zip-0.5.13
603 + zvariant-2.10.0
604 + zvariant_derive-2.10.0"
605 +CRATES_TEST="
606 + indoc-0.3.6
607 + indoc-impl-0.3.6
608 + libc-0.2.107
609 + lock_api-0.4.5
610 + parking_lot-0.11.2
611 + parking_lot_core-0.8.5
612 + paste-0.1.18
613 + paste-impl-0.1.18
614 + proc-macro-hack-0.5.19
615 + pyo3-0.15.1
616 + pyo3-build-config-0.15.1
617 + pyo3-macros-0.15.1
618 + pyo3-macros-backend-0.15.1
619 + scopeguard-1.1.0
620 + smallvec-1.7.0
621 + syn-1.0.81"
622 +PYTHON_COMPAT=( python3_{8..10} )
623 +inherit cargo distutils-r1 flag-o-matic
624 +
625 +DESCRIPTION="Build and publish crates with pyo3, rust-cpython and cffi bindings"
626 +HOMEPAGE="https://maturin.rs/"
627 +SRC_URI="
628 + https://github.com/PyO3/maturin/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
629 + $(cargo_crate_uris)
630 + test? ( $(cargo_crate_uris ${CRATES_TEST}) )"
631 +
632 +LICENSE="
633 + 0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD ISC MIT MPL-2.0 openssl
634 + doc? ( CC-BY-4.0 OFL-1.1 )"
635 +SLOT="0"
636 +KEYWORDS="~amd64 ~arm64 ~x86"
637 +IUSE="doc test"
638 +RESTRICT="!test? ( test )"
639 +
640 +RDEPEND="dev-python/toml[${PYTHON_USEDEP}]"
641 +BDEPEND="
642 + doc? ( app-text/mdbook )
643 + test? (
644 + dev-python/cffi[${PYTHON_USEDEP}]
645 + dev-python/boltons[${PYTHON_USEDEP}]
646 + dev-python/virtualenv[${PYTHON_USEDEP}]
647 + )"
648 +
649 +QA_FLAGS_IGNORED="usr/bin/${PN}"
650 +
651 +python_prepare_all() {
652 + distutils-r1_python_prepare_all
653 +
654 + # use setup.py only for pure python and handle cargo manually
655 + sed -i 's/cmdclass.*/packages=["'${PN}'"],/' setup.py || die
656 +
657 + if use test; then
658 + # used to prevent use of network during tests
659 + cat > "${T}"/pip.conf <<-EOF || die
660 + [install]
661 + no-index = yes
662 + no-dependencies = yes
663 + EOF
664 +
665 + # run plain 'python' from eclass rather than auto-detect 'python3.x'
666 + sed -i 's/"build",/&"-i","python",/' tests/common/integration.rs || die
667 + fi
668 +}
669 +
670 +python_configure_all() {
671 + filter-flags '-flto*' # undefined references with ring crate
672 +
673 + cargo_src_configure
674 +}
675 +
676 +python_compile_all() {
677 + cargo_src_compile
678 +
679 + use !doc || mdbook build -d html guide || die
680 +}
681 +
682 +python_test() {
683 + local -x PIP_CONFIG_FILE=${T}/pip.conf
684 + local -x VIRTUALENV_SYSTEM_SITE_PACKAGES=1
685 +
686 + cargo_src_test -- --skip locked_doesnt_build_without_cargo_lock
687 +}
688 +
689 +python_install_all() {
690 + cargo_src_install
691 +
692 + dodoc -r Changelog.md Readme.md $(usev doc guide/html)
693 +}