Commit Graph

790 Commits

Author SHA1 Message Date
kngwyu 4bf448ecaa Complete the PR 2019-05-25 23:19:07 +09:00
Georg Brandl 39d3ceb551 Make PyTuple constructors return &PyTuple 2019-05-25 22:40:32 +09:00
Alexander Niederbühl 6a7090c0b0 Fix some clippy lints 2019-05-16 00:16:23 +02:00
konstin eeeee236fd
Merge pull request #478 from kngwyu/run_returns_empty
Change Python::run to return PyResult<()>
2019-05-12 15:16:17 +02:00
Alexander Niederbühl 299d325375 Enable setting the module name of a class
This is relevant for pickling objects.
2019-05-08 23:39:22 +02:00
kngwyu 803f18e61d Change Python::run to return PyResult<()> 2019-05-08 15:49:24 +09:00
Georg Brandl cdabf9e1a5 Make more constructors return &PyX instead of Py<PyX>
fixes #405
2019-05-06 10:33:31 +02:00
Alexander Niederbühl c68333c5c2 Fix clippy::len_without_is_empty
Also remove obsolete Python 2 comment and add some punctuation for
consistency.
2019-05-04 15:36:10 +02:00
Alexander Niederbühl d174c6ed23 Fix clippy::type_complexity
Don't use PyResult since no error is returned.
2019-05-04 14:03:24 +02:00
konstin c6a5c054e1
Merge pull request #469 from PyO3/remove_doc_comment
Remove doc-comment
2019-04-28 18:26:51 +02:00
konstin cd15719765 Remove doc-comment 2019-04-28 10:36:32 +02:00
Maarten de Vries 651e28ccbb marshal: Remove unwrapped ffi functions. 2019-04-26 10:10:50 +02:00
Maarten de Vries caa5c7f88a marshal: Add example to documentation of `dumps`. 2019-04-26 10:10:50 +02:00
Maarten de Vries 739efb1b54 marshal: Use PyAny and PyBytes in safe interface. 2019-04-26 10:10:50 +02:00
Maarten de Vries 35168883b2 Add safe marshal module wrapping unsafe ffi::PyMarhshal_*. 2019-04-26 10:10:50 +02:00
Maarten de Vries 1ebdb9f364 Move marshal module from ffi3 to ffi. 2019-04-26 10:10:50 +02:00
Maarten de Vries 0a5edcb74e Add PyMarshal_* functions to ffi modules. 2019-04-26 10:10:50 +02:00
Alexander Niederbühl 1d92c24db8 Add pypy.md to doctests
At the moment there are no code snippets, but all files in the guide
should be included.
2019-04-24 22:44:47 +02:00
Alexander Niederbühl e912900926 Add mistakenly ignored test again 2019-04-24 22:41:59 +02:00
Yuji Kanagawa 60cd0d09c4
Merge pull request #419 from kngwyu/pyclass-regression
Allow slf: PyRef<Self>/PyRefMut<Self> in pymethods
2019-04-24 14:10:28 +09:00
Yuji Kanagawa 5cc6b55c71
Merge pull request #455 from Alexander-N/clippy
Fix some clippy lints
2019-04-24 12:39:21 +09:00
Alexander Niederbühl faa3feda3f Merge branch 'master' into doctest 2019-04-23 21:58:09 +02:00
Alexander Niederbühl 6d87934ce0 Fix some clippy lints 2019-04-23 21:44:40 +02:00
konstin 7149a1fecb
Bump to 0.7.0-alpha.1 (#457) 2019-04-23 18:55:35 +02:00
kngwyu 09bf9bbf4a Allow slf: PyRef<Self> by replacing Self 2019-04-23 23:16:09 +09:00
kngwyu 5a2b021fda Remove FromPyObject from PyRef
It's invalid
2019-04-23 23:16:09 +09:00
kngwyu b2e01066f0 Introduce FromPyPointer for slf: PyRef/PyRefMut 2019-04-23 23:16:09 +09:00
kngwyu 515c7beac0 Allow slf: Py<Self>/PyRef<Self>/PyRefMut<Self> in pymethods 2019-04-23 23:16:08 +09:00
Omer BenAmram f8bf258602 Support rust extensions for PyPy via cpyext (#393)
* wip

* removed stuff

* removed another change

* implemented minimum amouth of ifdefs to make pypy3 hello world to compile

* implemented minimum amount of ifdefs to make pypy3 hello world to compile

* hacking on build.rs

* compiler is happy!

* few todos remain

* extracted build logic to seperate module

* added pypy test

* finally fixed pypy structs

* removed some todos

* test should now be machine independent

* fixed all pypy3 symbols

* added pypy feature

* removed `is_pypy`

* added pypy2 declerations also

* fix for cpython2

* improved libpypy detection

* added all pypy2 macros

* fixed errneous type

* more fixes

* fix python2 string macros

* modsupport symbol

* fix

* fixed and added many symbols

* fixes

* remove dup

* remove mac-specific config

* fix all name mangling macros

* unite imports

* missing symbol

* fix pybool

* implemented another missing symbol

* it works

* fix merge conflict

* uncomment non default features

* cargo.toml

* Cargo fmt

* small merge fixes

* use newer build version

* whoops

* fix build script

* more build hacks

* some random hiccups

* small fixes

* it builds!

* it builds and runs

* revert everything in FFI2

* revert changes to ffi2

* check python3 for pypy

* tiny fix

* revert ffi2 for real

* revert weird formatting changes

* bring back missing feature

* tiny error

* fix py3.7 issue

* add pypy3.5 6.0 to travis

* remove dbg!

* another tiny fix

* removed some useless annotations, and fixed inlines annotations

* removed `pretty_assertions`

* removed pypy feature from cargo.toml

* fix for Py_CompileStringFlags

* tox runs word_count!

* __dict__ changes are not supported for PyPy

* fix 3.7 and copy comment

* fix test script 😳

* transfer ownership of strings to cpython when possible

* remove cstr! macro

* added missing nuls

* as_bytes() -> b’’ string

* symbol removed by mistake

* properly shim pypy date time API, some tests are passing!

* extension_module tests now not crashing! (some still skipped)

* maybe travis has new pypy version?

* small error on windows (build script)

* fix conditional compilation

* try to make tests run on travis..

* invert condition

* added pytest-faulthandler to facilitate debugging

* correctly name dir

* use full paths

* say —yes to conda

* fix

* syntax error

* change PATH

* fixed a terrible bug with PyTypeObjects in PyPy

* fix PyTypeObject defs

* re-enabled tests!

* all tests are passing!

* make the fix ad-hoc for now

* removed build module

* revert changes that cause an additional GC bug

* prevented buggy test from failing pypy

* removed unused comment

* don’t run coverage on pypy

* removed some erroneous symbols from function calls which are actually macros

* restore py37 pyunicode missing def

* use only `link_name` in PyPy specific declarations

* only setup PyPy when testing against PyPy

* annotation that was eaten during merge

* remove change to  comment by mistake + unnecessary changes to cargo.toml

* xfail dates test only on pypy

* changed comment to be a little more helpful

* cleaned up some warnings

* Update src/ffi3/ceval.rs

Co-Authored-By: omerbenamram <omerbenamram@gmail.com>

* @konstin PR notes

* rustfmt

* some documentation

* if configured via env var only, default to cpython

* remove extra unsafe

* refer users to guide for pypy

* Update guide/src/pypy.md

Co-Authored-By: omerbenamram <omerbenamram@gmail.com>

* Update guide/src/pypy.md

Co-Authored-By: omerbenamram <omerbenamram@gmail.com>

* @konstin applied patch

* check that pypy at least build

* search explicitly for libpypy

* added note about some known unsupported features

* use ld_version

* export PYTHON_SYS_EXECUTABLE to `cargo build` test

* inverted if

* always link pypy dynamically

* remove unused imports

* Apply @kngwyu’s suggestion

* fix tox configuration

* try conda virtualenv

* try to simply not install python at all inside pypy environment

* setup pypy before using “python"

* use system_site_packages

* revert change to .travis

* moved cpyext datetime documentation to module level, and revised it.

* Update src/ffi/datetime.rs

Co-Authored-By: omerbenamram <omerbenamram@gmail.com>

* rustfmt

* Update src/ffi/datetime.rs

Co-Authored-By: omerbenamram <omerbenamram@gmail.com>

* kept only notes that are relevant to users.

* invert if

* use bash and not sh
2019-04-23 13:18:42 +02:00
Alexander Niederbühl 5858823e83 Test readme and user guide with doc-comment
Also rename some files for consistency.
2019-04-19 22:38:11 +02:00
konstin f62f384ecd
Merge pull request #448 from PyO3/fix_442
Properly scope libc to fix #442
2019-04-18 18:46:47 +02:00
konstin 6d80ee0679 Properly scope libc to fix #442
Apparently we can't add a test for that because the test crates have libc
in scope
2019-04-17 19:08:55 +02:00
Georg Brandl 527da127f3 Make Py(Frozen)Set::new return PyResult<&Py(Frozen)Set>
fixes #437
2019-04-17 12:17:58 +02:00
ijl afb82ee875 PyFloat_AS_DOUBLE() 2019-04-16 12:53:03 +00:00
Martin Larralde 60efd5b9c2
Merge pull request #432 from althonos/master
Fix documentation-related bugs
2019-04-14 19:05:59 -07:00
Ivan Enderlin a78465f8b1
doc(types) Fix a typo in `PySlice`
Thanks for the awesome project!
2019-04-13 20:59:31 -07:00
Martin Larralde 3f4f068c7f Ensure `#[getter]` doc is exposed as the `__doc__` of the descriptor 2019-04-14 00:23:59 +02:00
Martin Larralde 72003ec37a Add entry to `CHANGELOG.md` 2019-04-04 09:47:21 +02:00
Martin Larralde ad9e676512 Have `PyModule` generate a `__all__` list from its members 2019-04-04 09:43:32 +02:00
Martin Larralde 08334fe582 Fix `create_exception` macro not using an unsafe impl 2019-03-31 05:40:06 +02:00
Martin Larralde 2c82a03170 Add entry to `CHANGELOG.md` and fix typo 2019-03-31 05:29:20 +02:00
Martin Larralde d482b715de Fix signatures of `PySequenceProtocol` methods 2019-03-31 05:28:52 +02:00
konstin 9a9b519bcb Mark PyTypeObject as unsafe 2019-03-30 20:25:47 +01:00
ijl 80179be2b0 Merge num3, num_common to num 2019-03-29 12:37:26 +00:00
ijl fdeef7d67e Merge string and stringutils 2019-03-29 12:37:26 +00:00
ijl 2bb0d05a30 Drop support for python2 2019-03-29 12:37:26 +00:00
konstin 20481e8324 Whitelist clippy error 2019-03-24 17:33:08 +01:00
konstin 97189a16b9 Try fixing cargo fmt on travis ci 2019-03-24 17:19:15 +01:00
konstin f75f742c58 Fix CStr usages 2019-03-20 21:48:41 +01:00
Miles Granger 711155d7ad Update tests & docs with IntoPyDict::into_py_dict(py) 2019-03-20 20:04:00 +01:00