Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pyo3 from 0.11.1 to 0.12.3 and numpy from 0.11.0 to 0.12.1 #139

Merged
merged 12 commits into from
Oct 12, 2020

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 12, 2020

Bumps pyo3 from 0.11.1 to 0.12.0.

Release notes

Sourced from pyo3's releases.

PyO3 0.12.0

This release includes a few careful revisions to the PyO3 API with the intention to make it easier to learn and use. The PyErr type is reworked to implement std::error::Error. The FromPy trait is removed. Finally, the PyObject struct is now just a type alias to Py<PyAny>. While we do not take pleasure in making breaking changes for users' code, we have done so with careful thought to make migration as simple as possible while also allowing the PyO3 API to mature. Please see the migration guide for help upgrading if any of these changes affect you.

Also added is a new #[derive(FromPyObject)] macro, which enables a convenient way to accept arguments of the Python "type" Union. (See the guide entry on this new feature.)

There have been many other improvements and bugfixes too numerous to go into detail here. For the full list, see the CHANGELOG.

Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback on the way to PyO3 0.12. The full list of users who commited at least one contribution to PyO3 0.12 is below:

@alex @birkenfeld @cathay4t @davidhewitt @Hakuyume @Hywan @kngwyu @konstin @marioortizmanero @MoritzLangenstein @mtreinish @mvaled @nagisa @noam93k @Progdrasil @programmerjake @rob-thatcher @sebpuetz @vorner @vthriller

Changelog

Sourced from pyo3's changelog.

[0.12.0] - 2020-09-12

Added

  • Add FFI definitions Py_FinalizeEx, PyOS_getsig, and PyOS_setsig. #1021
  • Add PyString::to_str for accessing PyString as &str. #1023
  • Add Python::with_gil for executing a closure with the Python GIL. #1037
  • Add type information to failures in PyAny::downcast(). #1050
  • Implement Debug for PyIterator. #1051
  • Add PyBytes::new_with and PyByteArray::new_with for initialising bytes and bytearray objects using a closure. #1074
  • Add #[derive(FromPyObject)] macro for enums and structs. #1065
  • Add Py::as_ref and Py::into_ref for converting Py<T> to &T. #1098
  • Add ability to return Result types other than PyResult from #[pyfunction], #[pymethod] and #[pyproto] functions. #1106.
  • Implement ToPyObject, IntoPy, and FromPyObject for hashbrown's HashMap and HashSet types (requires the hashbrown feature). #1114
  • Add #[pyfunction(pass_module)] and #[pyfn(pass_module)] to pass the module object as the first function argument. #1143
  • Add PyModule::add_function and PyModule::add_submodule as typed alternatives to PyModule::add_wrapped. #1143
  • Add native PyCFunction and PyFunction types. #1163

Changed

  • Rework exception types: #1024 #1115
    • Rename exception types from e.g. RuntimeError to PyRuntimeError. The old names continue to exist but are deprecated.
    • Exception objects are now accessible as &T or Py<T>, just like other Python-native types.
    • Rename PyException::py_err() to PyException::new_err().
    • Rename PyUnicodeDecodeErr::new_err() to PyUnicodeDecodeErr::new().
    • Remove PyStopIteration::stop_iteration().
  • Require T: Send for the return value T of Python::allow_threads. #1036
  • Rename PYTHON_SYS_EXECUTABLE to PYO3_PYTHON. The old name will continue to work (undocumented) but will be removed in a future release. #1039
  • Remove unsafe from signature of PyType::as_type_ptr. #1047
  • Change return type of PyIterator::from_object to PyResult<PyIterator> (was Result<PyIterator, PyDowncastError>). #1051
  • IntoPy is no longer implied by FromPy. #1063
  • Change PyObject to be a type alias for Py<PyAny>. #1063
  • Rework PyErr to be compatible with the std::error::Error trait: #1067 #1115
    • Implement Display, Error, Send and Sync for PyErr and PyErrArguments.
    • Add PyErr::instance() for accessing PyErr as &PyBaseException.
    • PyErr's fields are now an implementation detail. The equivalent values can be accessed with PyErr::ptype(), PyErr::pvalue() and PyErr::ptraceback().
    • Change receiver of PyErr::print() and PyErr::print_and_set_sys_last_vars() to &self (was self).
    • Remove PyErrValue, PyErr::from_value, PyErr::into_normalized(), and PyErr::normalize().
    • Remove PyException::into().
    • Remove Into<PyResult<T>> for PyErr and PyException.
  • Change methods generated by #[pyproto] to return NotImplemented if Python should try a reversed operation. #1072
  • Change argument to PyModule::add to impl IntoPy<PyObject> (was impl ToPyObject). #1124

Removed

  • Remove many exception and PyErr APIs; see the "changed" section above. #1024 #1067 #1115
  • Remove PyString::to_string (use new PyString::to_str). #1023
  • Remove PyString::as_bytes. #1023
  • Remove Python::register_any. #1023
  • Remove GILGuard::acquire from the public API. Use Python::acquire_gil or Python::with_gil. #1036
  • Remove the FromPy trait. #1063
  • Remove the AsPyRef trait. #1098

Fixed

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Sep 12, 2020
As documented in the changelog, release notes, and migration guide PyO3
0.12.0 reworked how exceptions are created and used. This was a breaking
change for how retworkx was using exceptions. This commit updates the
usage to be compatible with 0.12.0's new exception API. However, this is
only the first step on updating the PyO3 version and the compilation
still fails, this is currently blocked waiting for a rust-numpy release
that updates its usage to PyO3 0.12.0. Once that is released we can
continue this.
@mtreinish
Copy link
Member

Besides waiting for the rust-numpy release this is blocked on: PyO3/pyo3#1181 too marking this as on hold until the rust-numpy release and a release with the fix for PyO3/pyo3#1181 is out

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Sep 17, 2020

A newer version of pyo3 exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@mtreinish
Copy link
Member

With pyo3 0.12.1 the non-x86 build failures have been fixed, but this is still blocked on the rust-numpy release switching it over to use pyo3 0.12.

@mtreinish mtreinish changed the title Bump pyo3 from 0.11.1 to 0.12.0 Bump pyo3 from 0.11.1 to 0.12.1 Sep 17, 2020
@mtreinish mtreinish changed the title Bump pyo3 from 0.11.1 to 0.12.1 Bump pyo3 from 0.11.1 to 0.12.2 and numpy from 0.11.0 to 0.12.1 Oct 12, 2020
@mtreinish
Copy link
Member

This is still on hold pending a PyO3 0.12.2 release to fix the MSRV compilation error.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 303263802

  • 32 of 39 (82.05%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.381%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/digraph.rs 9 12 75.0%
src/lib.rs 10 14 71.43%
Totals Coverage Status
Change from base Build 300625691: 0.0%
Covered Lines: 2201
Relevant Lines: 2357

💛 - Coveralls

@mtreinish mtreinish removed the on hold label Oct 12, 2020
@mtreinish mtreinish changed the title Bump pyo3 from 0.11.1 to 0.12.2 and numpy from 0.11.0 to 0.12.1 Bump pyo3 from 0.11.1 to 0.12.3 and numpy from 0.11.0 to 0.12.1 Oct 12, 2020
@mtreinish mtreinish merged commit 4d66ef4 into master Oct 12, 2020
@mtreinish mtreinish deleted the dependabot/cargo/pyo3-0.12.0 branch October 12, 2020 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants