From 1fb4847fc668484ce60177ec58a2ed49aa81b447 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 7 Dec 2022 16:54:07 +0000 Subject: [PATCH] Fix incompatibility with flake8 6.0 (#21) This PR: - Adds a non-EDM-based test workflow (which fails with the bug identified with #22) - Fixes that bug. Closes #22 --- .github/workflows/run-tests-no-edm.yml | 26 ++++++++++++++++++++++++++ flake8_ets/copyright_header.py | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/run-tests-no-edm.yml diff --git a/.github/workflows/run-tests-no-edm.yml b/.github/workflows/run-tests-no-edm.yml new file mode 100644 index 0000000..0bb31e5 --- /dev/null +++ b/.github/workflows/run-tests-no-edm.yml @@ -0,0 +1,26 @@ +name: Run test suite (no EDM) + +on: [pull_request, workflow_dispatch] + +jobs: + test: + strategy: + matrix: + os: ['ubuntu-latest', 'windows-latest'] + runtime: ['3.8', '3.11'] + + runs-on: ${{ matrix.os }} + + steps: + - name: Clone the source + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python_version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install local package + run: python -m pip install . + - name: Run style checks (including our own style checks) + run: python -m flake8 . + - name: Run tests + run: python -m unittest -v diff --git a/flake8_ets/copyright_header.py b/flake8_ets/copyright_header.py index 58cbc72..0119360 100644 --- a/flake8_ets/copyright_header.py +++ b/flake8_ets/copyright_header.py @@ -188,7 +188,7 @@ def __init__(self, tree, lines): def add_options(cls, option_manager): option_manager.add_option( "--copyright-end-year", - type="int", + type=int, metavar="year", default=datetime.datetime.today().year, parse_from_config=True,