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

adding stable gensim for supporting py3.12 #789

Closed
wants to merge 1 commit into from

Conversation

tavallaie
Copy link

@tavallaie tavallaie commented May 26, 2024

adding last stable commit of gensim for support python 3.12 solving: #779
I wrote similar problem here.
https://blog.techbend.io/overcoming-the-hazm-compatibility-challenge-with-python-312

Copy link

sonarcloud bot commented May 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@osma
Copy link
Member

osma commented May 27, 2024

Thank you for the PR @tavallaie !

Can you elaborate on what benefit this PR brings? In my understanding, Annif already mostly works in Python 3.12, though some dependencies will need to be compiled instead of installed from wheels. We use Python 3.12 in the new Annif-tutorial image and basically everything is working, even TensorFlow (though that needed some manual intervention).

According to the CI/CD pipeline, the newer Gensim cannot be installed on Python 3.9. So we would have to drop support for 3.9.

How is this "stable gensim"? It seems to be referencing a specific commit, not a proper release.

@tavallaie
Copy link
Author

The gensim version 4.3.2 uses the deprecated triu module from scipy, making it incompatible with Python 3.12. In the version I added, gensim uses triu from numpy, but this update has not yet been added to PyPI.

@osma
Copy link
Member

osma commented May 27, 2024

@tavallaie Python 3.12 with gensim 4.3.2 seems to work in practice at least for the purposes of Annif. See e.g. this CI/CD run for the Annif 1.1.0 release, which succesfully installed dependencies (including scipy and gensim) and ran the test suite.

I'm sure you are correct in that there are compatibility issues between the software packages and versions that you mentioned, but I see little harm in practice from the perspective of Annif users. I think it would be best to wait for a formal gensim release on PyPI and then upgrade to it. We probably need to drop Python 3.9 support in the same go if the new gensim release doesn't support it anymore.

@tavallaie
Copy link
Author

tavallaie commented May 27, 2024

I understand I can go with running more test so assure not harming py3.9 ususersBut if you think it is not necessary I can close the pull request.

@osma
Copy link
Member

osma commented May 27, 2024

I'm curious if you had an actual problem running Annif on Python 3.12? What made you create this PR?

@tavallaie
Copy link
Author

tavallaie commented May 27, 2024

I encountered an issue with Gensim in another project and found a temporary fix. Noticing similar issues (genism version and python 3.12) in your project, I applied the same fix here. I do this to get involved in other projects and learn new things. Thanks!

@tavallaie tavallaie closed this Jun 16, 2024
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 this pull request may close these issues.

2 participants