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

Windows and Mac testing #4

Closed
konstin opened this issue Aug 4, 2018 · 5 comments
Closed

Windows and Mac testing #4

konstin opened this issue Aug 4, 2018 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@konstin
Copy link
Member

konstin commented Aug 4, 2018

pyo3-pack is meant as a replacement for setuptools-rust and is as such feature complete. As I'm working primarily on linux, I did only very limited tests on windows and don't have any mac to test on. It'd appreciate help testing those platforms.

To install pyo3-pack, you can use a prebuilt binary or cargo install pyo3-pack. For testing you can take any pyo3-powered python extension (e.g. hyperjson, pyo3's example or rust-numpy's example), build it, install it with pip and check if you can import it. I'd also be interested in feedback on the user experience (e.g. incomprehensible error message that showed up).

CC @althonos @mre @fafhrd91

@konstin konstin added the help wanted Extra attention is needed label Aug 4, 2018
@konstin
Copy link
Member Author

konstin commented Aug 4, 2018

@ManifoldFR you might want to try this for point-process-rust

@mre
Copy link

mre commented Aug 5, 2018

Created a test branch here.
Here's the output from my mac:

> pyo3-pack build                                                                                 ✘
Found Python 2.7m at python2.7, Python 3.6m at python3.6, Python 3.7m at python3.7
Building the crate for Python 2.7m at python2.7
    Finished release [optimized + debuginfo] target(s) in 0.08s
Error: ElfkitError(InvalidMagic)

Failed to ensure manylinux compliance

target/wheels is empty.

Seems like I'm running into this error.

Do I need to install any additional tooling to make it work on macOS?
Can I get rid of setuptools-rust entirely (also in setup.py)?

@konstin
Copy link
Member Author

konstin commented Aug 6, 2018

Oh well, it shouldn't check for manylinux compliancy on mac 😅 I've fixed it in e6a2de8.

Can I get rid of setuptools-rust entirely (also in setup.py)?

Yes, pyo3-pack is zero configuration and needs only a rust crate. Now that you already have a setuptools configuration it's imho a good idea to keep it as pyo3-pack won't be able to build source distribution for a while (those get compiled when installed, so package can be installed on python versions and platforms for which there are no wheels. The culprit in this case is pip though. See #2) I've tried to make this a bit clearer in the readme.

@mre
Copy link

mre commented Aug 9, 2018

After your fix it works!
Here's the output from my machine using the latest pyo3-pack from master:

~/C/p/hyperjson ❯❯❯ pyo3-pack build                                                                                                                                                                      
Found Python 2.7m at python2.7, Python 3.6m at python3.6, Python 3.7m at python3.7
Building the crate for Python 2.7m at python2.7
Building the wheel to /Users/mendler/Code/private/hyperjson/target/wheels/hyperjson-0.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Building the crate for Python 3.6m at python3.6
Building the wheel to /Users/mendler/Code/private/hyperjson/target/wheels/hyperjson-0.1.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Building the crate for Python 3.7m at python3.7
Building the wheel to /Users/mendler/Code/private/hyperjson
~/C/p/hyperjson ❯❯❯ l target/wheels/hyperjson-0.1.0-cp*                                                                                                                                                  
Permissions Size User    Date Modified Name
.rw-r--r--  677k mendler 10 Aug  0:01  target/wheels/hyperjson-0.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
.rw-r--r--  667k mendler 10 Aug  0:02  target/wheels/hyperjson-0.1.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
.rw-r--r--  667k mendler 10 Aug  0:02  target/wheels/hyperjson-0.1.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
~/C/p/hyperjson ❯❯❯ pip install target/wheels/hyperjson-0.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
~/C/p/hyperjson ❯❯❯ pip install --force-reinstall target/wheels/hyperjson-0.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Processing ./target/wheels/hyperjson-0.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: hyperjson
  Found existing installation: hyperjson 0.1
    Uninstalling hyperjson-0.1:
      Successfully uninstalled hyperjson-0.1
Successfully installed hyperjson-0.1.0
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
~/C/p/hyperjson ❯❯❯ python
Python 2.7.15 (default, Jun 17 2018, 12:46:58)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import hyperjson
>>> hyperjson.loads("1")
1

Thanks for that! I guess we can use it to publish hyperjson on pypi.
The next step would be building the wheels for Linux, probably with manylinux. I haven't worked with that before, so if you have any documentation on how to integrate that with pyo3-pack, that would be helpful.

@konstin
Copy link
Member Author

konstin commented Aug 11, 2018

Nice to hear in works on mac!

You don't need to do anything manylinux-related. pyo3-pack includes an auditwheel reimplementation and checks your libraries for compliance automatically.

@konstin konstin closed this as completed Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants