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

Pypy hasattr #2025

Merged
merged 1 commit into from
Nov 25, 2021
Merged

Pypy hasattr #2025

merged 1 commit into from
Nov 25, 2021

Conversation

ghuls
Copy link
Contributor

@ghuls ghuls commented Nov 25, 2021

Thank you for contributing to pyo3!

Please consider adding the following to your pull request:

  • an entry in CHANGELOG.md
  • docs to all new functions and / or detail in the guide
  • tests for all new or changed functions

Be aware the CI pipeline will check your pull request for the following:

  • Rust tests (Just cargo test or make test if you need to test examples)
  • Rust lints (make clippy)
  • Rust formatting (cargo fmt)
  • Python formatting (black . --check. You can install black with pip install black)
  • Compatibility with all supported Python versions for all examples. This uses tox; you can do run it using make test_py.

You can run a similar set of checks as the CI pipeline using make test.

@birkenfeld
Copy link
Member

The first commit here looks unrelated?

@ghuls
Copy link
Contributor Author

ghuls commented Nov 25, 2021

The first commit here looks unrelated?

Is removed now. was a leftover from testing. rust-numpy does not support the latest pyo3 version (or at least I couldn't get it to work).

ghuls added a commit to ghuls/polars that referenced this pull request Nov 25, 2021
Add support for compiling polars for PyPy:
  - requires newer version of maturin
  - requires pyo3 0.15.1 with the following patch:
       Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works with PyPy:
         - PyO3/pyo3#2025
         - Available at: https://github.com/ghuls/pyo3/tree/pypy_hasattr
         - Patch against latest commits on https://github.com/PyO3/pyo3
           won't work for now, as rust-numpy 0.15 is not compatible with
           that version yet.
ritchie46 pushed a commit to pola-rs/polars that referenced this pull request Nov 25, 2021
Add support for compiling polars for PyPy:
  - requires newer version of maturin
  - requires pyo3 0.15.1 with the following patch:
       Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works with PyPy:
         - PyO3/pyo3#2025
         - Available at: https://github.com/ghuls/pyo3/tree/pypy_hasattr
         - Patch against latest commits on https://github.com/PyO3/pyo3
           won't work for now, as rust-numpy 0.15 is not compatible with
           that version yet.
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

CHANGELOG.md Outdated
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add `Py::setattr` method. [#2009](https://github.com/PyO3/pyo3/pull/2009)
- Add `PyCapsule`, exposing the [Capsule API](https://docs.python.org/3/c-api/capsule.html#capsules). [#1980](https://github.com/PyO3/pyo3/pull/1980)
- Map `PyPyObject_HasAttr` to `PyObject_HasAttr` so `hasattr` works with PyPy. [#2025](https://github.com/PyO3/pyo3/pull/2025)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to force-push to move this to the ## Fixed section.

…PyPy.

Map "PyPyObject_HasAttr" to "PyObject_HasAttr" so hasattr works
with PyPy. Solves: "undefined symbol: PyObject_HasAttr" when
importing the library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants