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

Skip to content

Commit 07e4259

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 824c2ef commit 07e4259

File tree

2 files changed

+11
-36
lines changed

2 files changed

+11
-36
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 & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ def _try_managers(*managers):
514514

515515
class OptionalPackage(SetupPackage):
516516
optional = True
517-
force = False
518517
config_category = "packages"
519518
default_config = "auto"
520519

@@ -551,12 +550,7 @@ def check(self):
551550
self.optional = False
552551
# Configuration opt-out by user
553552
else:
554-
# Some backend extensions (e.g. Agg) need to be built for certain
555-
# other GUI backends (e.g. TkAgg) even when manually disabled
556-
if self.force is True:
557-
message = "installing forced (config override)"
558-
else:
559-
raise CheckFailed("skipping due to configuration")
553+
raise CheckFailed("skipping due to configuration")
560554

561555
# Check requirements and add extra information (if any) to message.
562556
# If requirements are not met a CheckFailed should be raised in there.
@@ -578,10 +572,6 @@ def check_requirements(self):
578572
return ""
579573

580574

581-
class OptionalBackendPackage(OptionalPackage):
582-
config_category = "gui_support"
583-
584-
585575
class Platform(SetupPackage):
586576
name = "platform"
587577

@@ -1122,9 +1112,8 @@ def get_install_requires(self):
11221112
]
11231113

11241114

1125-
class BackendAgg(OptionalBackendPackage):
1115+
class BackendAgg(SetupPackage):
11261116
name = "agg"
1127-
force = True
11281117

11291118
def get_extension(self):
11301119
sources = [
@@ -1140,9 +1129,8 @@ def get_extension(self):
11401129
return ext
11411130

11421131

1143-
class BackendTkAgg(OptionalBackendPackage):
1132+
class BackendTkAgg(SetupPackage):
11441133
name = "tkagg"
1145-
force = True
11461134

11471135
def check(self):
11481136
return "installing; run-time loading from Python Tcl/Tk"
@@ -1170,6 +1158,10 @@ def add_flags(self, ext):
11701158
ext.libraries.extend(['dl'])
11711159

11721160

1161+
class OptionalBackendPackage(OptionalPackage):
1162+
config_category = "gui_support"
1163+
1164+
11731165
class BackendMacOSX(OptionalBackendPackage):
11741166
name = 'macosx'
11751167

0 commit comments

Comments
 (0)