Skip to content

Commit

Permalink
fix rdkit version check on install
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouy committed Nov 17, 2022
1 parent a36b470 commit 65acfa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
import versioneer

GITHUB_ACTIONS = os.environ.get("GITHUB_ACTIONS", False)
READTHEDOCS = os.environ.get("READTHEDOCS", False)

# manually check RDKit version
try:
from rdkit import __version__ as rdkit_version
except ImportError:
if not GITHUB_ACTIONS:
if not (GITHUB_ACTIONS or READTHEDOCS):
raise ImportError("ProLIF requires RDKit but it is not installed")
else:
if re.match(r"^20[0-1][0-9]\.", rdkit_version):
raise ValueError("ProLIF requires a version of RDKit >= 2020")
if re.match(r"^(20[0-1][0-9])|(2020)", rdkit_version):
raise ValueError("ProLIF requires a version of RDKit >= 2021")

setup(version=versioneer.get_version())

0 comments on commit 65acfa0

Please sign in to comment.