[Pythonmac-SIG] Package for building DMG installers from pip requirements

Matthew Brett matthew.brett at gmail.com
Tue Sep 23 19:50:16 CEST 2014


Hi,

On Mon, Sep 22, 2014 at 10:46 AM, Charlie Clark
<charlie.clark at clark-consulting.eu> wrote:
> Am .09.2014, 16:42 Uhr, schrieb Matthew Brett <matthew.brett at gmail.com>:
>
>> So just to be clear, the difference here is between the instlal you got
>> for:
>> pip install your-package
>
>
>> where `your-package` was either an sdist built with ``python setup.py
>> sdist`` or a wheel built with ``python setup.py bdist_wheel``?
>
>
>> Is your package online somewhere to have a look at the setup.py?
>
>
> https://bitbucket.org/openpyxl/openpyxl/src
>
>> My best guess would be you had some custom code for building the sdist
>> that is not being run for other distutils build commands.  If that's
>> the case, then you could certainly reasonably blame the fact that
>> distutils is complicated, but it would not be a general problem with
>> wheels.
>
>
> No, as I said the manifest wasn't being respected with wheels so we stopped
> using them. No idea whether this applies to any other projects or why it is.
> As I said before, Python's packaging is still a work in progress.

The MANIFEST only specifies the files to put into the sdist, so this is
the documented behavior (though maybe what you'd expect). I think you'll find
you get the same behavior from ``setup.py install`` for example.

You may want something like this diff to do what you want:

diff --git a/MANIFEST.in b/MANIFEST.in
index 97b8ed7..099a1f3 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,3 @@
-prune openpyxl/tests
-prune openpyxl/sample
-prune openpyxl/benchmarks
 include LICENCE.rst
 include AUTHORS.rst
 include README.rst
diff --git a/setup.py b/setup.py
index ed66b6d..9ac378d 100755
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@ def get_version():
     raise RuntimeError("Unable to find version string.")

 setup(name='openpyxl',
-    packages=find_packages(),
+    packages=[pkg for pkg in find_packages() if not pkg.endswith('.tests')],
     # metadata
     version=get_version(),
     description="A Python library to read/write Excel 2007 xlsx/xlsm files",

Cheers,

Matthew


More information about the Pythonmac-SIG mailing list