Commit Graph

3838 Commits

Author SHA1 Message Date
Yuji Kanagawa 05b0cb66f8
Merge pull request #506 from PyO3/more_error_information
Print error before on class init panic
2019-06-14 14:16:47 +09:00
kngwyu 8dbb388372 Change add_wrapped to take &impl Fn 2019-06-14 12:42:32 +09:00
kngwyu 0f9a3b1194 Expose py_run macro 2019-06-13 18:18:06 +09:00
Yuji Kanagawa 787f5d305e
Merge pull request #509 from Alexander-N/coverage
Ignore return code of coverage script
2019-06-09 12:55:16 +09:00
Yuji Kanagawa 1d05de8546
Merge pull request #508 from Alexander-N/patch-1
Add python-ext-wasm as example
2019-06-09 12:54:24 +09:00
Alexander Niederbühl c416e0ef8e Ignore return code of coverage script
A failure in the coverage script should not cause the whole build to
fail.
2019-06-08 17:08:37 +02:00
Alexander-N c66a95d355
Add python-ext-wasm as example 2019-06-08 16:35:24 +02:00
Yuji Kanagawa f2a7c64365
Merge pull request #503 from kngwyu/reject-generics
Reject generics explicitly for #[pyclass]
2019-06-06 19:02:26 +09:00
konstin 45f23c08de
Merge pull request #507 from thedrow/patch-2
Added fastuuid as an example
2019-06-05 21:06:23 +02:00
Omer Katz 9c3b4b7d37
Added fastuuid as an example. 2019-06-05 20:54:26 +03:00
konstin dfd5a2abb8 Print error before on class init panic
Inspired by https://github.com/rust-numpy/rust-numpy/issues/97, also fixes some warnings from the latest nightly
2019-06-05 12:01:09 +02:00
kngwyu 35f5301675 Reject generics explicitly for #[pyclass] 2019-06-05 18:46:17 +09:00
konstin c76399e73d
Merge pull request #491 from PyO3/less_horrible_build_rs
build.rs configuration as struct instead of strings
2019-06-05 11:26:33 +02:00
konstin ed2ec48a58
Merge pull request #504 from kngwyu/upd-readme
Add Rogue-Gym to example
2019-06-05 11:22:11 +02:00
kngwyu e58ad71734 Add Rogue-Gym to example 2019-06-05 15:51:25 +09:00
Martin Larralde 99fdafbb88 Allow setting the module name for a pyclass (#499)
* Add `MODULE` const value to `PyTypeInfo` trait

* Allow setting module name in `pyclass` macro arguments

* Add `$module` argument to `pyobject_native_type` macro in `pyo3::types`

* Set the right module for builtin types in `pyo3::types`

* Add `module` argument to example `word_count.WordCounter` class

* Add `module` argument of `pyclass` macro to guide

* Reformat code using `rustfmt`

* Add tests and entry in CHANGELOG.md for `module` argument in `pyclass`

* Make `$module` parameter in `pyobject_native_type` optional

* Make `pyobject_native_type` declare module as `Some("builtins")` by default
2019-06-03 12:18:44 +09:00
Yuji Kanagawa ed52d57c6f
Merge pull request #485 from PyO3/release_0_7_0
Release 0.7.0
2019-05-26 18:05:31 +09:00
konstin 0279b3d69f Release 0.7.0 2019-05-26 17:27:14 +09:00
kngwyu 7e6e4a923e Refactor derive_utils 2019-05-26 01:11:32 +09:00
Georg Brandl ab05a843b7 Document and test argument parsing annotations for pyfunctions 2019-05-26 01:11:25 +09:00
Georg Brandl 3878bd7acd Adjust the varargs/kwds objects to remove arguments consumed by parameters
Also fix some other validation issues and add more tests.

fixes #420
2019-05-26 01:11:25 +09:00
Georg Brandl faaf1777e4 Fix the argument parsing TypeError message
- parens are already added by the _LOCATION at call site
- fix plural-"s" logic
2019-05-26 01:10:55 +09:00
Yuji Kanagawa 4d7ca3a450
Merge pull request #447 from birkenfeld/tuple_new
Make PyTuple constructors return &PyTuple
2019-05-26 01:07:14 +09:00
kngwyu e4287e4e47 Fix datetime example 2019-05-26 00:39:06 +09:00
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
konstin 9eda9e9f80 build.rs configuration as struct instead of strings
Changes the configuration system from passing around a Vec<String> where each entry was a value for a different part of the configuration (with different types, all wrapped in strings) with a `InterpreterConfig` struct.

Also removes some outdated code.
2019-05-16 23:24:55 +02:00
Yuji Kanagawa a5a2059691
Merge pull request #490 from Alexander-N/clippy
Fix some clippy lints
2019-05-16 10:56:31 +09:00
Yuji Kanagawa 89ba9f52ae
Merge pull request #489 from Alexander-N/attribute-error
build.rs: Handle `python` being Python 2
2019-05-16 10:54:47 +09:00
Alexander Niederbühl 6a7090c0b0 Fix some clippy lints 2019-05-16 00:16:23 +02:00
Alexander Niederbühl 21a2f816fc build.rs: Handle `python` being Python 2
If `python` refers to Python 2 (as recommended in [1]) the build fails
with:
  AttributeError: 'module' object has no attribute 'base_prefix'

Since there is no `base_prefix` in Python 2, simply use `exec_prefix` if
the AttributeError is raised.

[1] https://www.python.org/dev/peps/pep-0394/
2019-05-15 23:57:01 +02:00
Azat Ibrakov 134c129edc Fix installing in 'venv' and datetime tests on Windows (#472)
* Add failing test

* Complete formatting

* Fix commands execution

* Fix commands execution for Linux

* Extract virtual environment creation/removing into separate functions

* Complete error messages

* Complete examples building

* Use 'venv' independent path

* Call script by dotted path instead of 'source' call

* Add Travis CI script

* Rename variable: 'exec_prefix' -> 'base_prefix'

* Add AppVeyor script

* Remove Rust test

* Complete shell script mode

* Complete path to powershell script

* Use 'pushd'/'popd' instead of 'cd'

* Complete powershell script

* Complete shell script

* Fix setup

* Use 'tox-venv' plugin for 'venv' stdlib module support

* Remove additional 'venv' testing

* Use global environment instead of calling 'set'

* Use 'tox' for AppVeyor, extract commands into 'setup' & 'test' scripts

* Add updating of 'pip' & 'setuptools'

* Add moving in/back from examples directories

* Complete 'pip'/'setuptools' updating

* Complete requirements

* Complete 'word-count' example configuration

* Simplify 'setup' script

* Complete 'rustapi_module' example tests

* Revert formatting

* Complete examples configuration

* Remove redundant annotations

* Add entry in changelog
2019-05-12 22:20:17 +09: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
konstin 9525e58eda
Merge pull request #477 from Alexander-N/module-name
Enable setting the module name of a class
2019-05-12 15:05:56 +02:00
konstin f48295c7ac
Merge pull request #476 from Alexander-N/sync-readme
Bring README.md and get_started.md back in sync
2019-05-12 15:02:25 +02:00
konstin e7287bcf9a
Merge pull request #484 from PyO3/konstin-patch-1
Add inline-python as example
2019-05-12 14:50:43 +02:00
konstin b0bbe74ff2
Add inline-python as example 2019-05-12 14:41:01 +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
Alexander Niederbühl d64ba9fa3a Bring README.md and get_started.md back in sync 2019-05-07 21:04:37 +02:00
konstin c4c75bbf81
Merge pull request #470 from PyO3/fix_minimal_versions
Fix compilation with -Z minimal versions
2019-05-06 16:54:28 +02:00
konstin ee10a02a24
Merge pull request #438 from birkenfeld/guide_fix
Make tons of small fixes in the guide
2019-05-06 16:54:11 +02:00
konstin 71b635e80a
Merge pull request #446 from birkenfeld/other_new
Make more constructors return &PyX instead of Py<PyX>
2019-05-06 12:46:00 +02:00
Georg Brandl cdabf9e1a5 Make more constructors return &PyX instead of Py<PyX>
fixes #405
2019-05-06 10:33:31 +02:00
Georg Brandl b289a75c16 Make tons of small fixes in the guide
- spelling/grammar
- update docs.rs links and Cargo.toml examples to 0.6.0
- fix a few factual mistakes I found in the process
2019-05-06 09:46:47 +02:00
konstin 74600f5f05
Merge pull request #473 from Alexander-N/clippy
Fix more clippy lints
2019-05-04 15:58:52 +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
Yuji Kanagawa be10800ea6
Merge pull request #461 from kngwyu/pymethod-with-lifetime
Allow #[pymethods] to use lifetime
2019-04-29 13:12:51 +09:00
konstin b5e23b4a32
Merge branch 'master' into fix_minimal_versions 2019-04-28 18:30:07 +02:00