Skip to content

Add Python 3.13 support#40

Open
sidnarayanan wants to merge 1 commit into
MolecularAI:mainfrom
EdisonScientific:modern-python
Open

Add Python 3.13 support#40
sidnarayanan wants to merge 1 commit into
MolecularAI:mainfrom
EdisonScientific:modern-python

Conversation

@sidnarayanan
Copy link
Copy Markdown

Hi, I was trying to use aizynthfinder in 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:

  • Conditionally pin numpy and rdkit if python>3.12
  • Deal with a numpy 2 data type issue and a function signature change in rdkit 2024+
  • Some test case targets changed in rdkit 2024+

* 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.
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.

1 participant