Commit Graph

39 Commits

Author SHA1 Message Date
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 b70ee9a5ad Use subclass correctly in tp_new 2020-06-22 01:38:13 +09:00
Alexander Niederbühl bcf48c0bd2 Fix clippy lints 2020-06-05 13:53:01 +02:00
kngwyu 5280a281c9 Remove GILPool::new_no_pointer 2020-03-26 19:45:32 +09:00
kngwyu acb1120c55 Fix examples with the new #[new] API 2019-12-22 23:59:28 +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
Samuele Maci 9ff41fcd3b Rename BytesExtractor method names to reflect their actions 2019-10-11 17:59:48 +02:00
kngwyu e911828b79 Add a test to detect memory leak of bytes->vec conversion 2019-09-07 17:59:19 +09:00
kngwyu e4287e4e47 Fix datetime example 2019-05-26 00:39:06 +09:00
Georg Brandl cdabf9e1a5 Make more constructors return &PyX instead of Py<PyX>
fixes #405
2019-05-06 10:33:31 +02: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
konstin 6cd07c369c Simpler new and clippy fixes 2019-02-23 18:38:00 +01:00
konstin 6cb098ee12 Replace py.init_[ref|mut] with Py[Ref|Mut]::new 2019-02-13 21:52:21 +01:00
konstin 1a489d2829 Make the init methods use a value instead of a function 2019-02-13 13:59:47 +01:00
konstin 56f2257e90 rust 2018 fixes 2019-02-01 16:23:34 +01:00
konstin ae8a37cd0a Allow 0..n pymethod blocks without specialization 2019-02-01 16:23:34 +01:00
konstin 936f0153e8 Migrate to rust 2018 2019-02-01 14:23:29 +01:00
konstin 9c8c5a6063 Rename #[pymodinit] to #[pymodule] 2018-11-15 19:43:29 +01:00
konstin 863ffb161f Add wrap_module macro 2018-11-15 19:43:29 +01:00
kngwyu 3b01b8f6ba Review fixes 2018-11-13 00:53:06 +09:00
kngwyu 34099b33f8 Fix PyDictIterator's segfault(for #159) 2018-11-13 00:25:54 +09:00
konstin 57afb51604 Remove PyToken completely; Fixes #94 2018-11-12 14:42:21 +01:00
konstin d2ba436d6d Remove the unnecessary type parameter PyObjectAlloc 2018-11-12 14:37:06 +01:00
konstin 9f45efebaf Format 2018-11-11 12:25:53 +01:00
konstin a9b05711b0 Add test to fix #220 2018-11-11 12:24:24 +01:00
Paul Ganssle 7abd436a0d
Add tests for othermod
This adds othermod to the rustapi_module extension and tests the
contents of the module.
2018-09-29 10:28:32 -04:00
Paul Ganssle 2fa3b942f2 Add failing test to create tzinfo subclass
Currently this fails at import time with undefined symbol:
PyDateTime_TZInfoType
2018-09-28 23:56:57 +09:00
konstin ed2739829f Fix the other part from #231 2018-09-27 01:44:17 +02:00
konstin 78a5053b22 Fix #231 2018-09-27 01:11:31 +02:00
konstin 05874d3f1a Fix tests 2018-09-27 01:11:31 +02:00
konstin c1cb5ca74f Use `::std` to fix #233 2018-09-27 00:55:45 +02:00
konstin 302c099a76 Big refactoring to shrink the prelude 2018-09-21 23:34:28 +02:00
konstin 0372360811 Add test for #219 2018-09-17 19:47:23 +02:00
Paul Ganssle c69634e0fd
Remove use_extern_macros, which is now stable 2018-08-21 18:33:34 -04:00
Paul Ganssle a05a78f7e0
Use smallest types for Py{Date}{Time} constructors
Because it's unlikely that anything other than the `year` parameter will
change in the C Python API, the rest can be restricted to their logical
ranges, which improves the compile-time error checking.
2018-08-21 18:33:33 -04:00
Paul Ganssle 5d5689f95b
Switch Py{Date}{Time} constructor parameters to i32
While the valid ranges for the constructor parameters is the same when
expressed as either u32 or i32, since the Python API uses i32 in their
public interface, we won't have to make any changes to the signatures if
the Python behavior changes (e.g. supporting negative years) without
their API changing.
2018-08-21 18:33:33 -04:00
Paul Ganssle 078bea4345
Move rustapi_module into examples
This is really a test module, but the Rust convention is to put
something like this under examples/, and when it lands, we can take
advantage of "Project-based Examples for Cargo Projects" - RFC link
at https://github.com/rust-lang/rfcs/pull/2517
2018-08-21 18:33:33 -04:00