Commit Graph

592 Commits

Author SHA1 Message Date
Ashley Anderson 64c09d870c Update changelog. 2022-01-19 21:22:08 -05:00
David Hewitt dc8032a5ff pyfunction: allow required positional after option 2022-01-11 00:44:41 +00:00
David Hewitt de8174684f pyfunction: allow wrap_pyfunction to work on imports (even cross-crate) 2022-01-07 08:43:05 +00:00
David Hewitt 2cee7feaaf
Merge pull request #2083 from aviramha/magic_methods
verify py method args count
2022-01-07 00:13:05 +00:00
David Hewitt be70e5441b
Merge pull request #2085 from davidhewitt/opt-argument-extraction
opt: move fastcall boilerplate out of generated code
2022-01-03 08:13:31 +00:00
Aviram Hassan 50659b6b02
`__ipow__` now supports modulo argument on Python 3.8+.
`pyo3-macros-backend` is now compiled with PyO3 cfgs to enable different magic method definitions based on version.
Add check for correct number of arguments on magic methods.
2022-01-03 09:53:56 +02:00
David Hewitt 1a782ce4db opt: move fastcall boilerplate out of generated code 2022-01-03 00:07:32 +00:00
David Hewitt cf965155f4 pymethods: support buffer protocol 2021-12-30 15:48:55 +00:00
David Hewitt e33b3e6a5b opt: don't emit T::dict_offset and T::weakref_offset without attributes 2021-12-30 14:57:27 +00:00
David Hewitt ff37f24625 macros: accept paths in wrap_x macros 2021-12-30 12:46:57 +00:00
David Hewitt 90479ddae4 opt: make argument extraction code smaller 2021-12-24 01:52:15 +00:00
David Hewitt 33a618914f opt: reduce class creation generated code 2021-12-24 01:12:59 +00:00
David Hewitt 5be5d77589 opt: improve handle_panic generated code 2021-12-24 00:17:04 +00:00
David Hewitt 492b7e4c0f macros: optimize generated code for #[derive(FromPyObject)] 2021-12-22 08:34:05 +00:00
Amanieu d'Antras ed0a6b710a Add changelog entry 2021-12-20 18:34:14 +01:00
Ashley Anderson a6c70164cd Move changelog entry for #1996. 2021-12-16 13:12:03 -05:00
Ashley Anderson c30ca03b60
Expose cross compiling configuration from pyo3-build-config (#1996)
* Initial refactor - expose cross-compiling functions and add necessary fields to InterpreterConfig

* Refactor cross_compiling to take arch/vendor/os separately.

* Address review comments.

* Update changelog with note about pyo3-build-config APIs.

* Fix panic when parsing ABI tag on Windows.

* Update parse_sysconfigdata test to best-guess values for linux.

* Revert added fields in InterpreterConfig.

* Refactor parse_sysconfigdata to return Sysconfigdata (HashMap). Add InterpreterConfig::from_sysconfigdata.

* Update BuildFlags test to use from_sysconfigdata.

* Add tests for from_sysconfigdata. Refactor Sysconfigdata API to be more open.

* Add basic tests for not cross compiling. Add some error handling.

* Address review comments.

* Update search_lib_dir to recurse into lib and pypy dirs.

* Look even harder for sysconfigdata.

* Add skip-build-config feature.

* Revert skip-build-config feature.

* Suppress cargo:rerun-if-env-changed without resolve-config feature.
2021-12-16 00:18:37 +00:00
mejrs bbe478db81 Update changelog 2021-12-14 19:19:31 +01:00
David Hewitt 469d72a001
Merge pull request #2022 from PyO3/pyo3_path
Hygiene: offer a way to set path to pyo3 crate
2021-12-09 20:27:48 +00:00
Juniper Parsons 47cf13239f
Disallow positional args after optional args 2021-12-09 10:01:59 -05:00
Georg Brandl a5b76bc365 pyo3_path, part 4: rename to `crate` to keep consistent with serde 2021-12-09 07:36:48 +01:00
Georg Brandl e4f608f605 pyo3_path, part 2: add pyo3_path options and use them. 2021-12-09 07:24:18 +01:00
David Hewitt 4c8abd1426 rust: support 1.57 2021-12-08 07:10:16 +00:00
David Hewitt b56d492c3b pytype: resurrect (deprecated) PyType::is_instance 2021-11-27 09:05:58 +00:00
David Hewitt 2ac30ec411 err: tweak names, inlining and docs 2021-11-27 08:26:04 +00:00
Gert Hulselmans 5ecc715d10 Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works with PyPy.
Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works
with PyPy. Solves: "undefined symbol: PyObject_HasAttr" when
importing the library.
2021-11-25 19:32:24 +00:00
David Hewitt a0d3ab0de1
Merge pull request #2019 from davidhewitt/inventory-0.2.0
inventory: update to 0.2
2021-11-23 07:39:05 +00:00
Miles Granger c4147cdde4
Add PyCapsule API (#1980)
Co-authored-by: Georg Brandl <georg@python.org>
2021-11-23 06:57:37 +01:00
David Hewitt f17e0d35cd inventory: update to 0.2 2021-11-22 22:57:58 +00:00
David Hewitt e9b46f76da
Merge pull request #1985 from PyO3/is_instance_of
add PyType::is_subclass_of and PyAny::is_instance_of
2021-11-20 14:56:36 +00:00
David Hewitt ded44eebfb
Merge pull request #2006 from davidhewitt/drop-py36
python: drop support for 3.6
2021-11-20 14:04:31 +00:00
Georg Brandl 43893158b1 switch is_instance/is_instance_of, is_subclass/is_subclass_of 2021-11-20 13:18:43 +00:00
Georg Brandl a83c31a3af add PyType::is_subclass_of and PyAny::is_instance_of
which get the type to check against as an arguments,
as opposed to a compile-time generic type.
2021-11-20 13:16:15 +00:00
David Hewitt cc91a7c574
Merge pull request #2007 from davidhewitt/remove-0.14-deprecations
deprecations: remove items deprecated in PyO3 0.14
2021-11-20 13:09:04 +00:00
David Hewitt 70030f130d python: drop support for 3.6 2021-11-20 13:02:42 +00:00
David Hewitt 0dfe6b0274
Merge pull request #2008 from davidhewitt/build-config-no-resolve-default
pyo3-build-config: don't enable resolve-config by default
2021-11-20 12:56:31 +00:00
David Hewitt c9a4cd1f87 deprecations: remove items deprecated in PyO3 0.14 2021-11-19 16:33:29 +00:00
Vincent Michel 91caa814d0 Add `Py::setattr` method 2021-11-19 16:59:54 +01:00
David Hewitt b9cc10f3fb pyo3-build-config: don't enable resolve-config by default 2021-11-19 14:19:24 +00:00
David Hewitt 6a65f98bd2 msrv: bump to 1.48 2021-11-19 10:10:59 +00:00
David Hewitt eb5059acc7 release: 0.15.1 2021-11-18 07:34:22 +00:00
David Hewitt 26ccc1ab37 macros: fix panic in __get__ implementation 2021-11-15 16:02:59 +00:00
David Hewitt 1df68e852e allow_threads: switch from `catch_unwind` to guard pattern 2021-11-15 12:25:53 +00:00
David Hewitt 8e41483bad
Merge pull request #1991 from messense/pypy-abi3
Don't emit `Py_LIMITED_API` cfg for PyPy
2021-11-15 10:13:23 +00:00
David Hewitt 9ae7e31e9c
Merge pull request #1977 from davidhewitt/traceback-type
types: add PyTraceback
2021-11-15 09:04:15 +00:00
messense 73c3911748 Don't emit `Py_LIMITED_API` cfg for PyPy 2021-11-15 15:40:27 +08:00
David Hewitt 88ca6bbbab types: add PyTraceback 2021-11-15 07:25:57 +00:00
messense 2325c283b0 Fix mingw platform detection 2021-11-15 15:15:16 +08:00
Moriyoshi Koizumi ae05020b13 Support Py::as_ref() and Py::into_ref() for PySequence, PyIterator and PyMapping. 2021-11-13 08:23:40 +00:00
David Hewitt 23778f5386 pymethods: test and document opt-out of protos 2021-11-10 23:28:01 +00:00