Commit Graph

1510 Commits

Author SHA1 Message Date
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
konstin c6a5c054e1
Merge pull request #469 from PyO3/remove_doc_comment
Remove doc-comment
2019-04-28 18:26:51 +02:00
konstin 6dbcd3cdc0
Merge pull request #456 from PyO3/unraw
Use syn::ext::IdentExt::unraw
2019-04-28 13:55:53 +02:00
konstin e966c1cd1d Fix compilation with -Z minimal versions
This pulls in the fix from https://github.com/dtolnay/indoc/pull/29
2019-04-28 13:05:07 +02:00
konstin 5a63bdd964
Merge branch 'master' into pymethod-with-lifetime 2019-04-28 11:08:36 +02:00
konstin b5bf17f47a
Merge pull request #460 from dronesforwork-forks/marshal
Add PyMarshal_* functions to ffi interface.
2019-04-28 10:46:51 +02:00
konstin cd15719765 Remove doc-comment 2019-04-28 10:36:32 +02:00
Yuji Kanagawa f005bbfbb3
Merge pull request #467 from twilco/master
Fix link to rust-cpython comparison
2019-04-28 17:33:58 +09:00
konstin aeae195cb4 [WIP] Use syn::ext::IdentExt::unraw 2019-04-28 10:09:55 +02:00
Tyler Wilcock a494d17847
Fix link to rust-cpython comparison 2019-04-27 15:14:34 -05:00
Maarten de Vries 556e7ba029 Add marshal module to CHANGELOG.md 2019-04-26 13:13:51 +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
kngwyu cf689840ef Allow lifetime in pymethods 2019-04-26 14:28:29 +09:00
Yuji Kanagawa 8399916ea9
Merge pull request #463 from pganssle/tweak_tox_config
Fix PEP 517 build issues in test extensions
2019-04-26 14:25:40 +09:00
Paul Ganssle b9a2d2c89f
Update word-count to support PEP 517 sdists 2019-04-25 07:06:29 -04:00
Paul Ganssle 789c0b842b
Add build backend to pyproject.toml
Adding a build-backend key forces PEP 517 with pip >= 19.0, and so it
was left off while there was no PEP 517 support. Now that we have some
tentative PEP 517 support, we can explicitly add this key.
2019-04-25 07:06:29 -04:00
Paul Ganssle f42ee00980
Update tox configuration for PEP 517
This drops "usedevelop", which does an editable installation of the
directory in favor of an isolated PEP 517/518 build environment. The
minimum version of tox has been bumped to one that has PEP 518 support.
2019-04-25 07:06:29 -04:00
Paul Ganssle c3fee87dee
Add custom sdist command to modify Cargo.toml
This enables PEP 517 builds from an sdist, and should fix `tox` builds
using `pip >= 19.0`. This does not fix pip installing the directory;
pinning to `pip < 19.0` is still the best strategy for that.
2019-04-25 07:06:26 -04:00
Yuji Kanagawa 7e8616de33
Merge pull request #464 from Alexander-N/fixes
Small fixes for tests
2019-04-25 12:59:28 +09: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
konstin 661f472660
Merge pull request #458 from Alexander-N/doctest
Fixup for Contributing.md
2019-04-23 22:20:54 +02:00