diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0032ff2..a0de71f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Test on: [push, pull_request] jobs: check: + if: github.event_name != 'push' || github.ref != 'refs/heads/devel' runs-on: ubuntu-latest strategy: matrix: @@ -37,6 +38,7 @@ jobs: - if: startsWith(matrix.python, '3') run: pre-commit run -a --show-diff-on-failure test: + if: github.event_name != 'pull_request' || github.head_ref != 'devel' runs-on: ubuntu-latest strategy: matrix: @@ -58,6 +60,7 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} matlab: + if: github.event_name != 'pull_request' || github.head_ref != 'devel' runs-on: [self-hosted, python, cuda, matlab] name: Test matlab & cuda steps: diff --git a/miutil/mlab/__init__.py b/miutil/mlab/__init__.py index 193c92b..46882e8 100644 --- a/miutil/mlab/__init__.py +++ b/miutil/mlab/__init__.py @@ -2,11 +2,15 @@ import re import sys from ast import literal_eval -from functools import lru_cache from os import getenv, path from subprocess import STDOUT, CalledProcessError, check_output from textwrap import dedent +try: + from functools import lru_cache +except ImportError: + from backports.functools_lru_cache import lru_cache + from ..fdio import tmpdir __all__ = ["get_engine"] diff --git a/miutil/mlab/beautify.py b/miutil/mlab/beautify.py index 99ea928..4dcb31f 100755 --- a/miutil/mlab/beautify.py +++ b/miutil/mlab/beautify.py @@ -6,7 +6,7 @@ : Path to `*.m` file """ import logging -from functools import lru_cache, wraps +from functools import wraps from os import path from zipfile import ZipFile @@ -14,7 +14,7 @@ from tqdm.contrib import tmap from ..web import get_file -from . import get_engine +from . import get_engine, lru_cache log = logging.getLogger(__name__) MBEAUTIFIER_REV = "9c3c82387ec3c0fb29e707ebd060e8e2ca9ea6f2" diff --git a/setup.cfg b/setup.cfg index 9a94d1c..2de4924 100644 --- a/setup.cfg +++ b/setup.cfg @@ -79,5 +79,5 @@ profile=black known_first_party=miutil,tests [tool:pytest] -timeout=10 +timeout=15 addopts=-v --tb=short -rxs -W=error --log-level=debug -n=auto --durations=0 --cov=miutil --cov-report=term-missing --cov-report=xml