From 27bea375af65ba48b84d19771f6df5768df81034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Sat, 27 Oct 2018 16:05:31 +0200 Subject: [PATCH] Run py2 tests without fastcache (#42) * Run py2 tests without fastcache * Fix _cache_it fallback --- pyneqsys/core.py | 8 ++------ scripts/ci.sh | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyneqsys/core.py b/pyneqsys/core.py index f3e575e..35ac7bd 100644 --- a/pyneqsys/core.py +++ b/pyneqsys/core.py @@ -21,12 +21,8 @@ warnings.warn("Could not import 'fastcache' (look in PyPI), " "solving of ConditionalNeqSys may be slower.") - class _cache_it: - def __init__(self, *args, **kwargs): - pass - - def __call__(self, fun): - return fun + def _cache_it(fun): + return fun else: _cache_it = lambda f: clru_cache(maxsize=LRU_CACHE_SIZE)(f) else: diff --git a/scripts/ci.sh b/scripts/ci.sh index a129a29..a11f56c 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -17,6 +17,8 @@ python2 setup.py sdist # test pip installable sdist (checks MANIFEST.in) python2 -m pip install --user -e .[all] pysym pykinsol python3 -m pip install --user -e .[all] pysym pykinsol PYTHONPATH=$(pwd) PYTHON=python2 ./scripts/run_tests.sh +python2 -m pip uninstall -y fastcache +PYTHONPATH=$(pwd) PYTHON=python2 ./scripts/run_tests.sh PYTHONPATH=$(pwd) PYTHON=python3 ./scripts/run_tests.sh --cov $PKG_NAME --cov-report html ./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg ! grep "DO-NOT-MERGE!" -R . --exclude ci.sh