From b9bfc48c5001d2525ced3e4fe40ae385fac75438 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 19 Jun 2024 16:44:42 +0200 Subject: [PATCH 1/2] Disallow skipped tests in fulltest environment --- pyproject.toml | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 68bd51110..3d3755024 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -138,6 +138,7 @@ test = [ "hypothesis[pandas]>=6.88.4", "pytest>=7.2.0", "pytest-cov>=4.1.0", + "pytest-error-for-skips", ] [build-system] diff --git a/tox.ini b/tox.ini index 926130ed4..9edb3cedb 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ setenv = BAYBE_TEST_ENV = FULLTEST commands = python --version - pytest -p no:warnings --cov=baybe --durations=5 {posargs} + pytest -p no:warnings --cov=baybe --durations=5 --error-for-skips {posargs} [testenv:coretest,coretest-py{310,311,312}] description = Run PyTest with core functionality From 4eac455181c3be8c566afbee9ea1a87b2b94d6a4 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 17 Jun 2024 18:31:28 +0200 Subject: [PATCH 2/2] Fix optional dependency flags --- baybe/_optional/info.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/baybe/_optional/info.py b/baybe/_optional/info.py index bbff10504..fbe947d6c 100644 --- a/baybe/_optional/info.py +++ b/baybe/_optional/info.py @@ -27,14 +27,21 @@ def exclude_sys_path(path: str, /): # noqa: DOC402, DOC404 FLAKE8_INSTALLED = find_spec("flake8") is not None MORDRED_INSTALLED = find_spec("mordred") is not None ONNX_INSTALLED = find_spec("onnxruntime") is not None - PRE_COMMIT_INSTALLED = find_spec("pre-commit") is not None + PRE_COMMIT_INSTALLED = find_spec("pre_commit") is not None PYDOCLINT_INSTALLED = find_spec("pydoclint") is not None RDKIT_INSTALLED = find_spec("rdkit") is not None RUFF_INSTALLED = find_spec("ruff") is not None STREAMLIT_INSTALLED = find_spec("streamlit") is not None - TYPOS_INSTALLED = find_spec("typos") is not None XYZPY_INSTALLED = find_spec("xyzpy") is not None +# TODO: `find_spec` does not work for `typos` (probably because it's a rust package), +# neither seem any versions of `pip show typos` / `pip freeze | grep typos` / +# `any(pkg.name == "typos" for pkg in pkgutils.iter_modules())` called as a subprocess +# work in CI (probably because stuff is running inside tox and/or paths need to be +# configured properly). As a temporary workaround – since the test collection does not +# directly depend on the flag – we thus simply set it to `True`. +TYPOS_INSTALLED = True + # Package combinations CHEM_INSTALLED = MORDRED_INSTALLED and RDKIT_INSTALLED LINT_INSTALLED = all(