Commit Graph

154 Commits

Author SHA1 Message Date
messense bd1045e289 Add support for extracting PathBuf from pathlib.Path 2021-06-05 14:59:26 +08:00
David Hewitt 79c7149d52 pyo3-build-config: new crate to re-use build.rs across crates 2021-05-20 09:03:33 +01:00
Georg Brandl 473474cae7 pyo3_benchmarks: add a benchmark for the "only simple args" case
This is the case that will be helped by fastcall support,
so add it first as a baseline.
2021-05-19 08:17:33 +02:00
David Hewitt f1dd1380a5 examples: use pip 21.1 2021-04-29 08:52:01 +01:00
David Hewitt 0ae7b69295
examples: add links to packaging tools
Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2021-04-03 12:50:42 +01:00
David Hewitt 370652eba8 examples: maturin and setuptools_rust examples 2021-04-03 11:59:41 +01:00
David Hewitt fe74160a7d pyo3_benchmarks: benchmarks as separate Python example 2021-03-01 19:12:39 +00:00
David Hewitt 29a525b327 pyfunction: refactor argument extraction 2021-03-01 17:49:46 +00:00
winxton 5498b7ee3c Fix wordcount example docs 2021-02-24 13:41:45 -05:00
David Hewitt b2675b11fe rust 1.50: clippy and lint fixes 2021-02-11 22:03:34 +00:00
David Hewitt 0da12bd0dc ci: deny clippy warnings for examples 2020-12-31 22:11:48 +00:00
David Hewitt 126a74842f rustapi_module: move issue_219 regression test 2020-11-10 14:23:08 +00:00
David Hewitt 33b8aba3bb examples: simplify tox instructions 2020-11-10 12:50:41 +00:00
Yuji Kanagawa 3b3ba4e3ab
Merge pull request #1152 from PyO3/abi3
Complete abi3 support
2020-10-27 23:30:36 +09:00
Arnav Jindal 042337b423
Update lib.rs 2020-10-21 19:37:23 +05:30
Arnav Jindal a3d0c86c1c
Docs: Fixed example word_count 2020-10-21 12:36:36 +05:30
Alex Gaynor 90a825d0c2 Merge branch 'master' into abi3-merge-master 2020-10-19 14:32:49 -04:00
David Hewitt afd9b823d2 Drop support for Python 3.5 2020-10-18 19:02:27 +01:00
Alex Gaynor aabad7cf7f Assorted updates to the abi3 branch from review 2020-10-11 19:51:27 -04:00
Alex Gaynor 140790b15f Merge branch 'master' into abi3-merge-master 2020-10-10 10:11:49 -04:00
kngwyu 2e22066feb Do not test PyPy on Windows 2020-10-08 16:29:50 +09:00
Alex Gaynor 5bfb4674b1 Merge branch 'master' into abi3-merge-master 2020-09-10 17:01:13 -04:00
kngwyu 7a4c5e2960 Merge branch 'master' into abi3 2020-09-10 00:48:20 +09:00
Sebastian Pütz 22881a3c2f Change add_function, ensure static docstrings.
Change add_function to take `&PyCFunction` instead of a wrapper
fn and ensure that dostrings of functions are `&'static str`.
2020-09-09 12:37:37 +02:00
Sebastian Pütz 3214249010 Make python function wrapper creation fallible.
Wrapping a function can fail if we can't get the module name.

Based on suggestion by @kngwyu
2020-09-03 15:48:32 +02:00
Sebastian Pütz 5bbca1a052 Set the module of `#[pyfunction]`s.
Previously neither the module nor the name of the module of
pyfunctions were registered. This commit passes the module and
its name when creating a new pyfunction.

PyModule::add_function and PyModule::add_module have been added and are
set to replace `add_wrapped` in a future release. `add_wrapped` is kept
for compatibility reasons during the transition.

Depending on whether a `PyModule` or `Python` is the argument for the
Python function-wrapper, the module will be registered with the function.
2020-09-03 14:49:28 +02:00
Alex Gaynor 400462063d Proof of concept of using PEP384s PyType_Spec 2020-09-02 16:54:39 -04:00
David Hewitt 4ed9748b45 Rename exceptions to PyException etc; reintroduce deprecated ones 2020-07-18 06:02:57 +01:00
kngwyu 016800ba4d Use travis's pypy binary instead of anaconda 2020-06-27 19:45:31 +09:00
David Hewitt 9f9137c6e4 Add ability to return from `__next__` / `__anext__` 2020-06-23 15:26:28 +01:00
kngwyu f053bc3881 Fix dealloc implementation to collectly use subtype's tp_free 2020-06-22 10:58:00 +09:00
kngwyu b70ee9a5ad Use subclass correctly in tp_new 2020-06-22 01:38:13 +09:00
Alexander Niederbühl d2c7645bad Add benchmark for Python threaded word count
Add benchmark where the sequential Rust version of the word count is
executed twice to demonstrate parallelism with Python threads.  Also
slightly simplify the benchmark functions.
2020-06-05 20:22:20 +02:00
Alexander Niederbühl bafe269dde Set debug to `False` in word-count example 2020-06-05 16:40:29 +02:00
Alexander Niederbühl de9aae1e82 Use string slices as function arguments
Also use the same names as parameters.
2020-06-05 16:40:29 +02:00
Alexander Niederbühl 4c55fa6b38 Remove unnecessary wrapping of test function 2020-06-05 16:40:29 +02:00
Alexander Niederbühl eb73105625 Make benchmarks more comparable 2020-06-05 16:40:29 +02:00
Alexander Niederbühl bcf48c0bd2 Fix clippy lints 2020-06-05 13:53:01 +02:00
Yuji Kanagawa b3566bc7d9
Merge pull request #830 from oconnor663/maxsize
use struct.calcsize("P") rather than platform.machine()
2020-03-29 16:07:57 +09:00
Jack O'Connor d2c07a87d2 xfail a couple of datetime tests on Python 3.5 + macOS 2020-03-29 15:38:42 +09:00
Jack O'Connor 9e23476221 avoid using platform.architecture() to detect 32-bit-ness in datetime tests
Same reasoning as the previous commit.
2020-03-26 14:01:18 -04:00
kngwyu 5280a281c9 Remove GILPool::new_no_pointer 2020-03-26 19:45:32 +09:00
Alexander Niederbühl 0a84c201f7 Revert "Disable segfaulty subclassing by default"
This reverts commit 5096f936dc.
2020-01-12 01:22:32 +01:00
Alexander Niederbühl 3dc5b86f22 Add subclassing testcase which previously caused a segfault
Add a testcase from #407. Both test cases don't segfault after the
change to the #[pyclass] system in #683.

Closes #407
2020-01-11 18:24:50 +01:00
kngwyu acb1120c55 Fix examples with the new #[new] API 2019-12-22 23:59:28 +09:00
kngwyu dadeb17c3a Fix Windows test 2019-11-17 16:34:55 +09:00
Alexander Niederbühl defa43015a Fix handling of invalid utf-8 sequences in PyString::to_string_lossy 2019-10-24 22:45:32 +02:00
Alexander Niederbühl 7aaef51ab0 Define limits for datetime tests as datetime literals 2019-10-21 16:50:43 +02:00
Alexander Niederbühl ffe4e2f20a Make datetime range for tests smaller 2019-10-19 18:28:53 +02:00
Alexander Niederbühl 8cdc0b42dd Fix minimum and maximum for datetime tests
Depending on the local timezone one could get

  ValueError: year 0 is out of range
2019-10-19 17:56:39 +02:00