Skip to content

Commit b760e2e

Browse files
committed
option to disable building backend extension modules moved from setup.py
to setup.cfg svn path=/trunk/matplotlib/; revision=4221
1 parent bdd36ad commit b760e2e

File tree

3 files changed

+63
-14
lines changed

3 files changed

+63
-14
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2007-11-12 Options to disable building backend extension modules moved
2+
from setup.py to setup.cfg - DSD
3+
14
2007-11-09 Applied Martin Teichmann's patch 1828813: a QPainter is used in
25
paintEvent, which has to be destroyed using the method end(). If
36
matplotlib raises an exception before the call to end - and it

setup.cfg.template

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,37 @@ tag_svn_revision = 1
1111
#suppress = True
1212

1313
[provide_packages]
14-
# by default, matplotlib checks for a few dependencies and
14+
# By default, matplotlib checks for a few dependencies and
1515
# installs them if missing. This feature can be turned off
1616
# by uncommenting the following lines:
1717
#
18-
## date/timezone support:
18+
## Date/timezone support:
1919
#pytz = False
2020
#dateutil = False
2121
#
22-
## experimental config package support:
22+
## Experimental config package support:
2323
#enthought.traits = False
2424
#configobj = False
25+
26+
[gui_support]
27+
# Matplotlib supports multiple GUI toolkits, including Cocoa,
28+
# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these
29+
# toolkits requires AGG, the Anti-Grain Geometry library, which
30+
# is provided by matplotlib and built by default.
31+
#
32+
# Some backends are written in pure Python, and others require
33+
# extension code to be compiled. By default, matplotlib checks
34+
# for these GUI toolkits during installation and, if present,
35+
# compiles the required extensions to support the toolkit. GTK
36+
# support requires the GTK runtime environment and PyGTK. Wx
37+
# support requires wxWidgets and wxPython. Tk support requires
38+
# Tk and Tkinter. The other GUI toolkits do not require any
39+
# extension code, and can be used as long as the libraries are
40+
# installed on your system.
41+
#
42+
# You can uncomment any the following lines if you know you do
43+
# not want to use the GUI toolkit.
44+
#gtk = False
45+
#gtkagg = False
46+
#tkagg = False
47+
#wxagg = False

setup.py

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
# build support for whatever array packages you have installed.
1818
BUILD_IMAGE = 1
1919

20+
21+
# build a small extension to manage the focus on win32 platforms.
22+
#BUILD_WINDOWING = 0
23+
BUILD_WINDOWING = 'auto'
24+
25+
26+
VERBOSE = False # insert lots of diagnostic prints in extension code
27+
28+
29+
30+
31+
## You shouldn't need to customize below this point
32+
import ConfigParser
33+
import os
34+
2035
# Build the antigrain geometry toolkit. Agg makes heavy use of
2136
# templates, so it probably requires a fairly recent compiler to build
2237
# it. It makes very nice antialiased output and also supports alpha
@@ -35,18 +50,26 @@
3550
# needed for wxpython <2.8 if you plan on doing animations
3651
BUILD_WXAGG = 1
3752

53+
if os.path.exists("setup.cfg"):
54+
config = ConfigParser.SafeConfigParser()
55+
config.read("setup.cfg")
56+
try:
57+
BUILD_GTK = config.getboolean("gui_support", "gtk")
58+
except:
59+
pass
60+
try:
61+
BUILD_GTKAGG = config.getboolean("gui_support", "gtkagg")
62+
except:
63+
pass
64+
try:
65+
BUILD_TKAGG = config.getboolean("gui_support", "tkagg")
66+
except:
67+
pass
68+
try:
69+
BUILD_WXAGG = config.getboolean("gui_support", "wxagg")
70+
except:
71+
pass
3872

39-
# build a small extension to manage the focus on win32 platforms.
40-
#BUILD_WINDOWING = 0
41-
BUILD_WINDOWING = 'auto'
42-
43-
44-
VERBOSE = False # insert lots of diagnostic prints in extension code
45-
46-
47-
48-
49-
## You shouldn't need to customize below this point
5073

5174
# BEFORE importing disutils, remove MANIFEST. distutils doesn't properly
5275
# update it when the contents of directories change.

0 commit comments

Comments
 (0)