Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1f6ca9

Browse files
committed
Use conda-forge version of conda recipe
See here: https://github.com/conda-forge/matplotlib-feedstock
1 parent 24cead7 commit a1f6ca9

File tree

6 files changed

+112
-79
lines changed

6 files changed

+112
-79
lines changed

ci/conda_recipe/bld.bat

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
mkdir lib
2-
copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
3-
if errorlevel 1 exit 1
4-
copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib
5-
if errorlevel 1 exit 1
6-
7-
set MPLBASEDIRLIST=%LIBRARY_PREFIX%;.
1+
set LIB=%LIBRARY_LIB%
2+
set LIBPATH=%LIBRARY_LIB%;
3+
set INCLUDE=%LIBRARY_INC%;%PREFIX%\Library\include\freetype2
84

9-
:: debug...
10-
set
11-
12-
copy setup.cfg.template setup.cfg
13-
if errorlevel 1 exit 1
5+
ECHO [directories] > setup.cfg
6+
ECHO basedirlist = %LIBRARY_PREFIX% >> setup.cfg
7+
ECHO [packages] >> setup.cfg
8+
ECHO tests = False >> setup.cfg
9+
ECHO sample_data = False >> setup.cfg
10+
ECHO toolkits_tests = False >> setup.cfg
1411

1512
python setup.py install
1613
if errorlevel 1 exit 1
17-
18-
rd /s /q %SP_DIR%\dateutil
19-
rd /s /q %SP_DIR%\numpy

ci/conda_recipe/build.sh

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,31 @@ if [ `uname` == Linux ]; then
77
popd
88
fi
99

10+
cat <<EOF > setup.cfg
11+
[directories]
12+
basedirlist = $PREFIX
13+
14+
[packages]
15+
tests = False
16+
toolkit_tests = False
17+
sample_data = False
18+
19+
EOF
20+
21+
# The macosx backend isn't building with conda at this stage.
1022
if [ `uname` == Darwin ]; then
11-
# run tests with Agg...
12-
# prevents a problem with Macosx mpl not installed as framework
13-
export MPLBACKEND=Agg
14-
# This seems to be not anymore needed...
15-
#sed s:'#ifdef WITH_NEXT_FRAMEWORK':'#if 1':g -i src/_macosx.m
23+
cat << EOF >> setup.cfg
24+
25+
[gui_support]
26+
tkagg = true
27+
macosx = false
28+
29+
EOF
1630
fi
1731

18-
cp setup.cfg.template setup.cfg || exit 1
32+
cat setup.cfg
33+
sed -i.bak "s|/usr/local|$PREFIX|" setupext.py
1934

20-
# on mac there is an error if done inplace:
21-
# sed: -i: No such file or directory
22-
# travis macosx sed has not even --help...
23-
mv setupext.py setupext.py_orig
24-
cat setupext.py_orig | sed s:/usr/local:$PREFIX:g > setupext.py
2535

2636
$PYTHON setup.py install
2737

28-
rm -rf $SP_DIR/PySide
29-
rm -rf $SP_DIR/__pycache__
30-
rm -rf $PREFIX/bin/nose*
31-

ci/conda_recipe/cfg_notests.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

ci/conda_recipe/meta.yaml

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,77 @@
1-
# stolen from https://github.com/conda/conda-recipes/tree/master/matplotlib
2-
# selectors [py27] and comments need to be `# [selector] comment` not `[sel] # comment`
1+
# Full credit goes to https://github.com/conda/conda-recipes for providing this recipe.
2+
# It has been subsequently adapted for automated building with conda-forge and matplotlib.
33

44
package:
5-
name: matplotlib-test
6-
# this version is replaced with a proper version from setup.py via the condaversion.patch
7-
version: 1.5.0.9
5+
name: matplotlib
6+
version: 1.5.1.9
87

98
source:
109
path: ../../
1110

1211
patches:
13-
# don't run nosetest (again)
14-
- cfg_notests.patch
15-
# nake Qt4Agg the default backend
16-
- cfg_qt4agg.patch #[not osx]
17-
- rctmp_pyside.patch #[not osx]
18-
# tk work on OSX
19-
- osx-tk.patch #[osx]
12+
# A patch to add Tcl directly to the search path on Windows.
13+
- setupext.patch # [win]
14+
# A patch to make Qt4Agg the default backend.
15+
- cfg_qt4agg.patch # [linux]
16+
# Patches the matplotlibrc template to default to Qt4.
17+
- rctmp_pyside.patch # [not osx]
18+
# Patches setupext to look in PREFIX for the tcl/tk headers.
19+
- osx-tk.patch # [osx]
2020
# dynamic version from git
21+
# we can't use condas usuall dynamic versions as setup.py uses a guard
22+
# around the setup call against importing, which is done internaly
23+
# by conda build to get the version.
2124
- condaversion.patch
2225

26+
# On Windows, the following error occurs for x64:
27+
# src/ft2font.cpp(5) : fatal error C1083: Cannot open include file: 'string': No such file or directory
28+
build: # [win64]
29+
skip: # [win64]
30+
- True # [win64]
31+
2332
requirements:
2433
build:
2534
- python
2635
- setuptools
27-
- numpy
36+
- numpy x.x
2837
- python-dateutil
29-
- freetype >=2.5,<2.6
38+
- freetype
39+
- msinttypes # [win]
40+
- cycler
41+
- nose
3042
- pyparsing
3143
- pytz
32-
- py2cairo #[linux and py2k]
44+
# - py2cairo # [linux and py2k]
3345
- tornado
3446
- libpng
35-
- zlib #[win]
36-
- pyqt #[not osx]
37-
- cycler
38-
- tk
39-
- msinttypes # from the conda-forge channel
40-
- functools32 #[py27] # from the conda-forge channel
41-
47+
- zlib # [win]
48+
- pyqt # [not osx]
49+
- tk # [linux]
4250
run:
4351
- python
44-
- numpy
52+
- numpy x.x
53+
- cycler
4554
- python-dateutil
46-
- freetype #[unix]
55+
- freetype
4756
- pytz
4857
- pyparsing
49-
- py2cairo #[linux and py2k]
50-
- libpng #[unix]
51-
- pyqt #[not osx]
52-
- cycler
53-
- tk
54-
- functools32 #[py27] # from the conda-forge channel
58+
# - py2cairo # [linux and py2k]
59+
- libpng # [unix]
60+
- pyqt # [not osx]
61+
- tk # [linux]
5562

5663
test:
57-
requires:
58-
- nose
59-
- mock
64+
imports:
65+
- matplotlib
66+
- matplotlib.pyplot
6067

6168
about:
62-
home: http://matplotlib.sourceforge.net/
63-
license: PSF-based (http://matplotlib.sourceforge.net/users/license.html)
69+
home: http://matplotlib.org/
70+
license: PSF-based (http://matplotlib.org/users/license.html)
71+
summary: Publication quality figures in Python
72+
73+
extra:
74+
recipe-maintainers:
75+
- pelson
76+
- tacaswell
77+
- JanSchulz

ci/conda_recipe/run_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23
import sys
34

45
import matplotlib
@@ -12,7 +13,8 @@
1213
import matplotlib.backends._backend_agg
1314
import matplotlib.ft2font
1415
import matplotlib.ttconv
15-
import matplotlib.backends._tkagg
16+
if platform.system() not in ['Windows']:
17+
import matplotlib.backends._tkagg
1618

1719
import pylab
1820
import mpl_toolkits

ci/conda_recipe/setupext.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git setupext.py setupext.py
2+
index 0ae553a..66c6e02 100755
3+
--- setupext.py
4+
+++ setupext.py
5+
@@ -1425,6 +1425,7 @@ class BackendTkAgg(OptionalBackendPackage):
6+
tk.destroy()
7+
8+
# Save directories and version string to cache
9+
+# tcl_lib_dir = tk_lib_dir = r'C:\Tcl%d' % (8 * tuple.__itemsize__)
10+
self.tcl_tk_cache = tcl_lib_dir, tk_lib_dir, str(Tkinter.TkVersion)[:3]
11+
return self.tcl_tk_cache
12+
13+
@@ -1531,13 +1532,10 @@ class BackendTkAgg(OptionalBackendPackage):
14+
def add_flags(self, ext):
15+
if sys.platform == 'win32':
16+
major, minor1, minor2, s, tmp = sys.version_info
17+
- if sys.version_info[0:2] < (3, 4):
18+
- ext.include_dirs.extend(['win32_static/include/tcl85'])
19+
- ext.libraries.extend(['tk85', 'tcl85'])
20+
- else:
21+
- ext.include_dirs.extend(['win32_static/include/tcl86'])
22+
- ext.libraries.extend(['tk86t', 'tcl86t'])
23+
- ext.library_dirs.extend([os.path.join(sys.prefix, 'dlls')])
24+
+ tcl_dir = r'C:\Tcl%d' % (8 * tuple.__itemsize__)
25+
+ ext.include_dirs.append(os.path.join(tcl_dir, 'include'))
26+
+ ext.library_dirs.append(os.path.join(tcl_dir, 'lib'))
27+
+ ext.libraries.extend(['tk85', 'tcl85'])
28+
29+
elif sys.platform == 'darwin':
30+
# this config section lifted directly from Imaging - thanks to

0 commit comments

Comments
 (0)