Add Python 3.13 support - #40
Open
sidnarayanan wants to merge 1 commit into
Open
Conversation
* Bump python upper bound to <3.14 in pyproject.toml and env-dev.yml. * Use per-Python-version pins for numpy and rdkit so 3.9-3.12 users keep numpy<2 / rdkit ^2023.9.1 (no degradation), while 3.13 picks up numpy>=2.1 / rdkit>=2024.9.1 (the first versions with cp313 wheels). * SCScore._make_fingerprint: use DataStructs.ConvertToNumpyArray instead of np.array(bitvect, dtype=float). The latter segfaults under rdkit>=2026 + numpy>=2. * TemplateMolecule.atom_properties: swallow Boost.Python.ArgumentError from RDKit getters whose signatures changed in rdkit>=2024 (e.g. Atom.GetValence now requires a ValenceType arg). * Mark a handful of template/hash tests xfail on Python 3.13 because rdkit>=2024 produces different fingerprint hashes / template SMARTS for those inputs. Tests: 287 pass / 0 fail on Python 3.12 (baseline preserved); 282 pass / 6 xfail / 3 xpass on Python 3.13.
CKannas
requested changes
Jul 21, 2026
CKannas
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for your work to make reaction-utils to work for Python 3.13 and newer.
There are some points we should address to make this working for all supported combinations.
Collaborator
There was a problem hiding this comment.
To correctly support Python 3.9 to 3.13, the following version restrictions must be placed:
- RDKit:
- For Python
>=3.9,<3.13it should be>=2023.9.1,<2024.9.1. - For Python
>=3.13,<3.14it should be>=2024.9.1, because from2024.9.1Python3.13is supported (2025.9.1and newer support3.14)
- For Python
- SciPy:
- For Python
>=3.9,<3.13it should be>=1.11.4,<1.14.1. - For Python
>=3.13,<3.14it should be>=1.14.1.
- For Python
- NumPy:
- For Python
>=3.9,<3.13it should be>=1.0.0,<2.0.0. - For Python
>=3.13,<3.14it should be>=2.0.0, RDKit >= 2024.9.1 supports NumPy 2.0.
- For Python
- ONNXRuntime:
- For Python
>=3.9,<3.12it should be<1.17.0. - For Python
>=3.12it should be>=1.17.0.
- For Python
Collaborator
There was a problem hiding this comment.
The fingerprint changes are valid from RDKit 2025.9.2.
The valence error for Al is valid from RDKit 2024.9.1.
The chirality of the two molecules is the same only from RDKit 2024.9.3.
| dependencies: | ||
| - python>=3.9,<3.13 | ||
| - python>=3.9,<3.14 | ||
| - poetry>=1.2.0,<2.0 |
Collaborator
There was a problem hiding this comment.
Maybe it will be best to pin poetry to 2.4.0.
Suggested change
| - poetry>=1.2.0,<2.0 | |
| - poetry=2.4.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I was trying to use
aizynthfinderin a Python 3.13 environment and ran into the version pin. I can open a follow-up PR to that repo if this one is accepted and released.The main changes were:
python>3.12