From f4446744da793c3f910418b1be6bc729b7eca593 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 30 May 2019 17:46:38 +0200 Subject: [PATCH] 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. --- INSTALL.rst | 4 ++- doc/api/next_api_changes/2019-05-30-AL.rst | 10 +++++++ setup.cfg.template | 6 ---- setup.py | 2 -- setupext.py | 33 +--------------------- 5 files changed, 14 insertions(+), 41 deletions(-) create mode 100644 doc/api/next_api_changes/2019-05-30-AL.rst diff --git a/INSTALL.rst b/INSTALL.rst index 5bf7cda10d75..cee4150cec35 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -284,6 +284,9 @@ There are a few possibilities to build Matplotlib on Windows: * Wheels by using conda packages (see below) * Conda packages (see below) +If you are building your own Matplotlib wheels (or sdists), note that any DLLs +that you copy into the source tree will be packaged too. + Wheel builds using conda packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -304,7 +307,6 @@ repository:: build_alllocal.cmd - Conda packages ^^^^^^^^^^^^^^ diff --git a/doc/api/next_api_changes/2019-05-30-AL.rst b/doc/api/next_api_changes/2019-05-30-AL.rst new file mode 100644 index 000000000000..5a00e1ea26c1 --- /dev/null +++ b/doc/api/next_api_changes/2019-05-30-AL.rst @@ -0,0 +1,10 @@ +Changes to the Matplotlib build +``````````````````````````````` + +Previously, it was possible to package Windows DLLs into the Maptlotlib +wheel (or sdist) by copying them into the source tree and setting the +``package_data.dlls`` entry in ``setup.cfg``. + +DLLs copied in the source tree are now always packaged; the +``package_data.dlls`` entry has no effect anymore. If you do not want to +include the DLLs, don't copy them into the source tree. diff --git a/setup.cfg.template b/setup.cfg.template index b7b1be0a425e..dbfdb2ada390 100644 --- a/setup.cfg.template +++ b/setup.cfg.template @@ -66,9 +66,3 @@ # modules. The default is determined by fallback. # #backend = Agg - -[package_data] -# Package additional files found in the lib/matplotlib directories. -# -# On Windows, package DLL files. -#dlls = True diff --git a/setup.py b/setup.py index 5bd0254f8ecf..22b8b1704151 100644 --- a/setup.py +++ b/setup.py @@ -75,8 +75,6 @@ setupext.BackendAgg(), setupext.BackendTkAgg(), setupext.BackendMacOSX(), - 'Optional package data', - setupext.Dlls(), ] diff --git a/setupext.py b/setupext.py index 5e6b5411f0ce..9b3182737067 100644 --- a/setupext.py +++ b/setupext.py @@ -401,6 +401,7 @@ def get_package_data(self): *_pkg_data_helper('matplotlib', 'mpl-data/images'), *_pkg_data_helper('matplotlib', 'mpl-data/stylelib'), *_pkg_data_helper('matplotlib', 'backends/web_backend'), + '*.dll', # Only actually matters on Windows. ], } @@ -816,35 +817,3 @@ def get_extension(self): if platform.python_implementation().lower() == 'pypy': ext.extra_compile_args.append('-DPYPY=1') return ext - - -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(self): - if sys.platform != 'win32': - raise CheckFailed("Microsoft Windows only") - return super().check() - - 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 Exception: - return False # <-- default