Skip to content

Commit

Permalink
Update RDKit versions used in tests (#1942)
Browse files Browse the repository at this point in the history
* Test new RDKit constraint

* Fix merge

* Work around another bug ... ?

* Updates for RDKit changes

* Don't trust RDKit stubs

* Cleanup, shuffle dependencies

* Ignore mypy errors in (skipped) RDKit wrapper

* un-xfail mols that now pass in to_from_rdkit tests due to stereo handling updates in rdkit

* test configuration housekeeping

* update releasehistory

---------

Co-authored-by: Jeffrey Wagner <[email protected]>
  • Loading branch information
mattwthompson and j-wags authored Oct 4, 2024
1 parent df251d3 commit 6aa989e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 14 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ jobs:
run: pytest -r fE --tb=short openff/toolkit/_tests/test_links.py

- name: Run mypy
# subtle differences in Python/mypy versions, just keep it passing on one
if: ${{ matrix.rdkit == true && matrix.openeye && matrix.python-version == 3.10 }}
# Subtle differences in Python/mypy versions, just keep it passing on one.
# When possible re-enable this with OE+RDK=True, but for now rdkit builds often have bugs
# in stubs and there are other subtleties (in the source code and builds) that reduce the number
# of available builds.
# See ex https://github.com/rdkit/rdkit/issues/7221
if: ${{ matrix.rdkit == false && matrix.openeye && matrix.python-version == 3.10 }}
run: mypy -p "openff.toolkit"

- name: Run unit tests
Expand Down
10 changes: 10 additions & 0 deletions devtools/conda-envs/openeye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ dependencies:
- mdtraj
- nglview
- parmed =3
- mypy
- typing_extensions
- pip:
- types-setuptools
- types-toml
- types-PyYAML
- types-networkx
- types-xmltodict
- types-cachetools
- mongo-types
4 changes: 2 additions & 2 deletions devtools/conda-envs/rdkit-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ dependencies:
# AmberTools 23 brings in ParmEd 4, which doesn't yet work with examples
# https://github.com/openforcefield/openff-toolkit/issues/1532
- ambertools =22.4
# https://github.com/rdkit/rdkit/issues/7221
- rdkit <2023.09.6
# https://github.com/rdkit/rdkit/issues/7221 and https://github.com/rdkit/rdkit/issues/7583
- rdkit !=2024.03.6,!=2024.03.5
# Test-only/optional/dev/typing/examples
- pytest
- pytest-xdist
Expand Down
4 changes: 2 additions & 2 deletions devtools/conda-envs/rdkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ dependencies:
- typing_extensions
# Toolkit-specific
- ambertools >=22
# https://github.com/rdkit/rdkit/issues/7221
- rdkit <2023.09.6
# https://github.com/rdkit/rdkit/issues/7221 and https://github.com/rdkit/rdkit/issues/7583
- rdkit !=2024.03.6,!=2024.03.5
# Test-only/optional/dev/typing
- pytest
- pytest-cov
Expand Down
9 changes: 6 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
# Base depends
- python
- pip
- pydantic =1
- packaging
- numpy
- networkx
Expand All @@ -24,8 +24,12 @@ dependencies:
- openff-nagl-models ==0.3.0
# Toolkit-specific
- ambertools >=22
# rdkit 2024.03.6 and 2024.09.1 packages fail when run natively on osx-arm64 macs
# https://github.com/rdkit/rdkit/issues/7583
# and a bad stub (causing mypy failure only)
# https://github.com/rdkit/rdkit/issues/7221
- rdkit <2023.09.6
- rdkit !=2024.03.6,!=2024.09.1

- openeye-toolkits
# Test-only/optional/dev/typing
- pytest
Expand All @@ -47,7 +51,6 @@ dependencies:
- nomkl
- mypy
- typing_extensions
- pydantic =1
- pip:
- types-setuptools
- types-toml
Expand Down
4 changes: 4 additions & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Releases follow the `major.minor.micro` scheme recommended by [PEP440](https://w

### Improved documentation and warnings

### Tests updated
- [PR #1942](https://github.com/openforcefield/openff-toolkit/pull/1942): Update tests for newer versions of RDKit, while stepping around recent RDKit conda-forge packages that fail when run natively on osx-arm64.


## 0.16.5

### Improved documentation and warnings
Expand Down
4 changes: 1 addition & 3 deletions openff/toolkit/_tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def mini_drug_bank(xfail_mols=None, wip_mols=None):
"DrugBank_6531",
}

# All the molecules that raise UndefinedStereochemistryError when read by OETK().
# All the molecules that raise UndefinedStereochemistryError when read by RDKTKW().
# Note that this list is different from that for OEMol,
# since the toolkits have different definitions of "stereogenic"
rdkit_drugbank_undefined_stereo_mols = {
Expand All @@ -261,8 +261,6 @@ def mini_drug_bank(xfail_mols=None, wip_mols=None):
"DrugBank_3930",
"DrugBank_5043",
"DrugBank_5418",
"DrugBank_7124",
"DrugBank_6865",
}


Expand Down
2 changes: 0 additions & 2 deletions openff/toolkit/_tests/test_toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ def get_mini_drug_bank(toolkit_class, xfail_mols=None):
"DrugBank_1962",
"DrugBank_5043",
"DrugBank_2519",
"DrugBank_7124",
"DrugBank_6865",
]

openeye_iupac_bad_stereo = [
Expand Down
1 change: 1 addition & 0 deletions openff/toolkit/utils/rdkit_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# mypy: ignore-errors
"""
Wrapper class providing a minimal consistent interface to the `RDKit <http://www.rdkit.org/>`.
"""
Expand Down

0 comments on commit 6aa989e

Please sign in to comment.