From 0279b3d69f30bed648f8fe4c8134997cd9a676e0 Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 12 May 2019 14:46:40 +0200 Subject: [PATCH] Release 0.7.0 --- CHANGELOG.md | 5 ++++- Cargo.toml | 4 ++-- README.md | 4 ++-- guide/src/advanced.md | 2 +- guide/src/class.md | 6 +++--- guide/src/conversions.md | 12 ++++++------ guide/src/exception.md | 16 ++++++++-------- guide/src/get_started.md | 4 ++-- guide/src/parallelism.md | 2 +- pyo3-derive-backend/Cargo.toml | 6 +++--- pyo3cls/Cargo.toml | 10 +++++----- src/lib.rs | 4 ++-- 12 files changed, 39 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c26dc19e019..0e8819e8bbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.7.0] - 2018-05-26 + ### Added * PyPy support by omerbenamram in [#393](https://github.com/PyO3/pyo3/pull/393) @@ -289,7 +291,8 @@ Yanked * Initial release -[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.6.0...HEAD +[Unreleased]: https://github.com/pyo3/pyo3/compare/v0.7.0...HEAD +[0.7.0]: https://github.com/pyo3/pyo3/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/pyo3/pyo3/compare/v0.5.3...v0.6.0 [0.5.3]: https://github.com/pyo3/pyo3/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/pyo3/pyo3/compare/v0.5.0...v0.5.2 diff --git a/Cargo.toml b/Cargo.toml index c15b21af194..8330905de78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3" -version = "0.7.0-alpha.1" +version = "0.7.0" description = "Bindings to Python interpreter" authors = ["PyO3 Project and Contributors "] readme = "README.md" @@ -22,7 +22,7 @@ appveyor = { repository = "fafhrd91/pyo3" } libc = "0.2.53" spin = "0.5.0" num-traits = "0.2.6" -pyo3cls = { path = "pyo3cls", version = "=0.7.0-alpha.1" } +pyo3cls = { path = "pyo3cls", version = "=0.7.0" } mashup = "0.1.9" num-complex = { version = "0.2.1", optional = true } inventory = "0.1.3" diff --git a/README.md b/README.md index c333ffe0509..3886aed2511 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies.pyo3] -version = "0.7.0-alpha.1" +version = "0.7.0" features = ["extension-module"] ``` @@ -91,7 +91,7 @@ Add `pyo3` to your `Cargo.toml` like this: ```toml [dependencies] -pyo3 = "0.7.0-alpha.1" +pyo3 = "0.7.0" ``` Example program displaying the value of `sys.version` and the current user name: diff --git a/guide/src/advanced.md b/guide/src/advanced.md index 86371018283..aa8950bf824 100644 --- a/guide/src/advanced.md +++ b/guide/src/advanced.md @@ -12,7 +12,7 @@ Currently, [#341](https://github.com/PyO3/pyo3/issues/341) causes `cargo test` t ```toml [dependencies.pyo3] -version = "0.7.0-alpha.1" +version = "0.7.0" [features] extension-module = ["pyo3/extension-module"] diff --git a/guide/src/class.md b/guide/src/class.md index f66a1915e78..a7aa0943ecf 100644 --- a/guide/src/class.md +++ b/guide/src/class.md @@ -475,7 +475,7 @@ each protocol implementation block has to be annotated with the `#[pyproto]` att ### Basic object customization -The [`PyObjectProtocol`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/class/basic/trait.PyObjectProtocol.html) trait provides several basic customizations. +The [`PyObjectProtocol`](https://docs.rs/pyo3/0.7.0/pyo3/class/basic/trait.PyObjectProtocol.html) trait provides several basic customizations. #### Attribute access @@ -529,7 +529,7 @@ Each method corresponds to Python's `self.attr`, `self.attr = value` and `del se If your type owns references to other Python objects, you will need to integrate with Python's garbage collector so that the GC is aware of those references. -To do this, implement the [`PyGCProtocol`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/class/gc/trait.PyGCProtocol.html) trait for your struct. +To do this, implement the [`PyGCProtocol`](https://docs.rs/pyo3/0.7.0/pyo3/class/gc/trait.PyGCProtocol.html) trait for your struct. It includes two methods `__traverse__` and `__clear__`. These correspond to the slots `tp_traverse` and `tp_clear` in the Python C API. `__traverse__` must call `visit.call()` for each reference to another Python object. @@ -578,7 +578,7 @@ collection, and it is possible to track them with `gc` module methods. ### Iterator Types Iterators can be defined using the -[`PyIterProtocol`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/class/iter/trait.PyIterProtocol.html) trait. +[`PyIterProtocol`](https://docs.rs/pyo3/0.7.0/pyo3/class/iter/trait.PyIterProtocol.html) trait. It includes two methods `__iter__` and `__next__`: * `fn __iter__(slf: PyRefMut) -> PyResult` * `fn __next__(slf: PyRefMut) -> PyResult>` diff --git a/guide/src/conversions.md b/guide/src/conversions.md index 1c5506be302..a389af456e9 100644 --- a/guide/src/conversions.md +++ b/guide/src/conversions.md @@ -106,9 +106,9 @@ Many conversions in PyO3 can't use `std::convert::Into` because they need a GIL Eventually, traits such as `IntoPyObject` will be replaced by this trait and a `FromPy` trait will be added that will implement `IntoPy`, just like with `From` and `Into`. -[`ToPyObject`]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/trait.ToPyObject.html -[IntoPyObject]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/trait.IntoPyObject.html -[PyObject]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.PyObject.html -[PyTuple]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/types/struct.PyTuple.html -[ObjectProtocol]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/trait.ObjectProtocol.html -[IntoPyDict]: https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/types/trait.IntoPyDict.html +[`ToPyObject`]: https://docs.rs/pyo3/0.7.0/pyo3/trait.ToPyObject.html +[IntoPyObject]: https://docs.rs/pyo3/0.7.0/pyo3/trait.IntoPyObject.html +[PyObject]: https://docs.rs/pyo3/0.7.0/pyo3/struct.PyObject.html +[PyTuple]: https://docs.rs/pyo3/0.7.0/pyo3/types/struct.PyTuple.html +[ObjectProtocol]: https://docs.rs/pyo3/0.7.0/pyo3/trait.ObjectProtocol.html +[IntoPyDict]: https://docs.rs/pyo3/0.7.0/pyo3/types/trait.IntoPyDict.html diff --git a/guide/src/exception.md b/guide/src/exception.md index bc311923de7..3130e615be4 100644 --- a/guide/src/exception.md +++ b/guide/src/exception.md @@ -35,7 +35,7 @@ fn main() { ## Raise an exception -To raise an exception, first you need to obtain an exception type and construct a new [`PyErr`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.PyErr.html), then call the [`PyErr::restore()`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.PyErr.html#method.restore) method to write the exception back to the Python interpreter's global state. +To raise an exception, first you need to obtain an exception type and construct a new [`PyErr`](https://docs.rs/pyo3/0.7.0/pyo3/struct.PyErr.html), then call the [`PyErr::restore()`](https://docs.rs/pyo3/0.7.0/pyo3/struct.PyErr.html#method.restore) method to write the exception back to the Python interpreter's global state. ```rust use pyo3::{Python, PyErr}; @@ -50,7 +50,7 @@ fn main() { } ``` -If you already have a Python exception instance, you can simply call [`PyErr::from_instance()`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.PyErr.html#method.from_instance). +If you already have a Python exception instance, you can simply call [`PyErr::from_instance()`](https://docs.rs/pyo3/0.7.0/pyo3/struct.PyErr.html#method.from_instance). ```rust,ignore PyErr::from_instance(py, err).restore(py); @@ -77,7 +77,7 @@ fn my_func(arg: PyObject) -> PyResult<()> { ## Check exception type Python has an [`isinstance`](https://docs.python.org/3/library/functions.html#isinstance) method to check an object's type, -in PyO3 there is a [`Python::is_instance()`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.Python.html#method.is_instance) method which does the same thing. +in PyO3 there is a [`Python::is_instance()`](https://docs.rs/pyo3/0.7.0/pyo3/struct.Python.html#method.is_instance) method which does the same thing. ```rust use pyo3::Python; @@ -93,7 +93,7 @@ fn main() { } ``` -[`Python::is_instance()`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.Python.html#method.is_instance) calls the underlying [`PyType::is_instance`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/types/struct.PyType.html#method.is_instance) method to do the actual work. +[`Python::is_instance()`](https://docs.rs/pyo3/0.7.0/pyo3/struct.Python.html#method.is_instance) calls the underlying [`PyType::is_instance`](https://docs.rs/pyo3/0.7.0/pyo3/types/struct.PyType.html#method.is_instance) method to do the actual work. To check the type of an exception, you can simply do: @@ -110,10 +110,10 @@ err.is_instance::(py); ## Handle Rust Errors -The vast majority of operations in this library will return [`PyResult`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/prelude/type.PyResult.html). +The vast majority of operations in this library will return [`PyResult`](https://docs.rs/pyo3/0.7.0/pyo3/prelude/type.PyResult.html). This is an alias for the type `Result`. -A [`PyErr`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.PyErr.html) represents a Python exception. +A [`PyErr`](https://docs.rs/pyo3/0.7.0/pyo3/struct.PyErr.html) represents a Python exception. Errors within the PyO3 library are also exposed as Python exceptions. The PyO3 library handles Python exceptions in two stages. During the first stage, a `PyErr` instance is @@ -124,7 +124,7 @@ In simple cases, for custom errors adding an implementation of `std::convert::Fr for this custom error is enough. `PyErr::new` accepts an argument in the form of `ToPyObject + 'static`. If the `'static` constraint can not be satisfied or more complex arguments are required, the -[`PyErrArguments`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/trait.PyErrArguments.html) +[`PyErrArguments`](https://docs.rs/pyo3/0.7.0/pyo3/trait.PyErrArguments.html) trait can be implemented. In that case, actual exception argument creation is delayed until a `Python` object is available. @@ -186,5 +186,5 @@ fn tell(file: PyObject) -> PyResult { ``` -[`pyo3::exceptions`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/exceptions/index.html) +[`pyo3::exceptions`](https://docs.rs/pyo3/0.7.0/pyo3/exceptions/index.html) defines exceptions for several standard library modules. diff --git a/guide/src/get_started.md b/guide/src/get_started.md index 651f31f82a9..3ea2c63e0f3 100644 --- a/guide/src/get_started.md +++ b/guide/src/get_started.md @@ -40,7 +40,7 @@ name = "string_sum" crate-type = ["cdylib"] [dependencies.pyo3] -version = "0.7.0-alpha.1" +version = "0.7.0" features = ["extension-module"] ``` @@ -85,7 +85,7 @@ Add `pyo3` to your `Cargo.toml` like this: ```toml [dependencies] -pyo3 = "0.7.0-alpha.1" +pyo3 = "0.7.0" ``` Example program displaying the value of `sys.version` and the current user name: diff --git a/guide/src/parallelism.md b/guide/src/parallelism.md index a853b7735c0..9d07e722858 100644 --- a/guide/src/parallelism.md +++ b/guide/src/parallelism.md @@ -4,7 +4,7 @@ CPython has the infamous GIL (Global Interpreter Lock), which prevents developer from getting true parallelism when running pure Python code. With PyO3, you can release the GIL when executing Rust code to achieve true parallelism. -The [`Python::allow_threads`](https://docs.rs/pyo3/0.7.0-alpha.1/pyo3/struct.Python.html#method.allow_threads) +The [`Python::allow_threads`](https://docs.rs/pyo3/0.7.0/pyo3/struct.Python.html#method.allow_threads) method temporarily releases the GIL, thus allowing other Python threads to run. ```rust,ignore diff --git a/pyo3-derive-backend/Cargo.toml b/pyo3-derive-backend/Cargo.toml index c89122f0baa..dbfdac19301 100644 --- a/pyo3-derive-backend/Cargo.toml +++ b/pyo3-derive-backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-derive-backend" -version = "0.7.0-alpha.1" +version = "0.7.0" description = "Code generation for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -12,5 +12,5 @@ edition = "2018" [dependencies] quote = "0.6.12" -proc-macro2 = "0.4.28" -syn = { version = "0.15.33", features = ["full", "extra-traits"] } +proc-macro2 = "0.4.30" +syn = { version = "0.15.34", features = ["full", "extra-traits"] } diff --git a/pyo3cls/Cargo.toml b/pyo3cls/Cargo.toml index b1bb8a0dcaa..5630c8cd45f 100644 --- a/pyo3cls/Cargo.toml +++ b/pyo3cls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3cls" -version = "0.7.0-alpha.1" +version = "0.7.0" description = "Proc macros for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -14,7 +14,7 @@ edition = "2018" proc-macro = true [dependencies] -quote= "0.6.9" -proc-macro2 = "0.4.20" -syn = { version = "0.15.15", features = ["full", "extra-traits"] } -pyo3-derive-backend = { path = "../pyo3-derive-backend", version = "=0.7.0-alpha.1" } +quote= "0.6.12" +proc-macro2 = "0.4.30" +syn = { version = "0.15.34", features = ["full", "extra-traits"] } +pyo3-derive-backend = { path = "../pyo3-derive-backend", version = "=0.7.0" } diff --git a/src/lib.rs b/src/lib.rs index e406eb26138..41a11becd90 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,7 +48,7 @@ //! crate-type = ["cdylib"] //! //! [dependencies.pyo3] -//! version = "0.7.0-alpha.1" +//! version = "0.7.0" //! features = ["extension-module"] //! ``` //! @@ -93,7 +93,7 @@ //! //! ```toml //! [dependencies] -//! pyo3 = "0.7.0-alpha.1" +//! pyo3 = "0.7.0" //! ``` //! //! Example program displaying the value of `sys.version`: