From 5dc3e30f51e3dc93e5d88c0c0f7568f843633e46 Mon Sep 17 00:00:00 2001 From: Abel Legese <73869888+Abellegese@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:57:15 +0300 Subject: [PATCH] py3.12 incompatibility with scipy and rdkit update (#1500) * fix: rdkit-dependency-failure-on-py3.12 * scipy version update to be * --------- Co-authored-by: Dhanshree Arora --- pyproject.toml | 5 ++--- test/cli/test_run.py | 10 +++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1d23352cb..e66e5577c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,8 +59,7 @@ pytest-benchmark = { version = "<=4.0.0", optional = true } fuzzywuzzy = { version = "^0.18.0", optional = true } sphinx = { version = ">=6.0.0", optional = true } # for minimum version and support for Python 3.10 jinja2 = { version = "^3.1.2", optional = true } -scipy = { version = "<=1.10.0", optional = true } -rdkit-pypi = { version = "*", optional = true } +scipy = { version = "*", optional = true } nox = { version = "*", optional = true } rich = { version = "*", optional = true } ruff = { version = "*", optional = true } @@ -70,7 +69,7 @@ pre-commit = { version = "*", optional = true } # Instead of using poetry dependency groups, we use extras to make it pip installable lake = ["isaura"] docs = ["sphinx", "jinja2"] -test = ["pytest", "pytest-asyncio", "pytest-benchmark", "nox", "rich", "fuzzywuzzy", "scipy", "rdkit-pypi", "ruff", "pre-commit"] +test = ["pytest", "pytest-asyncio", "pytest-benchmark", "nox", "rich", "fuzzywuzzy", "scipy", "ruff", "pre-commit"] #all = [lake, docs, test] [tool.poetry.scripts] diff --git a/test/cli/test_run.py b/test/cli/test_run.py index 4fc77fb44..f5d059665 100644 --- a/test/cli/test_run.py +++ b/test/cli/test_run.py @@ -9,6 +9,10 @@ from ersilia.core.model import ErsiliaModel from ersilia.core.session import Session from ersilia.serve.standard_api import StandardCSVRunApi +from ersilia.setup.requirements.compound import ( + ChemblWebResourceClientRequirement, + RdkitRequirement, +) from ersilia.utils.logging import logger from .utils import create_compound_input_csv @@ -24,6 +28,10 @@ MAX_WEIGHT = 60.0 HEADER = ["key", "input", "value"] +@pytest.fixture +def setup(): + RdkitRequirement() + ChemblWebResourceClientRequirement() @pytest.fixture def mock_fetcher(): @@ -119,7 +127,7 @@ def mock_post_side_effect(input, output, output_source): @pytest.fixture -def mock_session(compound_csv): +def mock_session(setup, compound_csv): with ( patch.object(Session, "current_model_id", return_value=MODEL_ID), patch.object(Session, "current_service_class", return_value="pulled_docker"),