Skip to content

Commit

Permalink
Merge pull request matplotlib#5348 from tacaswell/patch-10
Browse files Browse the repository at this point in the history
windows dlls packaging
  • Loading branch information
mdboom committed Oct 29, 2015
1 parent 87f5b45 commit b2bb5ab
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
6 changes: 6 additions & 0 deletions setup.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@
#
#backend = Agg
#

[package_data]
# Package additional files found in the lib/matplotlib directories.
#
# On Windows, package DLL files.
#dlls = True
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@
setupext.DviPng(),
setupext.Ghostscript(),
setupext.LaTeX(),
setupext.PdfToPs()
setupext.PdfToPs(),
'Optional package data',
setupext.Dlls(),
]


Expand Down
31 changes: 31 additions & 0 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2165,3 +2165,34 @@ def check(self):
pass

raise CheckFailed()


class OptionalPackageData(OptionalPackage):
config_category = "package_data"


class Dlls(OptionalPackageData):
"""
On Windows, this packages any DLL files that can be found in the
lib/matplotlib/* directories.
"""
name = "dlls"

def check_requirements(self):
if sys.platform != 'win32':
raise CheckFailed("Microsoft Windows only")

def get_package_data(self):
return {'': ['*.dll']}

@classmethod
def get_config(cls):
"""
Look at `setup.cfg` and return one of ["auto", True, False] indicating
if the package is at default state ("auto"), forced by the user (True)
or opted-out (False).
"""
try:
return config.getboolean(cls.config_category, cls.name)
except:
return False # <-- default

0 comments on commit b2bb5ab

Please sign in to comment.