diff --git a/.pylintrc b/.pylintrc index 86e005682e..61be1ca41d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -70,6 +70,9 @@ disable=fixme, # disabled as TODOs would show up as warnings no-else-return, # relax "elif" after a clause with a return docstring-first-line-empty, # relax docstring style import-outside-toplevel, + cyclic-import, # This checker raises on all module pairs that import each other, + # even submodules that only import already loaded objects from a + # parent module, a common pattern in qiskit-experiments. assigning-non-slot # https://github.com/Qiskit/qiskit-terra/pull/7347#issuecomment-985007311 diff --git a/qiskit_experiments/framework/experiment_data.py b/qiskit_experiments/framework/experiment_data.py index 3428875086..ba1005ef05 100644 --- a/qiskit_experiments/framework/experiment_data.py +++ b/qiskit_experiments/framework/experiment_data.py @@ -196,7 +196,7 @@ def _repr_svg_(self): return None -_FigureT = Union[str, bytes, MatplotlibFigure, FigureData] +FigureT = Union[str, bytes, MatplotlibFigure, FigureData] class ExperimentData: @@ -1134,7 +1134,7 @@ def data( @do_auto_save def add_figures( self, - figures: Union[_FigureT, List[_FigureT]], + figures: Union[FigureT, List[FigureT]], figure_names: Optional[Union[str, List[str]]] = None, overwrite: bool = False, save_figure: Optional[bool] = None, diff --git a/requirements-dev.txt b/requirements-dev.txt index 0d0200aa7e..e601c014d1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ black~=22.0 stestr -pylint~=2.16.2 -astroid~=2.14.2 # Must be kept aligned to what pylint wants +pylint~=3.0.2 +astroid~=3.0.1 # Must be kept aligned to what pylint wants jinja2==3.0.3 sphinx>=6.2.1,<=7 jupyter-sphinx>=0.4.0 @@ -20,4 +20,4 @@ coverage>=5.5 ipykernel<=6.21.3 jupyter-client<=8.0.3 ipython<8.13.0 ; python_version<"3.9" # for python 3.8 compatibility -sphinx-remove-toctrees \ No newline at end of file +sphinx-remove-toctrees diff --git a/tox.ini b/tox.ini index 658e81e57a..d89db5a70c 100644 --- a/tox.ini +++ b/tox.ini @@ -51,8 +51,8 @@ commands = stestr run {posargs} [testenv:lint] envdir = .tox/lint commands = - black --check {posargs} qiskit_experiments test tools setup.py - pylint -rn -j 0 --rcfile={toxinidir}/.pylintrc qiskit_experiments/ test/ tools/ + black --check qiskit_experiments test tools setup.py + pylint -rn {posargs} --rcfile={toxinidir}/.pylintrc qiskit_experiments/ test/ tools/ python {toxinidir}/tools/verify_headers.py [testenv:lint-incr] @@ -62,7 +62,7 @@ allowlist_externals = git commands = black --check {posargs} qiskit_experiments test tools setup.py -git fetch -q https://github.com/Qiskit-Extensions/qiskit-experiments :lint_incr_latest - python {toxinidir}/tools/pylint_incr.py -rn -j4 -sn --paths :/qiskit_experiments/*.py :/test/*.py :/tools/*.py + python {toxinidir}/tools/pylint_incr.py -rn {posargs} -sn --paths :/qiskit_experiments/*.py :/test/*.py :/tools/*.py python {toxinidir}/tools/verify_headers.py qiskit_experiments test tools [testenv:black] @@ -105,4 +105,4 @@ commands = skip_install = true deps = allowlist_externals = rm -commands = rm -rf {toxinidir}/docs/stubs/ {toxinidir}/docs/_build \ No newline at end of file +commands = rm -rf {toxinidir}/docs/stubs/ {toxinidir}/docs/_build