File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed
Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments