Skip to content

Remove logic for optionally building Agg and TkAgg. #13075

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

Merged
merged 1 commit into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions setup.cfg.template
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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
Expand All @@ -45,18 +29,16 @@
# otherwise skip silently. This is the default
# behavior
#
#agg = auto
#macosx = auto
#tkagg = auto

[rc_options]
# User-configurable options
#
# 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
33 changes: 9 additions & 24 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ def do_custom_build(self):

class OptionalPackage(SetupPackage):
optional = True
force = False
config_category = "packages"
default_config = "auto"

Expand All @@ -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):
Expand Down Expand Up @@ -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 = [
Expand All @@ -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"
Expand Down Expand Up @@ -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):
Expand Down