Windows: Add wheel and appveyor support #217
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Regarding wheels, this works by getting the most recent nix (currently the version is set using
NIX_VERSION
in appveyor) binaries and including them in the wheel. It adds them under share/nixio/bin in your python installation folder. Then at runtime that folder, if it exists, is added to the PATH.This is how we do it at kivy and is similarly how numpy does it (although a bit differently). This makes it easy to install and uninstall since you just need to do pip install wheel_name, provided you have the numpy and h5py dependencies installed of course. If it's uploaded to pypi, then they just do
pip install nixio
.When packaging and building a end user exe using e.g. pyinstaller, for projects that use nixio, this is also super easy, as the project just specifies that pyinstaller include the contents of that folder which includes al the binaries.
Currently, it works with 64 and 32 bit versions of py 2.7, 3.4, and 3.5. The wheels are found under the artifacts tab for each build.
For you to make it work, you'd need to merge this PR and then in appveyor you'd import the nixpy project in your account and in the settings tell it it to build all the branches, but only the branches that include an appveyor.yml file. The settings that run the builds will then be provided by the appveyor.yml file included in the PR (most of the setting in the general tab in appveyor control panel cannot be controlled from the appveyor.yml file so you have to set them there).
Finally, the docs need to be updated, but that can be done after we're sure it works. Also, I tried to set up the tests to run on appveyor for each build, however, the h5py and numpy wheels, when using vanilla python, must be downloaded from www.lfd.uci.edu/~gohlke/pythonlibs/ which cannot be done from the command line. So I couldn't run it. We could download manually and then upload those wheels somewhere if you have a server, in which case it should be easy to setup the tests to run automatically. Finally, appveyor runs and generates wheels for every commit, PR, and git tag. So automatic tests would be useful there.