Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2bb5ab

Browse filesBrowse files
committed
Merge pull request #5348 from tacaswell/patch-10
windows dlls packaging
1 parent 87f5b45 commit b2bb5ab
Copy full SHA for b2bb5ab

File tree

Expand file treeCollapse file tree

3 files changed

+40
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+40
-1
lines changed

‎setup.cfg.template

Copy file name to clipboardExpand all lines: setup.cfg.template
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,9 @@
8383
#
8484
#backend = Agg
8585
#
86+
87+
[package_data]
88+
# Package additional files found in the lib/matplotlib directories.
89+
#
90+
# On Windows, package DLL files.
91+
#dlls = True

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@
110110
setupext.DviPng(),
111111
setupext.Ghostscript(),
112112
setupext.LaTeX(),
113-
setupext.PdfToPs()
113+
setupext.PdfToPs(),
114+
'Optional package data',
115+
setupext.Dlls(),
114116
]
115117

116118

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,3 +2165,34 @@ def check(self):
21652165
pass
21662166

21672167
raise CheckFailed()
2168+
2169+
2170+
class OptionalPackageData(OptionalPackage):
2171+
config_category = "package_data"
2172+
2173+
2174+
class Dlls(OptionalPackageData):
2175+
"""
2176+
On Windows, this packages any DLL files that can be found in the
2177+
lib/matplotlib/* directories.
2178+
"""
2179+
name = "dlls"
2180+
2181+
def check_requirements(self):
2182+
if sys.platform != 'win32':
2183+
raise CheckFailed("Microsoft Windows only")
2184+
2185+
def get_package_data(self):
2186+
return {'': ['*.dll']}
2187+
2188+
@classmethod
2189+
def get_config(cls):
2190+
"""
2191+
Look at `setup.cfg` and return one of ["auto", True, False] indicating
2192+
if the package is at default state ("auto"), forced by the user (True)
2193+
or opted-out (False).
2194+
"""
2195+
try:
2196+
return config.getboolean(cls.config_category, cls.name)
2197+
except:
2198+
return False # <-- default

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.