8000 CI: add appveyor script to build Windows wheels by matthew-brett · Pull Request #6969 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

CI: add appveyor script to build Windows wheels #6969

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

Closed

Conversation

matthew-brett
Copy link
Contributor

When we release, we will want to build the Windows wheels as well.

See gh-6966

@matthew-brett
Copy link
Contributor Author

Is there a matplotlib appveyor account? Can someone give me access so I can set up uploading to the Rackspace wheel container?

@tacaswell
Copy link
Member

The tests are run on @mdboom 's account. Is there a way to get org accounts now?

@tacaswell tacaswell added this to the 2.0.1 (next bug fix release) milestone Aug 23, 2016
@matthew-brett
Copy link
Contributor Author

I'm not sure - maybe the numpy and astropy accounts I have access to were just personal accounts with suitable names.

@QuLogic
Copy link
Member
QuLogic commented Aug 23, 2016

I think you just need to create a new account for it.

@matthew-brett matthew-brett force-pushed the backport-appveyor branch 2 times, most recently from 0b95919 to 5c1da5a Compare August 23, 2016 22:14
@matthew-brett
Copy link
Contributor Author

@cgohlke - any insight into the error finding the png headers here ?

https://ci.appveyor.com/project/mdboom/matplotlib/build/1.0.2411/job/oo5ajbkacrt9i0ma#L367

@jenshnielsen
Copy link
Member

I think @JanSchulz spent a long time debugging libpng issues when setting this up originally.

@jankatins
Copy link
Contributor

I had to change a few things in setup*.py to get it building out of the box, but that was more about libfreetype: https://github.com/matplotlib/matplotlib/commits/master/setupext.py?author=janschulz

The png stuff look actually good:

copy /Y %LIBRARY_LIB%\libpng_static.lib lib\png.lib
        1 file(s) copied.
del %LIBRARY_LIB%\png.lib
Could Not Find C:\Miniconda35-x64\envs\test-environment\Library\lib\png.lib

(the error comes from using conda-forge libpng, which does not ship a unversioned copy of the header file for libpng named png.lib. setup should pick up the static png.lib file in lib)

The visualtests script is only to generate a html file so that the image comparison tests can be viewed in a browser (showing the failures at the top...)

@jankatins
Copy link
Contributor
jankatins commented Aug 24, 2016

Ok, I think you also need 3aa9eed and d53f902 so that the conda dirs are picked up in the script and maybe more from https://github.com/matplotlib/matplotlib/commits/master/setupext.py?author=janschulz

# these should show no z, png, or freetype dll...
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\_png*.pyd'
#- cmd: '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd'
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to uncomment these two to see that they don't include wrong stuff (the next three lines should find prevent that, but to be sure...)

@jankatins
Copy link
Contributor

Now there is

======================================================================
FAIL: matplotlib.tests.test_patches.test_wedge_range.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Miniconda-x64\envs\test-environment\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "c:\projects\matplotlib\lib\matplotlib\testing\decorators.py", line 58, in failer
    result = f(*args, **kwargs)
  File "c:\projects\matplotlib\lib\matplotlib\testing\decorators.py", line 261, in do_test
    '(RMS %(rms).3f)'%err)
ImageComparisonFailure: images not close: C:\projects\matplotlib\result_images\test_patches\wedge_range.png vs. C:\projects\matplotlib\result_images\test_patches\wedge_range-expected.png (RMS 0.059)
----------------------------------------------------------------------
Ran 6110 tests in 400.479s

which might need https://github.com/matplotlib/matplotlib/commits/b38f558be986e75d31f30cf794409a50f84b906e/lib/matplotlib/tests/test_patches.py?author=janschulz

@jankatins
Copy link
Contributor
jankatins commented Aug 24, 2016

And maybe some more from #5922 -> everything with TST: in the commit message ... :-/

@matthew-brett matthew-brett force-pushed the backport-appveyor branch 3 times, most recently from dcbb41d to 75ae5b5 Compare August 25, 2016 04:01
@WeatherGod
Copy link
Member

Current failure:

======================================================================
ERROR: matplotlib.tests.test_dviread.test_dviread
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/matplotlib-2.0.0b3+110.ga12fcf2-py2.7-linux-x86_64.egg/matplotlib/tests/test_dviread.py", line 62, in test_dviread
    with open(os.path.join(dir, 'test.json')) as f:
IOError: [Errno 2] No such file or directory: u'/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/matplotlib-2.0.0b3+110.ga12fcf2-py2.7-linux-x86_64.egg/matplotlib/tests/baseline_images/dviread/test.json'

@jankatins
Copy link
Contributor

The windows failure seem to be again some tolerance problems in some tests which were already touched in this PR...

@matthew-brett matthew-brett force-pushed the backport-appveyor branch 3 times, most recently from e15e7f9 to 5433e79 Compare August 25, 2016 22:03
matthew-brett and others added 7 commits August 25, 2016 16:00
When we release, we will want to build the Windows wheels as well.
conda installs includes/libs in <env_dir>\Library, so adding this dir
makes installing under conda much easier.
Makes it possible to use the local freetype config option in setup.cfg.

Parts of this commit are from https://github.com/jbmohler/matplotlib-winbuild
jankatins and others added 6 commits August 25, 2016 16:00
affected:

matplotlib.tests.test_patches.test_wedge_range.test (RMS 0.059) (x64,27)
matplotlib.tests.test_patches.test_wedge_range.test (RMS 0.059) (x64,34)
matplotlib.tests.test_patches.test_wedge_range.test (RMS 0.059) (x86,27)

it seems that only the middle figure in the last row is different. Up the
tolerance on windows to let the tests pass.
Add and use script to remove baseline test images from Windows wheel.
cmd shell does not do wildcard expansion.
affected:

* matplotlib.tests.test_triangulation.test_tri_smooth_gradient.test (RMS 0.014) (x64,35)

The diff looks pitch black to me... -> up the tolerance...
Also fixed a problem in an error message when bytes were appended to
a string (fails on py3.x) by using %.

One of the errors before:

======================================================================
ERROR: matplotlib.tests.test_backend_ps.test_savefig_to_stringio_with_usetex
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "lib\matplotlib\testing\decorators.py", line 152, in wrapped_callable

    func(*args, **kwargs)
  File "lib\matplotlib\testing\decorators.py", line 55, in failer
    result = f(*args, **kwargs)
  File "lib\matplotlib\tests\test_backend_ps.py", line 77, in test_savefig_to_stringio_with_usetex
    _test_savefig_to_stringio()
  File "lib\matplotlib\tests\test_backend_ps.py", line 40, in _test_savefig_to_stringio
    fig.savefig(buffer, format=format)
  File "lib\matplotlib\figure.py", line 1698, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "lib\matplotlib\backend_bases.py", line 2232, in print_figure
    **kwargs)
  File "lib\matplotlib\backends\backend_ps.py", line 985, in print_ps
    return self._print_ps(outfile, 'ps', *args, **kwargs)
  File "lib\matplotlib\backends\backend_ps.py", line 1012, in _print_ps
    **kwargs)
  File "lib\matplotlib\backends\backend_ps.py", line 1376, in _print_figure_tex
    rotated=psfrag_rotated)
  File "lib\matplotlib\backends\backend_ps.py", line 1539, in gs_distill
    raise RuntimeError(m % output)
RuntimeError: ghostscript was not able to process your image.
Here is the full report generated by ghostscript:

b''
@matthew-brett
Copy link
Contributor Author

OK - after many battles, I think this one is ready now. All tests passing.

"""
from setup_external_compile import fixproj, prepare_build_cmd, VS2010, X64, tar_extract
# Note: freetype has no build profile for 2014, so we don't bother...
vc = 'vc2010' if VS2010 else 'vc2008'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is broken on Python 3.5, which uses VS2015. Better raise an Exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hide comment

Build seems to be working : https://ci.appveyor.com/project/mdboom/matplotlib/build/1.0.2436/job/akufhhatuycx8tps - is it not running this block?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you got lucky with linking a static library built with VS2010 into a DLL otherwise built with VS2015.

@cgohlke
Copy link
Contributor
cgohlke commented Aug 26, 2016

Compared to the matplotlib 1.x wheels, these wheels are missing the gtkagg extensions for Python 2.7 and the Visual C++ 2015 runtime DLLs for Python 3.5.

@matthew-brett
Copy link
Contributor Author

Christoph - would you consider sharing your recipes to get something automated working on appveyor?

@cgohlke
Copy link
Contributor
cgohlke commented Aug 26, 2016

To build freetype with VS2015 it should be possible to convert the 2010 solution and build it with msbuild. Try:

devenv freetype-2.6.1\builds\windows\vc2010\freetype.sln /upgrade
msbuild.exe freetype-2.6.1\builds\windows\vc2010\freetype.sln /t:Clean;Build /p:Configuration="Release";Platform=x64

Do not initialize the Windows 7 SDK, only VS2015.

To bundle the VS2015 runtime DLLs I run

echo [gui_support] > setup.cfg
echo windowing = True >> setup.cfg
echo [rc_options] >> setup.cfg
echo backend = TkAgg >> setup.cfg
echo [package_data] >> setup.cfg
echo dlls = True >> setup.cfg
::<snip>
copy /Y /B "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT\MSVCP140.DLL" lib\matplotlib\
copy /Y /B "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x64\Microsoft.VC140.CRT\CONCRT140.DLL" lib\matplotlib\
::<snip>
python.exe setup.py bdist_wheel
del /S /Q lib\matplotlib\*.dll

For the GTK2 agg backend I am using the GTK+ 2.22 distributions and my own builds of PyGTK. Nothing automated, just setting PATH, INCLUDE, LIB, and PKG_CONFIG_PATH environment variables.
Not sure if it is worth providing the GTK2 agg backend for matplotlib 2.x. I have not tried so far.

@jankatins
Copy link
Contributor

All comments from @cgohlke probably also apply to the master version of the appveyor script :-/

The MS runtime libs are probably not included because I (and the appveyor scripts) use conda and conda has them included when python is installed, so no error was raised... :-/

@cgohlke
Copy link
Contributor
cgohlke commented Aug 26, 2016

Re MS runtime: Appveyor will probably never fail because the DLLs are installed as part of Visual Studio 2015. Many user systems are missing the DLLs, which is a nuisance, so the DLLs are included in the matplotlib wheels.

@NelleV
Copy link
Member
NelleV commented Sep 29, 2016

Hi @matthew-brett
Do you mind making a check list of what is left to be done on this PR? I think that would help us move forward.

@tacaswell tacaswell closed this Jan 20, 2017
@tacaswell tacaswell changed the base branch from v2.x to v2.0.x January 20, 2017 16:04
@tacaswell tacaswell reopened this Jan 20, 2017
@dstansby
Copy link
Member
dstansby commented Apr 5, 2017

Moving to 2.1 since this isn't really a bug fix

@dstansby dstansby modified the milestones: 2.1 (next point release), 2.0.1 (next bug fix release) Apr 5, 2017
@tacaswell tacaswell modified the milestones: 2.1.1 (next bug fix release), 2.1 (next point release) Aug 29, 2017
@cgohlke cgohlke mentioned this pull request Oct 6, 2017
@tacaswell tacaswell closed this Oct 7, 2017
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.

10 participants
0