From ffe3753a655991177bcd53db92d9da63b94dca52 Mon Sep 17 00:00:00 2001 From: "Yashasvi S. Ranawat" Date: Mon, 23 Oct 2023 10:53:10 +0300 Subject: [PATCH] updates workflows for black --- .github/workflows/lint.yml | 14 ++++++++++++++ .github/workflows/python-package.yml | 10 ++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..f194116 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,14 @@ +name: Lint + +on: [push] + +jobs: + lint: + name: Check coding style + runs-on: ubuntu-latest + steps: + # clone repo and check out + - uses: actions/checkout@v3 + + - name: Check that all Python code is linted with black + run: pip install black && black . --check diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f48cdac..3c9d0ab 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v2 @@ -26,15 +26,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install . --upgrade - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | pytest