From 910c779e1ae364f2ebad90a81edb42b3796ae93b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 5 Dec 2016 20:15:58 -0600 Subject: [PATCH] Run flake8 during CI --- .gitlab-ci.yml | 12 ++++++++++++ leap/multistep/multirate/__init__.py | 2 +- leap/stability.py | 1 + test/test_codegen_fortran.py | 1 + test/test_misc.py | 1 + test/test_step_matrix.py | 6 +++--- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93c3feb..9de2125 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ Python 2.7: - python2.7 except: - tags + Python 3.5: script: - py_version=3.5 @@ -18,6 +19,7 @@ Python 3.5: - python3.5 except: - tags + Python 2.6: script: - py_version=2.6 @@ -28,6 +30,7 @@ Python 2.6: - python2.6 except: - tags + Documentation: script: - EXTRA_INSTALL="numpy" @@ -37,3 +40,12 @@ Documentation: - python3.5 only: - master + +Flake8: + script: + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh + - ". ./prepare-and-run-flake8.sh leap test" + tags: + - python3.5 + except: + - tags diff --git a/leap/multistep/multirate/__init__.py b/leap/multistep/multirate/__init__.py index aabf3af..cbd79da 100644 --- a/leap/multistep/multirate/__init__.py +++ b/leap/multistep/multirate/__init__.py @@ -50,7 +50,7 @@ __doc__ = """ # {{{ system description -class rhs_policy: +class rhs_policy: # noqa """ .. attribute:: late .. attribute:: early diff --git a/leap/stability.py b/leap/stability.py index f8dc530..3cd8952 100644 --- a/leap/stability.py +++ b/leap/stability.py @@ -32,6 +32,7 @@ __doc__ = """ .. autofunction:: find_stability_region """ + def is_stable(integrator_cls, k): def f(t, y): return k*y diff --git a/test/test_codegen_fortran.py b/test/test_codegen_fortran.py index a198ce2..d04a517 100755 --- a/test/test_codegen_fortran.py +++ b/test/test_codegen_fortran.py @@ -530,6 +530,7 @@ def test_multirate_squarewave(min_order, method_name): ], fortran_options=["-llapack", "-lblas"]) + if __name__ == "__main__": if len(sys.argv) > 1: exec(sys.argv[1]) diff --git a/test/test_misc.py b/test/test_misc.py index 9f79ffd..244d2a6 100644 --- a/test/test_misc.py +++ b/test/test_misc.py @@ -91,6 +91,7 @@ def test_strang_splitting(plot_solution=False): orderest = eocrec.estimate_order_of_convergence()[0, 1] assert orderest > 2 * 0.9 + if __name__ == "__main__": if len(sys.argv) > 1: exec(sys.argv[1]) diff --git a/test/test_step_matrix.py b/test/test_step_matrix.py index f37380b..0c0d77e 100755 --- a/test/test_step_matrix.py +++ b/test/test_step_matrix.py @@ -130,7 +130,7 @@ def test_step_matrix_vector_state(show_matrix=True, show_dag=False): component_id = 'y' code = euler(component_id, show_dag) - J = np.diag([-3, -2, -1]) + J = np.diag([-3, -2, -1]) # noqa def rhs_sym(t, y): return J.dot(y) @@ -159,7 +159,7 @@ def test_step_matrix_fast_eval(): component_id = 'y' code = euler(component_id, show_dag=False) - J = np.diag([-3, -2, -1]) + J = np.diag([-3, -2, -1]) # noqa def rhs_sym(t, y): return J.dot(y) @@ -181,7 +181,7 @@ def test_step_matrix_sparse(): component_id = 'y' code = euler(component_id, show_dag=False) - J = np.diag([-3, -2, -1]) + J = np.diag([-3, -2, -1]) # noqa def rhs_sym(t, y): return J.dot(y) -- GitLab