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

Skip to content

Commit f444674

Browse files
committed
Remove the package_data.dlls setup.cfg entry.
See changelog for details. DLLs won't end up in the source tree unless one explicitly copies them there, so let's assume that whoever does this knows what they're doing.
1 parent e891b77 commit f444674

5 files changed

Lines changed: 14 additions & 41 deletions

File tree

INSTALL.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ There are a few possibilities to build Matplotlib on Windows:
284284
* Wheels by using conda packages (see below)
285285
* Conda packages (see below)
286286

287+
If you are building your own Matplotlib wheels (or sdists), note that any DLLs
288+
that you copy into the source tree will be packaged too.
289+
287290
Wheel builds using conda packages
288291
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
289292

@@ -304,7 +307,6 @@ repository::
304307

305308
build_alllocal.cmd
306309

307-
308310
Conda packages
309311
^^^^^^^^^^^^^^
310312

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Changes to the Matplotlib build
2+
```````````````````````````````
3+
4+
Previously, it was possible to package Windows DLLs into the Maptlotlib
5+
wheel (or sdist) by copying them into the source tree and setting the
6+
``package_data.dlls`` entry in ``setup.cfg``.
7+
8+
DLLs copied in the source tree are now always packaged; the
9+
``package_data.dlls`` entry has no effect anymore. If you do not want to
10+
include the DLLs, don't copy them into the source tree.

setup.cfg.template

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,3 @@
6666
# modules. The default is determined by fallback.
6767
#
6868
#backend = Agg
69-
70-
[package_data]
71-
# Package additional files found in the lib/matplotlib directories.
72-
#
73-
# On Windows, package DLL files.
74-
#dlls = True

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
setupext.BackendAgg(),
7676
setupext.BackendTkAgg(),
7777
setupext.BackendMacOSX(),
78-
'Optional package data',
79-
setupext.Dlls(),
8078
]
8179

8280

setupext.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def get_package_data(self):
401401
*_pkg_data_helper('matplotlib', 'mpl-data/images'),
402402
*_pkg_data_helper('matplotlib', 'mpl-data/stylelib'),
403403
*_pkg_data_helper('matplotlib', 'backends/web_backend'),
404+
'*.dll', # Only actually matters on Windows.
404405
],
405406
}
406407

@@ -816,35 +817,3 @@ def get_extension(self):
816817
if platform.python_implementation().lower() == 'pypy':
817818
ext.extra_compile_args.append('-DPYPY=1')
818819
return ext
819-
820-
821-
class OptionalPackageData(OptionalPackage):
822-
config_category = "package_data"
823-
824-
825-
class Dlls(OptionalPackageData):
826-
"""
827-
On Windows, this packages any DLL files that can be found in the
828-
lib/matplotlib/* directories.
829-
"""
830-
name = "dlls"
831-
832-
def check(self):
833-
if sys.platform != 'win32':
834-
raise CheckFailed("Microsoft Windows only")
835-
return super().check()
836-
837-
def get_package_data(self):
838-
return {'': ['*.dll']}
839-
840-
@classmethod
841-
def get_config(cls):
842-
"""
843-
Look at `setup.cfg` and return one of ["auto", True, False] indicating
844-
if the package is at default state ("auto"), forced by the user (True)
845-
or opted-out (False).
846-
"""
847-
try:
848-
return config.getboolean(cls.config_category, cls.name)
849-
except Exception:
850-
return False # <-- default

0 commit comments

Comments
 (0)