flintlib / python-flint

Python bindings for Flint and Arb
MIT License
121 stars 23 forks source link

Bump release #145

Closed edgarcosta closed 1 day ago

edgarcosta commented 1 month ago

Given #142 would it be possible to bump the release to the official wheels include acb_theta?

oscarbenjamin commented 1 month ago

I had been hoping that the next release would include gh-132.

edgarcosta commented 1 month ago

I see. Is there a cost of having minor releases back to back? I'm writing a Magma wrapper for acb_theta via python-flint and I would sincerely appreciate if I could point people to just dopip install python-flint instead of walking them through how to pip install via pip .

oscarbenjamin commented 1 month ago

A general cost is that there are upper limits on total file size for a project in PyPI: https://github.com/pypi/warehouse/blob/eeb119f1bea381a6d5747efa7e8d9f47b341213d/warehouse/forklift/legacy.py#L76-L77 The limit is 10GB. Currently a release of python-flint is about 300MB. That means that python-flint can have 30 releases total before running out of space.

If we can find a way to make the wheels smaller then that helps a lot. The large size is mostly just the size of libflint.so.

edgarcosta commented 1 month ago

300 MB a release is a lot! could the .so be provided by a different package? I think we discussed this before and the answer was no...

Regardless one can always cleanup old releases, but that is suboptimal. https://pypi.org/project/pypi-cleanup/

On Mon, Jun 17, 2024, 18:47 Oscar Benjamin @.***> wrote:

A general cost is that there are upper limits on total file size for a project in PyPI:

https://github.com/pypi/warehouse/blob/eeb119f1bea381a6d5747efa7e8d9f47b341213d/warehouse/forklift/legacy.py#L76-L77 The limit is 10GB. Currently a release of python-flint is about 300MB. That means that python-flint can have 30 releases total before running out of space.

If we can find a way to make the wheels smaller then that helps a lot. The large size is mostly just the size of libflint.so.

— Reply to this email directly, view it on GitHub https://github.com/flintlib/python-flint/issues/145#issuecomment-2174564384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACO2BRIIYGCPEHM3A5JNWLZH5RN3AVCNFSM6AAAAABJOGYUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGU3DIMZYGQ . You are receiving this because you authored the thread.Message ID: @.***>

oscarbenjamin commented 1 month ago

could the .so be provided by a different package?

I don't think so. At least the tooling etc to make that work does not exist yet.

I just tried running strip on libflint.so (and gmp/mpfr) though and that would make the manylinux wheels go down from 40MB to 22MB.

I see now that the wheels also contain all of the .c files generated by cython as well as the .so, .pyx and .pxd files. I'm not sure what the purpose of including the .c files is. Unzipped they take as much space as the .so files but removing them only makes the zip go down to 19MB (I suppose they compress well).

Combining strip with removing the .c files would shrink the installed footprint on Linux from 146MB to 55MB and bring the wheels down from 40MB to 19MB.

We can probably drop wheels for Python 3.9 but soon we will need wheels for Python 3.13. Also Python 3.13 brings "free-threaded" Python which doubles the number of binaries that users might want:

https://peps.python.org/pep-0703/#distribution

oscarbenjamin commented 1 month ago

Actually I was testing above with a 0.6.0 wheel downloaded form PyPI but that was built by setuptools.

The wheels that are built now in CI with meson-python are already smaller. The manylinux wheels are 29MB rather than 40MB. They already don't include the .c, .pyx or .pxd files and only have the .so files.

The libflint.so that they bundle is still 79MB though and reduces to 12MB after running strip. Rezipping after stripping the libs brings the wheel down to 10MB.

oscarbenjamin commented 1 month ago

Does anyone know any reason not to run GNU strip on liblfint.so?

It looks like it would reduce the installed size from about 100MB to 20MB and the wheel size from 29MB to 10MB.

isuruf commented 1 month ago

The reason for the big size is probably the --enable-debug=yes default.

oscarbenjamin commented 1 month ago

Thanks @isuruf, I'm trying that out in gh-148

Btw the next release will likely cause some problems for conda because python-flint now uses meson-python and also Flint itself has dropped support for MPIR. So far the setup.py for setuptools is still there in case that is needed to make it work.

oscarbenjamin commented 1 month ago

Using --disable-debug doesn't seem to have much effect on the Windows/MacOS wheels but makes the Linux wheels 3x smaller. Since the Linux wheels were the larger ones that brings the overall size of a release down to more like 100MB compared to 300MB for previous releases.

edgarcosta commented 2 weeks ago

Would it be possible to have a "dev" version that gets overwritten?

oscarbenjamin commented 2 weeks ago

Would it be possible to have a "dev" version that gets overwritten?

I guess we could have an alpha release.

We need to make it easier to push a release to PyPI though. I'll take a look at automating it as I have done for other repos. It wasn't possible before because the MacOS ARM wheels were being produced in Cirrus CI but now all wheels are produced in Github Actions since gh-134.

Also gh-132 is quite close now.

edgarcosta commented 1 day ago

I closed this, as you provided the alpha, and it works for my purposes. Thanks