aleaxit / gmpy

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)
https://gmpy2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
519 stars 86 forks source link

a release supporting Python 3.10 ? #303

Closed dimpase closed 2 years ago

dimpase commented 3 years ago

Python 3.10 has entered the feature freeze stage, and gmpy needs a patch, already merged to build with Python 3.10. Please provide a release including this patch to facilitate porting work, like we do on https://trac.sagemath.org/ticket/31855 (naturally, fewer patches is always a plus).

casevh commented 3 years ago

I have made a pre-release available on Github.

https://github.com/aleaxit/gmpy/releases/tag/gmpy2-2.1.0b6

I am trying to gather feedback on the binary wheels. Assuming no issues are reported, I'll publish this version on PyPi.

skirpichev commented 3 years ago

Unfortunately, there is no binary wheels for CPython 3.10 (for non-win platforms at least).

casevh commented 3 years ago

The Linux and MacOS wheels are generated via Github actions using cibuildwheel. cibuildwheel doesn't support Python 3.10 yet.

skirpichev commented 3 years ago

It's added in the git tree.

skirpichev commented 3 years ago

@casevh, now cibuildwheel does support CPython 3.10 (since v2.0.0).

skirpichev commented 3 years ago

Since https://github.com/pypa/cibuildwheel/releases/tag/v2.1.1 cibuildwheel supports CPython 3.10 by default - without the CIBW_PRERELEASE_PYTHONS flag. @casevh, could you try this for rc1? (this still doesn't available on PyPI)

casevh commented 3 years ago

cibuildwheel does work for Linux and MacOS. I am currently compiling the Windows binaries. Assuming I don't encounter any issues, I'll release on PyPI tomorrow.

skirpichev commented 3 years ago

I will be happy to test CPython 3.10 wheels when they will be available.

casevh commented 3 years ago

I have uploaded 2.1.0rc1 to https://test.pypi.org/project/gmpy2/

Can you test a sample of the wheels to verify they install correctly?

Once I get a couple of positive tests, I will upload to the real PyPI.

skirpichev commented 3 years ago

I've tested this with the Github Actions CI: https://github.com/diofant/diofant/pull/1162

casevh commented 3 years ago

rc1 has been pushed to pypi.org

skirpichev commented 3 years ago

rc1 works. Probably, this can be closed.

ThomasTNO commented 3 years ago

Any plans on releasing an actual stable release in the near future?

casevh commented 2 years ago

I just released rc2 to fix a bug. If no other issues appear in the next few days, I'll make a stable release.

dimpase commented 2 years ago

I've tested rc1 by building a wheel for https://github.com/dimpase/pplpy using a wheel for gmpy2 2.1.0.rc1. It works. Do you plan to push a wheel for rc2 somewhere (ideally, so that it can be installed with pip --pre)

One annoying issue for Cython users of gmpy2 is the need to install the headers of mpfr and mpc even if the Cython code only uses gmp backend. Any plans to refactor?

casevh commented 2 years ago

You should be able to install rc2 with pip --pre .

I'll need to think about the header issues.

dimpase commented 2 years ago

I'll need to think about the header issues.

I can think of 2 ways;

1) refactor the headers into

skirpichev commented 2 years ago

I just released rc2 to fix a bug. If no other issues appear in the next few days, I'll make a stable release.

@casevh, the rc2 on PyPI miss the manylinux wheel for the x86_64. I would consider this as an issue.

casevh commented 2 years ago

I'm confused. For example, I see this file listed:

https://files.pythonhosted.org/packages/a2/2a/6270f715a10608e00d19fdf064cc2a0fe13bdb89a454f4a90b624e3c02e2/gmpy2-2.1.0rc2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Is a different version required?

skirpichev commented 2 years ago

Oh, @casevh, I miss the CPython version, sorry for that. The 3.10 is absent (maybe more).

dimpase commented 2 years ago

@skirpichev Probably one just needs to use the latest cibuildwheel to get Python 3.10 wheels. I'm trying this now on 46c749f82b159c2211e4cf68cafafa0b49c088db

dimpase commented 2 years ago

Let's see what artifacts we get after https://github.com/dimpase/gmpy/actions/runs/1548860487 completes.

dimpase commented 2 years ago

It fails for me, for it seems that the new cibuildwheel is using slightly different docker images - and one of them doesn't have wget package. Switching to curl...

And not all tar compressions are there: tar (child): lzip: Cannot exec: No such file or directory

skirpichev commented 2 years ago

Probably one just needs to use the latest cibuildwheel

I doubt, 3.10 builds were working for a some time (see rc1)...

I suspect someone just forgot to upload these wheels;)

dimpase commented 2 years ago

the version of cibuildwheel is certainly old, and needs a bump sooner or later - in particular as python 3.10 is the latest stable release - so it could be working as a pre-release Python version, but stopped as the current one. Anyhow, I'm making progress :-) Debugging GitHub Actions reminds me of running jobs on OS 370, like I did over 30 years ago...

skirpichev commented 2 years ago

Well, I've added 3.8-10 wheels builds on the github actions job. Seems fine for linux so far: https://github.com/skirpichev/gmpy/actions/runs/1548998701

Probably, it could be a good idea to automate pypi/gh releases uploads. I did this for the Diofant, should work with binary wheels as well (py2 wheels may be a problem, however).

dimpase commented 2 years ago

I'm able to build all the manylinux wheels (https://github.com/dimpase/gmpy/actions/runs/1548993661), now working on musllinux, see https://github.com/dimpase/gmpy/actions/runs/1549056043

dimpase commented 2 years ago

OK, this works: https://github.com/dimpase/gmpy/actions/runs/1549056043 I've got

gmpy2-2.1.0rc2-cp310-cp310-macosx_10_9_x86_64.whl
gmpy2-2.1.0rc2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
gmpy2-2.1.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gmpy2-2.1.0rc2-cp310-cp310-musllinux_1_1_i686.whl
gmpy2-2.1.0rc2-cp310-cp310-musllinux_1_1_x86_64.whl
gmpy2-2.1.0rc2-cp36-cp36m-macosx_10_9_x86_64.whl
gmpy2-2.1.0rc2-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl
gmpy2-2.1.0rc2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gmpy2-2.1.0rc2-cp36-cp36m-musllinux_1_1_i686.whl
gmpy2-2.1.0rc2-cp36-cp36m-musllinux_1_1_x86_64.whl
gmpy2-2.1.0rc2-cp37-cp37m-macosx_10_9_x86_64.whl
gmpy2-2.1.0rc2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
gmpy2-2.1.0rc2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gmpy2-2.1.0rc2-cp37-cp37m-musllinux_1_1_i686.whl
gmpy2-2.1.0rc2-cp37-cp37m-musllinux_1_1_x86_64.whl
gmpy2-2.1.0rc2-cp38-cp38-macosx_10_9_x86_64.whl
gmpy2-2.1.0rc2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
gmpy2-2.1.0rc2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gmpy2-2.1.0rc2-cp38-cp38-musllinux_1_1_i686.whl
gmpy2-2.1.0rc2-cp38-cp38-musllinux_1_1_x86_64.whl
gmpy2-2.1.0rc2-cp39-cp39-macosx_10_9_x86_64.whl
gmpy2-2.1.0rc2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
gmpy2-2.1.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gmpy2-2.1.0rc2-cp39-cp39-musllinux_1_1_i686.whl
gmpy2-2.1.0rc2-cp39-cp39-musllinux_1_1_x86_64.whl

I'll make a PR.

skirpichev commented 2 years ago

@dimpase, you might consider make a pr. But CPython 3.10 build should be fine on the master, see latest builds. It's just not uploaded.

dimpase commented 2 years ago

318 gives us *manylinux_2_17* wheels, as opposed to *manylinux_2_12* provided by cibuildwheel 2.1, so this, as well as presence of musllinux wheels, is an extra.

casevh commented 2 years ago

318 has been committed. Thank you for helping get this fixed. I'll try to look at the header issue tonight.

casevh commented 2 years ago

I have released 2.1.0 final.

I'm still thinking about the challenges with binary wheels and Cython extensions. I'll start a new issue for it.

skirpichev commented 2 years ago

@casevh, probably this can be closed. 2.1.0 has all wheels for the CPython 3.10.

casevh commented 2 years ago

Complete.