Commit Graph

771 Commits

Author SHA1 Message Date
mejrs 984fdf57c7 Use Python:;with_gil in tests 2022-07-19 19:34:23 +02:00
David Hewitt d5e99b635d refactor: remove all 0.15 deprecations 2022-07-15 06:33:14 +01:00
David Hewitt 7babd13830 datetime: support timezone bindings 2022-07-13 22:05:17 +01:00
David Hewitt 97ce1f6892 ci: fix nightly UI tests 2022-07-13 08:06:14 +01:00
Ivan Krivosheev 1cd1dbfe8b
Add super object (#2486) 2022-07-03 19:21:15 +01:00
Bruno Kolenbrander 58d4ba833e
Rust 1.62 (#2489)
* Rust 1.62

* Make rust happy

* Just use a doctest instead

Co-authored-by: mejrs <>
2022-07-02 16:08:01 +01:00
David Hewitt 4da9c3a55f llvm-lines: use iterator to collect class items 2022-06-25 22:03:28 +01:00
David Hewitt 62f27caffe ci: fix nightly ui tests 2022-06-25 21:12:14 +01:00
Ashley Anderson bde5102eb8
Increasing test coverage (#2462)
* cov: src/buffer.rs - add tests for debug and element from format

* cov: src/buffer.rs - add some fortran-specific calls in test_array_buffer

* fix issues in MSRV

* cov: src/types/function.rs - directly call PyCFunction::new and PyCFunction::new_with_keywords

* docs: clarify docs of PyCFunction::new and PyCFunction::new_with_keywords

* revert added rust-version for MSRV in Cargo.toml

* cov: src/types/slice.rs - simple tests for PySliceIndices::new

* fix for multi-platform

* Update src/types/function.rs

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

* cov: src/buffer.rs - a better PyBuffer Debug test

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2022-06-23 21:30:22 +01:00
Gabriel Smith 75656949f9 macros: Support #[pyo3(name)] on enum variants 2022-06-22 09:36:40 -04:00
Gabriel Smith 2122faa547 macros: Use macro-defined name for enums in __repr__ 2022-06-21 16:31:23 -04:00
David Hewitt 7725f17c46 pyclass: switch from immutable to frozen 2022-06-19 21:18:15 +01:00
David Hewitt 517f4a87a9
Merge pull request #2450 from mejrs/misc
Fix UB in *_offset functions
2022-06-18 08:53:10 +01:00
David Hewitt f81a01b604 macros: emit pymethod associated methods as a single block 2022-06-16 22:15:29 +01:00
Ivan Krivosheev f19561c745 Allow #[classattr] take Python argument 2022-06-16 13:08:53 +03:00
mejrs 2d3a5852ed Avoid UB in *_offset methods 2022-06-12 15:11:39 +02:00
David Hewitt 7c56a03d64 frompyobject: fix `from_py_with` ignored for transparent structs 2022-06-09 06:49:25 +01:00
Hood Chatham da5b9814cc
Set up CI for wasm32-emscripten target (#2436)
* ci: test on emscripten target

This adds CI to build libpython3.11 for wasm32-emscripten and
running tests against it. We need to patch instant to work
around the emscripten_get_now:
https://github.com/sebcrozet/instant/pull/47

We also have to patch emscripten to work aroung the "undefined
symbol gxx_personality_v0" error:
https://github.com/emscripten-core/emscripten/issues/17128

I set up a nox file to download and install emscripten,
download and build cpython, set appropriate environment variables
then run cargo test. The workflow just installs python, rust,
node, and nox and runs the nox session.

I xfailed all the test failures. There are problems with datetime.
iter_dict_nosegv and test_filenotfounderror should probably be
fixable. The tests that involve threads or asyncio probably can't
be fixed.

* Some cleanup

* Remove instant patch

* Add explanations for xfails
2022-06-08 05:59:18 +01:00
David Hewitt cdf86482d8 ffi: many fixes to pypy definitions 2022-06-04 12:47:40 +01:00
David Hewitt a746411b24
Merge pull request #2422 from davidhewitt/frompyobject-fixes
frompyobject: improve error messages of derived impls
2022-06-02 13:30:03 +01:00
David Hewitt f50406a034
Merge pull request #2413 from davidhewitt/simpler-interned
macros: simpler expansion for `intern!`
2022-06-02 12:54:11 +01:00
David Hewitt 0aa4f95a98 frompyobject: improve error messages of derived impls 2022-06-02 11:13:35 +01:00
David Hewitt 261c0c5f56 macros: simpler expansion for `intern!` 2022-06-02 09:57:58 +01:00
David Hewitt cfb91057af frompyobject: improve error message for tuple case 2022-06-02 08:54:20 +01:00
David Hewitt eafbbc5417
Merge pull request #2399 from davidhewitt/avoid-duplicate-pymethods
pymethods: prevent methods sharing the same name
2022-05-24 22:22:31 +01:00
David Hewitt 879eb14e27
Merge pull request #2395 from davidhewitt/fix-class-raw-ident
macros: fix raw-ident pyclasses having r# at the start of the Python name
2022-05-24 22:08:56 +01:00
David Hewitt 71abeeff8b macros: fix raw-ident pyclasses having r# at the start of the Python name 2022-05-24 21:34:23 +01:00
David Hewitt a306365db8 pymethods: prevent methods sharing the same name 2022-05-24 21:15:30 +01:00
David Hewitt 126bf49b8b
Merge pull request #2377 from herquan/herquan_cr1
Add macro append_to_inittab (issue #2359)
2022-05-24 08:02:47 +01:00
herquan 2ec477344d Add macro append_to_inittab
Sometimes we need to debug in a real environment with our module installed. `append_to_inittab` will be a wrapper for PyImport_AppendInittab (https://docs.python.org/3/c-api/import.html#c.PyImport_AppendInittab) and help us to do this
2022-05-24 07:42:15 +01:00
David Hewitt 0de0e3f8d6 Allow `#[classattr]` methods to be fallible 2022-05-17 21:19:41 +01:00
David Hewitt 8636db67f5 add regression test for PEP 587 2022-05-15 16:08:21 +01:00
Bruno Kolenbrander c57e5098b8
Fix IntoPyCallbackOutput paper cuts (#2326)
* Implement IntoPy for arrays of IntoPy

* Improve `IntoPyCallbackOutput` compile error
2022-05-09 18:15:43 +01:00
Bruno Kolenbrander dce4377eb4
Allow more methods to take interned arguments (#2312)
* Allow more methods to take interned arguments

* Changelog

* Unify name bounds

* Resolve merge conflict

* reduce use of py_decref

* Add some attr tests

* Update migration
2022-05-02 11:13:15 +02:00
David Hewitt 4168feed1b opt: tidy some generic code bloat 2022-04-26 05:36:57 +01:00
cuishuang 19e32a0621 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-04-24 22:06:32 +08:00
David Hewitt 7e2d3117ce cleanup: deprecate PyTypeObject trait 2022-04-23 13:36:32 +01:00
David Hewitt e9bd41efb2 better mutability inheritance rules 2022-04-21 20:51:28 +01:00
mejrs 53a642eda7 Fix ui test 2022-04-12 15:49:23 +02:00
Bruno Kolenbrander bc6bd6099c
Merge branch 'main' into immutable 2022-04-12 14:22:33 +02:00
mejrs b7745dffc8 Fix everything 2022-04-12 14:19:02 +02:00
mejrs 4fc0cdd636 Fix ui test 2022-04-07 23:56:15 +02:00
David Hewitt c16cc35b30 pyclass: mapping flag 2022-04-02 16:15:44 +01:00
mejrs 086424b88c Merge branch 'main' of https://github.com/mejrs/pyo3 into immutable 2022-04-01 23:11:02 +02:00
mejrs 9ab1e6927a Merge branch 'immutable' of https://github.com/mejrs/pyo3 into immutable 2022-04-01 22:59:59 +02:00
Bruno Kolenbrander 43944aef76
Create a better error message for moving self (#2238) 2022-03-24 10:27:37 +01:00
Bruno Kolenbrander fb689340b4
Merge branch 'main' into lint-more 2022-03-23 09:34:31 +01:00
mejrs 6f1cf1b662 Add more lints 2022-03-23 08:07:28 +01:00
David Hewitt 87c79c0319
Merge pull request #2234 from davidhewitt/pyclass-args-refactor
pyclass: unify pyclass with its pyo3 arguments
2022-03-22 11:38:05 +00:00
David Hewitt 5cc3ce99f1 pyclass: unify pyclass with its pyo3 arguments 2022-03-20 08:24:09 +00:00