diff --git a/setup.cfg.template b/setup.cfg.template index fd6cfeddcc6a..c03c507c9412 100644 --- a/setup.cfg.template +++ b/setup.cfg.template @@ -1,5 +1,4 @@ -# Rename this file to setup.cfg to modify Matplotlib's -# build options. +# Rename this file to setup.cfg to modify Matplotlib's build options. [egg_info] @@ -18,25 +17,10 @@ #sample_data = True [gui_support] -# Matplotlib supports multiple GUI toolkits, including -# GTK3, MacOSX, Qt4, Qt5, Tk, and WX. Support for many of -# these toolkits requires AGG, the Anti-Grain Geometry library, -# which is provided by Matplotlib and built by default. -# -# Some backends are written in pure Python, and others require -# extension code to be compiled. By default, Matplotlib checks for -# these GUI toolkits during installation and, if present, compiles the -# required extensions to support the toolkit. -# -# - Tk support requires Tk development headers and Tkinter. -# - Mac OSX backend requires the Cocoa headers included with XCode. -# -# The other GUI toolkits do not require any extension code, and can be -# used as long as the libraries are installed on your system -- -# therefore they are installed unconditionally. -# -# You can uncomment any the following lines to change this -# behavior. Acceptable values are: +# Matplotlib supports multiple GUI toolkits, known as backends. +# The Mac OSX backend requires the Cocoa headers included with XCode. +# You can select whether to build it by uncommenting the following line. +# Acceptable values are: # # True: build the extension. Exits with a warning if the # required dependencies are not available @@ -45,9 +29,7 @@ # otherwise skip silently. This is the default # behavior # -#agg = auto #macosx = auto -#tkagg = auto [rc_options] # User-configurable options @@ -55,8 +37,8 @@ # Default backend, one of: Agg, Cairo, GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps, # Qt4Agg, Qt5Agg, SVG, TkAgg, WX, WXAgg. # -# The Agg, Ps, Pdf and SVG backends do not require external dependencies. Do -# not choose MacOSX, or TkAgg if you have disabled the relevant extension -# modules. The default is determined by fallback. +# The Agg, Ps, Pdf and SVG backends do not require external dependencies. Do +# not choose MacOSX if you have disabled the relevant extension modules. The +# default is determined by fallback. # #backend = Agg diff --git a/setupext.py b/setupext.py index 7a39c7a0ed9a..b472a92871f1 100644 --- a/setupext.py +++ b/setupext.py @@ -302,7 +302,6 @@ def do_custom_build(self): class OptionalPackage(SetupPackage): optional = True - force = False config_category = "packages" default_config = "auto" @@ -328,26 +327,13 @@ def check(self): May be overridden by subclasses for additional checks. """ - # Check configuration file - conf = self.get_config() - # Default "auto" state or install forced by user - if conf in [True, 'auto']: - # Set non-optional if user sets `True` in config - if conf is True: + conf = self.get_config() # Check configuration file + if conf in [True, 'auto']: # Default "auto", or install forced by user + if conf is True: # Set non-optional if user sets `True` in config self.optional = False return "installing" - # Configuration opt-out by user - else: - # Some backend extensions (e.g. Agg) need to be built for certain - # other GUI backends (e.g. TkAgg) even when manually disabled - if self.force is True: - return "installing forced (config override)" - else: - raise CheckFailed("skipping due to configuration") - - -class OptionalBackendPackage(OptionalPackage): - config_category = "gui_support" + else: # Configuration opt-out by user + raise CheckFailed("skipping due to configuration") class Platform(SetupPackage): @@ -707,9 +693,8 @@ def get_extension(self): return ext -class BackendAgg(OptionalBackendPackage): +class BackendAgg(SetupPackage): name = "agg" - force = True def get_extension(self): sources = [ @@ -725,9 +710,8 @@ def get_extension(self): return ext -class BackendTkAgg(OptionalBackendPackage): +class BackendTkAgg(SetupPackage): name = "tkagg" - force = True def check(self): return "installing; run-time loading from Python Tcl/Tk" @@ -755,7 +739,8 @@ def add_flags(self, ext): ext.libraries.extend(['dl']) -class BackendMacOSX(OptionalBackendPackage): +class BackendMacOSX(OptionalPackage): + config_category = 'gui_support' name = 'macosx' def check(self):