From 8e3e8399d8cff138666c695179f22d7c875d2f10 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Fri, 4 Dec 2020 15:59:43 +0000 Subject: [PATCH] fix up pre-commit, run in CI --- .github/workflows/test.yml | 19 ++++--------------- .pre-commit-config.yaml | 30 ++++++++---------------------- setup.cfg | 1 + 3 files changed, 13 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dc6f0dfea..bdd5e7ff33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,20 +40,9 @@ jobs: runs-on: ubuntu-latest if: ${{ needs.changes.outputs.changes == 'true' }} steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U black flake8 isort - - name: Check the style - run: | - black -t py36 --check theano/ tests/ setup.py conftest.py - isort --check theano/ tests/ setup.py conftest.py - flake8 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 test: name: "Test py${{ matrix.python-version }}: ${{ matrix.part }}" @@ -63,7 +52,7 @@ jobs: runs-on: ubuntu-latest if: ${{ needs.changes.outputs.changes == 'true' && needs.style.result == 'success' }} strategy: - fail-fast: false + fail-fast: true matrix: python-version: ["3.6", "3.7"] fast-compile: [0] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fbf5ca7cea..1a69879580 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,35 +1,21 @@ +exclude: | + (?x)^( + versioneer\.py| + theano/_version\.py| + doc/.*| + bin/.* + )$ repos: - repo: https://github.com/psf/black rev: 20.8b1 hooks: - id: black language_version: python3 - exclude: | - (?x)^( - versioneer\.py| - theano/_version\.py| - doc/.*| - bin/.* - )$ - repo: https://gitlab.com/pycqa/flake8 rev: 3.8.4 hooks: - id: flake8 - exclude: | - (?x)^( - versioneer\.py| - theano/_version\.py| - doc/.*| - bin/.* - )$ - repo: https://github.com/pycqa/isort - rev: 5.5.2 + rev: 5.6.4 hooks: - id: isort - exclude: | - (?x)^( - versioneer\.py| - theano/_version\.py| - doc/.*| - bin/.* - )$ diff --git a/setup.cfg b/setup.cfg index 5578a09ab8..6bc0c6db1b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ per-file-ignores = tests/gpuarray/test_elemwise.py:E402 tests/gpuarray/test_others.py:E402 tests/gpuarray/test_basic_ops.py:E402 + theano/gof/unify.py:F811 exclude = versioneer.py doc/