Commit Graph

3786 Commits

Author SHA1 Message Date
David Hewitt 3663d3f37e
Merge pull request #1525 from davidhewitt/fix-issue-1506
1506: fixes to macro hygiene
2021-03-30 20:55:49 +01:00
David Hewitt bc826d15de
Merge pull request #1530 from davidhewitt/build-error-messages
build: improve error message for multiple sysconfigs found
2021-03-30 08:01:10 +01:00
David Hewitt 2939bf1ed6
Merge pull request #1529 from ravenexp/fix-cargo-target-parsing
Clean up CARGO_CFG_TARGET_FAMILY variable parsing
2021-03-29 22:00:09 +01:00
David Hewitt f97aac64ec
Merge pull request #1531 from davidhewitt/build-rerun-more-vars
build: rerun on a few more env vars changing
2021-03-29 21:39:29 +01:00
Sergey Kvachonok ccaabe3ba5 Apply suggestions from code review: env::var() -> env::var_os()
and fall back to load_cross_compile_from_sysconfigdata() when unset.

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-29 11:46:17 +03:00
David Hewitt a229ae48de build: rerun on a few more env vars changing 2021-03-29 08:46:09 +01:00
David Hewitt f89756238a build: improve error message for multiple sysconfigs found 2021-03-29 08:42:31 +01:00
David Hewitt 2b4239c0e3
Merge pull request #1527 from davidhewitt/fix-badges
readme: tidy badges
2021-03-29 07:57:05 +01:00
David Hewitt 225cc2f009
Merge pull request #1528 from PyO3/davidhewitt-patch-1
changelog: fix code block
2021-03-29 07:56:47 +01:00
Sergey Kvachonok f91f795fc7 Clean up CARGO_CFG_TARGET_FAMILY variable parsing
Match the target OS family strings exactly and provide better error messages
when CARGO_CFG_TARGET_FAMILY is not set (e.g. on wasm32).
2021-03-29 09:00:57 +03:00
Sergey Kvachonok 6d6d030bf7 Remove unused cross-compile environment variables
PYO3_CROSS_VERSION was renamed to PYO3_CROSS_PYTHON_VERSION.

PYO3_CROSS_INCLUDE_DIR was removed in
https://github.com/PyO3/pyo3/pull/1521
2021-03-29 08:48:54 +03:00
David Hewitt 2702c33a61
changelog: fix code block 2021-03-28 22:11:15 +01:00
David Hewitt 955a65532b readme: tidy badges 2021-03-28 21:56:10 +01:00
David Hewitt 8ad3827341
Merge pull request #1514 from jameshilliard/cross-env-detection
Ensure we are cross compiling when any cross env variables are set.
2021-03-28 12:46:59 +01:00
David Hewitt ce851ad7d9 1506: fixes to macro hygiene 2021-03-28 11:01:51 +01:00
Yuji Kanagawa 24b00004c6
Merge pull request #1521 from ravenexp/remove-header-parsing
Remove `pyconfig.h` header parsing
2021-03-28 10:32:23 +09:00
kngwyu eca20fe09a Merge branch 'main' into remove-header-parsing 2021-03-27 22:36:58 +09:00
David Hewitt 3bc5caaa9e
Merge pull request #1523 from kngwyu/refactor-doctest
Refactor doctest
2021-03-27 11:48:50 +00:00
kngwyu 46de29b4d9 Refactor doctest 2021-03-26 22:04:41 +09:00
messense d9fe4ec6cc
Merge pull request #1520 from messense/clippy
Fix clippy warnings in Rust 1.51.0
2021-03-26 16:45:59 +08:00
messense e134769b1b Remove bogus link_name 2021-03-26 16:12:37 +08:00
Sergey Kvachonok 80c747d2c0 Remove `pyconfig.h` header parsing
The config header parsing code was supposed to be only invoked when
cross-compiling for Windows, but in reality it fails to correctly parse
the config header files shipped with the upstream Python for Windows.

Given that there are now better options for reliable cross-compiling
for Windows such as `PYO3_CROSS_PYTHON_VERSION` or the `abi3-py3*` features,
it should be OK to remove this config for v0.14.

Update the cross-compilation instructions section of the user guide.

Fixes https://github.com/PyO3/pyo3/issues/1337
2021-03-26 09:57:18 +03:00
messense 90c5ffbd04 Fix clippy warnings in Rust 1.51.0 2021-03-26 13:21:38 +08:00
David Hewitt c4b7a44622
Merge pull request #1518 from ravenexp/main
Always use correct abi3 Python DLL name for MinGW
2021-03-25 18:17:19 +00:00
Yuji Kanagawa eaf516d19a
Merge pull request #1519 from ravenexp/fix-windows-shared
Always set `Py_SHARED` when building for Windows
2021-03-26 01:39:17 +09:00
Sergey Kvachonok a0d1c5509d Always set `Py_SHARED` when building for Windows
Setting `PYO3_NO_PYTHON` results in an extension module built with
a different config feature set (on Windows).
Specifically, `Py_SHARED` config option gets omitted in this code path.

Maturin always sets `PYO3_NO_PYTHON` when cross-compiling abi3 extensions,
which creates a subtle configuration mismatch between `cargo build`
and `maturin build` artifacts.

Always set `Py_SHARED` when compiling abi3 extensions for Windows.
2021-03-25 11:51:15 +03:00
David Hewitt 93696889d3
Merge pull request #1496 from PyO3/dependabot/cargo/hashbrown-0.11
build(deps): update hashbrown requirement from 0.9 to 0.11
2021-03-25 08:01:31 +00:00
Sergey Kvachonok 2503e61c65 Always use correct abi3 Python DLL name for MinGW
Compiling an abi3 extension module for `x86_64-pc-windows-gnu` target
links to `python3.dll` import library when `PYO3_NO_PYTHON` is set
and to `python3.Y.dll` import library when `PYO3_NO_PYTHON` is not set.

All abi3 extensions should link to `python3.dll` on Windows,
as required by

https://www.python.org/dev/peps/pep-0384/#linkage

Update the code path for the case when `PYO3_NO_PYTHON` is not set
to yield the same Python DLL import library name.
2021-03-25 08:40:36 +03:00
David Hewitt a2788b052d hashbrown: support 0.9 or 0.11 2021-03-24 22:35:37 +00:00
messense ffce9f3505
Merge pull request #1516 from PyO3/davidhewitt-patch-1
build.rs: adjust pypy warning wording
2021-03-24 11:53:40 +08:00
David Hewitt 38c8355f91
build.rs: adjust pypy warning wording 2021-03-23 21:56:22 +00:00
James Hilliard 2c3e8b1c50 Ensure we are cross compiling when any cross env variables are set. 2021-03-23 05:13:52 -06:00
David Hewitt 6e49ba3212
Merge pull request #1512 from PyO3/use-with-gil-in-docs
Revert the accidently changed file mode
2021-03-20 21:21:22 +00:00
David Hewitt 246335bee2
Merge pull request #1505 from scalexm/macro
Ignore `syn::Type::Group` in `is_python`
2021-03-20 11:09:04 +00:00
kngwyu 590836db27 Revert the accidently changed file mode 2021-03-20 19:50:50 +09:00
messense f909e66b92
Merge pull request #1511 from PyO3/use-with-gil-in-docs
Use with_gil instead of acquire_gil in examples
2021-03-20 18:35:54 +08:00
kngwyu aedd6352e3 Use with_gil instead of acquire_gil in examples 2021-03-20 19:02:50 +09:00
David Hewitt 3fa10a38d3
Merge pull request #1510 from kngwyu/doc-examples
Correct `# Examples` in documents
2021-03-20 09:12:01 +00:00
David Hewitt e34e87ad4a 1505: add CHANGELOG and test 2021-03-20 08:36:19 +00:00
kngwyu e31fb70399 Correct `# Examples` in documents 2021-03-20 16:45:56 +09:00
Yuji Kanagawa f0763f069e
Merge pull request #1507 from scalexm/getter-name
Allow `#[name]` with `#[getter]` and `#[setter]`
2021-03-20 16:23:07 +09:00
Yuji Kanagawa acff3b1f3e
Merge pull request #1504 from PyO3/pyclass
Add tuple and unit struct support for pyclass macro
2021-03-20 16:14:15 +09:00
Yuji Kanagawa 873a275ead
Merge pull request #1509 from PyO3/issue-1508
Remove __doc__ from module's __all__
2021-03-20 14:55:29 +09:00
messense acd4601d2f Remove __doc__ from module's __all__ 2021-03-20 11:25:36 +08:00
messense 1c57294214 Use Python::with_gil and py_assert
Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2021-03-19 10:17:06 +08:00
messense 2cec240b0e Ban pyo3(get, set) on tuple struct field 2021-03-19 10:17:06 +08:00
messense 773a371ba5 Add tuple and unit struct support for pyclass macro 2021-03-19 10:17:06 +08:00
scalexm b27ee3fd64 Allow `#[name]` with `#[getter]` and `#[setter]` 2021-03-18 19:35:17 +01:00
scalexm adc6e6fe4e Ignore `syn::Type::Group` in `is_python` 2021-03-18 18:56:53 +01:00
Yuji Kanagawa 20452a7c09
Merge pull request #1471 from kngwyu/architecture
Architecture.md: Initial draft
2021-03-18 17:12:17 +09:00