tonysimpson / nanomsg-python

nanomsg wrapper for python with multiple backends (CPython and ctypes) should support 2/3 and Pypy
MIT License
382 stars 85 forks source link

Build binary wheels automatically for Windows using Appveyor #54

Open codypiersall opened 7 years ago

codypiersall commented 7 years ago

This pull request adds support for automatically building Windows wheels using Appveyor. It builds nanomsg using the 1.0.0 tag and builds the Python extension. It works for Python 2.7-3.5, but cannot build the 64-bit extension for Python 2.7 or Python 3.3 because Appveyor does not support the 64-bit version of the compiler needed for those Python versions. I had to make a couple small changes to make this work:

  1. Changes to the setup.py to allow the C extension to be build instead of using ctypes.
  2. Use C89 standard in C extension so that Python 2.7 can be supported on Windows (the only change required was to move declarations to the start of blocks).
  3. In test_poll.py, change the test slightly that makes sure polling times out correctly. I think the only reason this was necessary was that the Appveyor node this was running on wasn't scheduling the process to run fast enough to get the timeout perfectly.

You can see some jobs that ran on Appveyor. If you click on one of the jobs, you can see the build artifacts, which in this case is a wheel. If this PR is accepted and you set up an account with Appveyor, then wheels will be automatically generated and can be uploaded to PyPI so Windows users don't have to go through the steps of building support on their own.

Please let me know if you need me to do anything else in order to accept the PR!

Note that my template file for the appveyor.yml script came from the Python packaging website.

codypiersall commented 7 years ago

This PR can close issue #44 and issue #47.

codypiersall commented 7 years ago

Hey @tonysimpson, do you have any plans to merge this? It should help with Windows support, I think. The generated wheels can be uploaded to PyPI, so Windows users who don't have compilers will still be able to pip install nanomsg without a problem.

tonysimpson commented 6 years ago

@codypiersall I merged this but I can't get the builds for Python27 x64 or Python34 x64 working - could you have a look at it - I've probably broken something. code is in master