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

Skip to content

Commit d6aaaee

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 0d33556 commit d6aaaee

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

@@ -1145,9 +1135,8 @@ def get_install_requires(self):
11451135
]
11461136

11471137

1148-
class BackendAgg(OptionalBackendPackage):
1138+
class BackendAgg(SetupPackage):
11491139
name = "agg"
1150-
force = True
11511140

11521141
def get_extension(self):
11531142
sources = [
@@ -1163,9 +1152,8 @@ def get_extension(self):
11631152
return ext
11641153

11651154

1166-
class BackendTkAgg(OptionalBackendPackage):
1155+
class BackendTkAgg(SetupPackage):
11671156
name = "tkagg"
1168-
force = True
11691157

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

11951183

1184+
class OptionalBackendPackage(OptionalPackage):
1185+
config_category = "gui_support"
1186+
1187+
11961188
class BackendMacOSX(OptionalBackendPackage):
11971189
name = 'macosx'
11981190

0 commit comments

Comments
 (0)