Skip to content

Commit be1a25b

Browse files
committed
Remove logic for optionally building Agg and TkAgg.
They are actually not optional (that's the `force = True` setting which overrides the OptionalBackendPackage logic), so just make them SetupPackages and remove the corresponding (outdated) comments in setup.cfg.template.
1 parent 9221a55 commit be1a25b

File tree

2 files changed

+11
-42
lines changed

2 files changed

+11
-42
lines changed

setup.cfg.template

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,10 @@
2929
#sample_data = True
3030

3131
[gui_support]
32-
# Matplotlib supports multiple GUI toolkits, including
33-
# GTK3, MacOSX, Qt4, Qt5, Tk, and WX. Support for many of
34-
# these toolkits requires AGG, the Anti-Grain Geometry library,
35-
# which is provided by Matplotlib and built by default.
36-
#
37-
# Some backends are written in pure Python, and others require
38-
# extension code to be compiled. By default, Matplotlib checks for
39-
# these GUI toolkits during installation and, if present, compiles the
40-
# required extensions to support the toolkit.
41-
#
42-
# - Tk support requires Tk development headers and Tkinter.
43-
# - Mac OSX backend requires the Cocoa headers included with XCode.
44-
#
45-
# The other GUI toolkits do not require any extension code, and can be
46-
# used as long as the libraries are installed on your system --
47-
# therefore they are installed unconditionally.
48-
#
49-
# You can uncomment any the following lines to change this
50-
# behavior. Acceptable values are:
32+
# Matplotlib supports multiple GUI toolkits, known as backends.
33+
# The Mac OSX backend requires the Cocoa headers included with XCode.
34+
# You can select whether to build it by uncommenting the following line.
35+
# Acceptable values are:
5136
#
5237
# True: build the extension. Exits with a warning if the
5338
# required dependencies are not available
@@ -56,9 +41,7 @@
5641
# otherwise skip silently. This is the default
5742
# behavior
5843
#
59-
#agg = auto
6044
#macosx = auto
61-
#tkagg = auto
6245

6346
[rc_options]
6447
# User-configurable options

setupext.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ def _try_managers(*managers):
626626

627627
class OptionalPackage(SetupPackage):
628628
optional = True
629-
force = False
630629
config_category = "packages"
631630
default_config = "auto"
632631

@@ -663,12 +662,7 @@ def check(self):
663662
self.optional = False
664663
# Configuration opt-out by user
665664
else:
666-
# Some backend extensions (e.g. Agg) need to be built for certain
667-
# other GUI backends (e.g. TkAgg) even when manually disabled
668-
if self.force is True:
669-
message = "installing forced (config override)"
670-
else:
671-
raise CheckFailed("skipping due to configuration")
665+
raise CheckFailed("skipping due to configuration")
672666

673667
# Check requirements and add extra information (if any) to message.
674668
# If requirements are not met a CheckFailed should be raised in there.
@@ -690,10 +684,6 @@ def check_requirements(self):
690684
return ""
691685

692686

693-
class OptionalBackendPackage(OptionalPackage):
694-
config_category = "gui_support"
695-
696-
697687
class Platform(SetupPackage):
698688
name = "platform"
699689

@@ -1193,9 +1183,8 @@ def get_extension(self):
11931183
return ext
11941184

11951185

1196-
class BackendAgg(OptionalBackendPackage):
1186+
class BackendAgg(SetupPackage):
11971187
name = "agg"
1198-
force = True
11991188

12001189
def get_extension(self):
12011190
sources = [
@@ -1211,9 +1200,8 @@ def get_extension(self):
12111200
return ext
12121201

12131202

1214-
class BackendTkAgg(OptionalBackendPackage):
1203+
class BackendTkAgg(SetupPackage):
12151204
name = "tkagg"
1216-
force = True
12171205

12181206
def check(self):
12191207
return "installing; run-time loading from Python Tcl/Tk"
@@ -1241,7 +1229,8 @@ def add_flags(self, ext):
12411229
ext.libraries.extend(['dl'])
12421230

12431231

1244-
class BackendMacOSX(OptionalBackendPackage):
1232+
class BackendMacOSX(OptionalPackage):
1233+
config_category = 'gui_support'
12451234
name = 'macosx'
12461235

12471236
def check_requirements(self):
@@ -1262,15 +1251,12 @@ def get_extension(self):
12621251
return ext
12631252

12641253

1265-
class OptionalPackageData(OptionalPackage):
1266-
config_category = "package_data"
1267-
1268-
1269-
class Dlls(OptionalPackageData):
1254+
class Dlls(OptionalPackage):
12701255
"""
12711256
On Windows, this packages any DLL files that can be found in the
12721257
lib/matplotlib/* directories.
12731258
"""
1259+
config_category = "package_data"
12741260
name = "dlls"
12751261

12761262
def check_requirements(self):

0 commit comments

Comments
 (0)