ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
340 stars 36 forks source link

zlib bundling not working on debian #528

Open GuillaumeFromage opened 2 months ago

GuillaumeFromage commented 2 months ago

Hi there,

Is there a more portable way of ensuring that zlib is bundled with I'm getting errors from that line https://github.com/ronaldoussoren/py2app/blob/a56d463239169e415d06712e5da832e29fd0f801/src/py2app/build_app.py#L2535 as on debian zlib is built-in with python (as of debian 12/bookworm). I could make a pull request, but I don't see quite an obvious way of ensuring zlib is present on the mac where the app will be deployed.

More background: according to this stack overflow post from 12 years ago: https://stackoverflow.com/questions/269795/how-do-i-find-the-location-of-python-module-sources/13888157#13888157 ; __file__ isn't the best way. Using inspect, as the post suggested lead me to discover that zlib is often built-in with python: https://askubuntu.com/questions/741609/install-python-package-locally/741614#741614 .

Cheers

tusharsadhwani commented 1 month ago

Simply commenting out those lines worked for me:

        # if sys.version_info[0] != 2:
        #     import zlib

        #     self.copy_file(zlib.__file__, os.path.dirname(arcdir))