Skip to content

Commit

Permalink
Remove the package_data.dlls setup.cfg entry.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anntzer committed May 30, 2019
1 parent e891b77 commit f444674
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 41 deletions.
4 changes: 3 additions & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -304,7 +307,6 @@ repository::

build_alllocal.cmd


Conda packages
^^^^^^^^^^^^^^

Expand Down
10 changes: 10 additions & 0 deletions doc/api/next_api_changes/2019-05-30-AL.rst
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 0 additions & 6 deletions setup.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
setupext.BackendAgg(),
setupext.BackendTkAgg(),
setupext.BackendMacOSX(),
'Optional package data',
setupext.Dlls(),
]


Expand Down
33 changes: 1 addition & 32 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
],
}

Expand Down Expand Up @@ -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

0 comments on commit f444674

Please sign in to comment.