Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version? 🤔 #419

Closed
kloczek opened this issue Sep 1, 2023 · 15 comments · Fixed by #499
Closed

New version? 🤔 #419

kloczek opened this issue Sep 1, 2023 · 15 comments · Fixed by #499

Comments

@kloczek
Copy link

kloczek commented Sep 1, 2023

Looks like since last release which was ~10 months ago have been added +200 commits (gmpy2-2.1.5...master)

Do you have any plans to release new version? 🤔

@skirpichev
Copy link
Contributor

And it would be nice to have wheels for CPython 3.12.

@casevh
Copy link
Collaborator

casevh commented Sep 5, 2023

I am trying to release 2.2.0a1 in the next day or so. Just finishing up on the Windows builds.

@kloczek
Copy link
Author

kloczek commented Sep 5, 2023

👍

@casevh
Copy link
Collaborator

casevh commented Sep 14, 2023

I finally have completed Windows builds. I will release 2.2.0a1 as soon as I can.

@casevh
Copy link
Collaborator

casevh commented Sep 25, 2023

I have published gmpy2 2.2.0a1.

I just realized that I missed including the source. I will release a2 in couple of days.

@skirpichev
Copy link
Contributor

I just realized that I missed including the source.

Hmm, why you can't just add the source tarball? E.g. with twine upload.

BTW, releases could be automated, see e.g. the diofant workflow. (To release a new version, I tag the latest commit in the master branch and publish this release tag.) One obstacle for the gmpy - windows builds. But these artifacts could be added later by hand.

@casevh
Copy link
Collaborator

casevh commented Sep 25, 2023

Thanks. I was always under the impression that publishing a release was a single event.

I have pushed the source tarball.

Thanks again for your help.

@skirpichev
Copy link
Contributor

I was always under the impression that publishing a release was a single event.

In some sense. E.g. you can't change uploaded files. But you can completely remove some file. Or you can add a missing file.

@brubsby
Copy link

brubsby commented Sep 26, 2023

Might not be appropriate for this issue, but since it seemed related to the ongoing tasks mentioned in here, I figured I'd comment here rather than make a new one.

I've had trouble installing the new prerelease version. It's very possible I'm missing something obvious, but I unzipped the release 2.2.0a1 in my git folder, and tried to install it with PyCharm 2022.3's packaging tool (Windows), to this response:

Processing c:\gitprojects\gmpy-gmpy2-2.2.0a1
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: gmpy2
  Building wheel for gmpy2 (pyproject.toml): started
  Building wheel for gmpy2 (pyproject.toml): finished with status 'error'
Failed to build gmpy2

  error: subprocess-exited-with-error
  
  Building wheel for gmpy2 (pyproject.toml) did not run successfully.
  exit code: 1
  
  [27 lines of output]
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\gmpy2
  copying gmpy2\__init__.py -> build\lib.win-amd64-cpython-310\gmpy2
  running egg_info
  writing gmpy2.egg-info\PKG-INFO
  writing dependency_links to gmpy2.egg-info\dependency_links.txt
  writing requirements to gmpy2.egg-info\requires.txt
  writing top-level names to gmpy2.egg-info\top_level.txt
  reading manifest file 'gmpy2.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'COPYING'
  adding license file 'COPYING.LESSER'
  writing manifest file 'gmpy2.egg-info\SOURCES.txt'
  copying gmpy2\__init__.pxd -> build\lib.win-amd64-cpython-310\gmpy2
  running build_ext
  building 'gmpy2.gmpy2' extension
  creating build\temp.win-amd64-cpython-310
  creating build\temp.win-amd64-cpython-310\Release
  creating build\temp.win-amd64-cpython-310\Release\src
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -I./src -IC:\Python3\include -IC:\Python3\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" /Tcsrc/gmpy2.c /Fobuild\temp.win-amd64-cpython-310\Release\src/gmpy2.obj /DSHARED=1
  gmpy2.c
  C:\GitProjects\gmpy-gmpy2-2.2.0a1\src\gmpy2.h(80): fatal error C1083: Cannot open include file: 'gmp.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gmpy2
ERROR: Could not build wheels for gmpy2, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip

I'm aware that PyCharm's packaging tool may not be appropriate here, but I figured I'd allow it a chance to perform correctly.

and it says it's attempting to run this command

C:\Python3\python.exe C:/Program Files/JetBrains/PyCharm Community Edition 2022.3/plugins/python-ce/helpers/packaging_tool.py install file://C:\GitProjects\gmpy-gmpy2-2.2.0a1

fwiw, gmp.h seems to be at least sitting in C:\GitProjects\gmpy-gmpy2-2.2.0a1\mingw64\shared\include and C:\GitProjects\gmpy-gmpy2-2.2.0a1\mingw64\static\include, so maybe I don't have my development environment set up correctly to build the windows binaries or something. When unzipping the release, I did get an error that it couldn't make a symlink for gmp.h, but then when I reran 7z as admin it didn't give me the error, so it may not be that either.

Alternatively, I was only grabbing the prerelease because it seemed to give access to mpz_prevprime for the first time, which I wanted to use for calculating OEIS sequence A031442. And my brain isn't quite adept enough at parsing gmp library code to comprehend what algorithm the actual implementation of mpz_prevprime is implementing. Otherwise it could possibly be less hassle for me to implement it in python myself. (I first tried with primesieve-python to do something like:

def previous_prime(val):
    iterator = primesieve.Iterator()
    iterator.skipto(val)
    return iterator.prev_prime()

but either primesieve itself or primesieve-python does not have bignum support)

Some assistance with either problem would help me greatly.

@skirpichev
Copy link
Contributor

I unzipped the release 2.2.0a1 in my git folder, and tried to install it with PyCharm 2022.3's packaging tool (Windows), to this response:

It seems you are trying to build the module from sources. This is a tricky story on windows (see how our CI job does this and mingw64/msys2_build.txt). But there are binary wheels, which you could install with pip install gmpy2==2.2.0a1. Is this inappropriate for you, @brubsby, for some reason?

what algorithm the actual implementation of mpz_prevprime is implementing

This might be documented in the GMP manual, section "Algorithms".

@brubsby
Copy link

brubsby commented Sep 27, 2023

But there are binary wheels, which you could install with pip install gmpy2==2.2.0a1

Ah that worked! I didn't realize prereleases were distributed on pip as well.

@skirpichev
Copy link
Contributor

I didn't realize prereleases were distributed on pip as well.

Yeah, on the GH releases page only source code is available, looks like a minor issue. It should be possible to upload here other assets (e.g. wheels). But I realize it's too difficult to do now without proper automation of the release process (see suggestion above).

@b-kamphorst
Copy link

Hey! It appears that the prerelease 2.2.0a1 has been available for some time. Do you have thoughts on when to fully release 2.2.0?

@paddyroddy
Copy link

Any news on a full 3.12 release on PyPI? numba recently released 3.12 support, so I'm keen to make the move

@skirpichev
Copy link
Contributor

I would guess the major trouble is #352.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants