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

enable windows wheels #24

Merged
merged 19 commits into from
Dec 6, 2018
Merged

enable windows wheels #24

merged 19 commits into from
Dec 6, 2018

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Nov 8, 2018

This is built on top of #22. The new commits start from 94367ca

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 8, 2018

It looks like Appveyor needs to be configured to monitor this repo.

I cancelled Travis to save CI resources.

@jakirkham
Copy link
Member

Thanks for looking at this, @grlee77.

I looked in AppVeyor to see if I could add this to the org, but seem to lack the permissions. Guessing this is the same for you.

@hgomersall, would you be able to look? FWIW AppVeyor has made some major improvements to their UI.

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

Okay, Appveyor is now trying to build this. Thanks @hgomersall.

I will try to take a look at this PR again later today.

@hgomersall
Copy link
Contributor

Great, thanks!

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

For some reason the submodule initialization on Appveyor is failing with:

git submodule update --init
Submodule 'multibuild' (https://github.com/matthew-brett/multibuild.git) registered for path 'multibuild'
Submodule 'pyFFTW' (https://github.com/pyFFTW/pyFFTW) registered for path 'pyFFTW'
Cloning into 'C:/projects/pyfftw-wheels/multibuild'...
fatal: destination path 'C:/projects/pyfftw-wheels/pyFFTW' already exists and is not an empty directory.
fatal: clone of 'https://github.com/pyFFTW/pyFFTW' into submodule path 'C:/projects/pyfftw-wheels/pyFFTW' failed
Failed to clone 'pyFFTW'. Retry scheduled
fatal: destination path 'C:/projects/pyfftw-wheels/pyFFTW' already exists and is not an empty directory.
fatal: clone of 'https://github.com/pyFFTW/pyFFTW' into submodule path 'C:/projects/pyfftw-wheels/pyFFTW' failed
Failed to clone 'pyFFTW' a second time, aborting
Command exited with code 1

any ideas?

@hgomersall
Copy link
Contributor

Is it being created during the build, and then the deployment is failing? I seem to recall something like this on the previous way of doing things - the deploy script needed to delete the directory before building the wheel (or something).

This was based off of a combination of the script at scikit-image-wheels
with the scripts in the appveyor subfolder added from the main pyFFTW repository
@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

Okay. I see what happened now. The FFTW .dlls were placed in a pyFFTW subdirectory, but submodule init cannot be run after that is done.

@grlee77 grlee77 closed this Nov 16, 2018
@grlee77 grlee77 reopened this Nov 16, 2018
@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

as of commit 4ca0f6e, builds are completing successfully, but there was a remaining issue of trying to make sure we are not doing a pre-release build that I am still working on in d81a121.

I am unable to cancel pending Appveyor builds, but that is probably an issue related to collaborator permissions on Appveyor.

One outstanding question I could use some help with: There is some MSVC configuration going in the main .appveyor.yml that I borrowed from the scikit-image wheel building repo:

  # Fix MSVC builds for 64-bit Python. See:
  # http://stackoverflow.com/questions/32091593/cannot-install-windows-sdk-7-1-on-windows-10
  - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64/vcvars64.bat"

I am not sure if this conflicts with some related settings that are going on within the run_with_env.cmd file I copied from the main repo. There, it seems to be selecting windows SDK version v7.0 for Python 2.7 and v7.1 for the rest. Do you remember why this was and do you think it is still necessary? I am wondering if the stuff in run_with_env.cmd is even necessary to have within this repo?

@hgomersall
Copy link
Contributor

This is great stuff, well done!

@jakirkham
Copy link
Member

AFAIK VS 2010 was only used with Python 3.4. If we are not supporting Python3.4, that line can probably be dropped.

@hgomersall
Copy link
Contributor

@jakirkham sorry, can you clarify what you need? Do you want to be made a collaborator too?

@jakirkham
Copy link
Member

Sure, that sounds good.

Though my comment was more about the issue @grlee77 raised about the .appveyor.yml lines for 64-bit builds. Sorry that was unclear.

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

One issue in the d81a121 builds is that the CONTAINER variable was still getting set improperly to "pre-release" instead of "wheels". I think we would have to be building from a different branch than master on pyFFTW-wheels if we want the logic to work properly as it does for scikit-image-wheels. This variable effects where the wheels get uploaded to so it needs to be set to "wheels" so that the wheels don't end up in the pre-release location.

I am going to simplify by removing this pre-release logic as I don't think we need it here. I think just building from release tags is sufficient for now.

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

feel free to cancel builds 1.0.11 and 1.0.12 on Appveyor. I only need to see the result for the final commit.

@grlee77
Copy link
Contributor Author

grlee77 commented Nov 16, 2018

Okay. This is ready for review.

The final .appveyor.yml here is a mixture of the one from scikit-image-wheels and a slightly simpler one from pywavelets-wheels with download/configuration of the precompiled FFTW libraries done using two scripts in the appveyor subfolder that were copied from the main pyFFTW repo.

If there is still a need for 32-bit windows wheels, they can be added, but I have only built the 64-bit ones for now.

@grlee77 grlee77 changed the title WIP: try adding windows builds enable windows wheels Nov 16, 2018
@grlee77
Copy link
Contributor Author

grlee77 commented Nov 19, 2018

Okay, this is all green now with 0.11.1.
It just needs someone from @pyfftw/ci to review and merge.

@hgomersall: can you add me to the ci team under the pyFFTW organization on GitHub? I would like to be able to review and merge future PRs from others in this repo.

README.rst Show resolved Hide resolved
.appveyor.yml Outdated
# Check Python version just in case
- python --version
# Run unit tests with pytest
- "python setup.py test"
Copy link
Member

Choose a reason for hiding this comment

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

Should we cleanup the downloaded FFTW DLLs before this step to ensure it is picking the ones in the wheel up?

Copy link
Contributor Author

@grlee77 grlee77 Nov 22, 2018

Choose a reason for hiding this comment

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

Looking more closely, the wheel is not actually being used during testing (or even getting installed!). This is because of the following build using:
python setup.py -v build_ext --inplace
that gets used for the tests. This approach was copied from the appveyor script in the main repo.

I can comment out that line installing the wheel as it is not doing anything. The tests do not actually get distributed with the source .tar.gz or the wheels, so I am actually not even sure how to even run the tests without using an inplace build. The comment mentions "pytest", but this was a copy/paste error. Tests effectively get run via:
python -m unittest discover and this only works for me if I do it from the top level pyfftw folder with an in-place build.

I did verify on a Windows 7 machine that downloading the Python 3.5 wheel from the Appveyor artifacts and installing it does import and run basic ffts okay and the expected dynamic libraries are in the .whl.

Copy link
Member

Choose a reason for hiding this comment

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

Usually you can run the tests as long as the package is installed somewhere the Python interpreter can find it. So would try pip installing the wheel, cleaning the source directory, and running the tests with python -m unittest discover.

Copy link
Member

Choose a reason for hiding this comment

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

That said, it's not obvious to me if we are running the tests for the other platforms. So maybe this is good enough as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests are not currently being run for OS X or linux. That is issue #12 and was being worked on in #11.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we have more variants in this repo than we test in the main pyFFTW one, so it would probably be worth having the tests all running here as well at some point.

Copy link
Contributor Author

@grlee77 grlee77 Nov 28, 2018

Choose a reason for hiding this comment

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

I tried testing as you suggest locally (i.e. installing from the wheel, cleaning the source directory with git clean -xfd and then running tests via python -m unittest discover. It finds the tests, but I get a ton of ImportErrors.

C:\Users\Greg\src\pyFFTW>python -m unittest discover
EEEEEEEEEEEEEEEEEE
======================================================================
ERROR: pyfftw (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: pyfftw
Traceback (most recent call last):
  File "F:\Miniconda3\lib\unittest\loader.py", line 462, in _find_test_path
    package = self._get_module_from_name(name)
  File "F:\Miniconda3\lib\unittest\loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "C:\Users\Greg\src\pyFFTW\pyfftw\__init__.py", line 18, in <module>
    from .pyfftw import (
ImportError: No module named 'pyfftw.pyfftw'


======================================================================
ERROR: test.test_pyfftw_base (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test.test_pyfftw_base
Traceback (most recent call last):
  File "F:\Miniconda3\lib\unittest\loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "F:\Miniconda3\lib\unittest\loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "C:\Users\Greg\src\pyFFTW\test\test_pyfftw_base.py", line 35, in <module>
    from pyfftw import FFTW, _supported_types, _all_types_human_readable
  File "C:\Users\Greg\src\pyFFTW\pyfftw\__init__.py", line 18, in <module>
    from .pyfftw import (
ImportError: No module named 'pyfftw.pyfftw'

If I first cd test to move out of the root source directory and into the test subfolder. I get similar errors, but this time about invalid relative imports.

======================================================================
ERROR: test_pyfftw_builders (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_pyfftw_builders
Traceback (most recent call last):
  File "F:\Miniconda3\lib\unittest\loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "F:\Miniconda3\lib\unittest\loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "C:\Users\Greg\src\pyFFTW\test\test_pyfftw_builders.py", line 38, in <module>
    from .test_pyfftw_base import run_test_suites, require
ImportError: attempted relative import with no known parent package

@jakirkham
Copy link
Member

Looks pretty good to me.

I don't totally understand everything going on here, but IDK if it's necessary for me to understand it if you do. Did ask a couple questions above though.

For now tests are run from an inplace build performed immediately after the
wheel build.

It is probably preferable to install the wheel and use that for running the
tests, but this may require some changes to upstream pyFFTW before it can
be implemented here.
@grlee77
Copy link
Contributor Author

grlee77 commented Dec 1, 2018

Can someone please merge this if there are no strong objections? Not having wheels on PyPI is resulting in a lot of issues being raised at the main repo.

@grlee77
Copy link
Contributor Author

grlee77 commented Dec 6, 2018

ping. can we merge this soon and work out improvements to running the tests in the future?

Copy link
Contributor

@hgomersall hgomersall left a comment

Choose a reason for hiding this comment

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

I'm happy

@hgomersall
Copy link
Contributor

Apologies for the delay on this, I'm rather busy at the moment!

@grlee77
Copy link
Contributor Author

grlee77 commented Dec 6, 2018

no problem. thanks @hgomersall

@grlee77 grlee77 merged commit 3893c02 into pyFFTW:master Dec 6, 2018
@grlee77
Copy link
Contributor Author

grlee77 commented Dec 7, 2018

I do not see the Windows wheels on Rackspace, but they were built and are available via the Appveyor artifacts tab. Unfortunately the linux/OS X wheels got built from the latest commit and not the 0.11.1 tag, so I have a new PR at #27 to try and fix that prior to uploading everything to PyPI.

@grlee77 grlee77 deleted the add_windows branch February 3, 2020 17:53
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