From c9cd63a861bbffec91080b396cae34a40d160e08 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Tue, 21 Jul 2026 11:39:18 +0100 Subject: [PATCH] Use "current" copyright-end-year in the strict style check Follow-up cleanup to #370, mirroring enthought/envisage#607. ets-copyright-checker (flake8-ets) 1.1.0 now supports --copyright-end-year current, so we can pin the buffered end year in one place and have the strict check use the current year: - Pin the buffered copyright end year in setup.cfg (copyright-end-year = 2026), as the single source of truth for both the merge-blocking style check and local flake8 runs. - Drop the --copyright-end-year override (and the now-unused EXPECTED_COPYRIGHT_END_YEAR constant) from the merge-blocking etstool.py flake8 check; it just runs flake8 now. - Have the strict style check override the pinned value with --copyright-end-year current to report out-of-date copyright end years. Pins flake8-ets >= 1.1.0, since the "current" value is only available from that release. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/check-style-strict.yml | 5 ++--- .github/workflows/style-requirements.txt | 2 +- etstool.py | 6 ------ setup.cfg | 2 ++ 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check-style-strict.yml b/.github/workflows/check-style-strict.yml index 4fd4252b..c5fe1878 100644 --- a/.github/workflows/check-style-strict.yml +++ b/.github/workflows/check-style-strict.yml @@ -14,6 +14,5 @@ jobs: cache: 'pip' cache-dependency-path: '.github/workflows/style-requirements.txt' - run: python -m pip install -r .github/workflows/style-requirements.txt - - run: | - # Report on out-of-date copyright years. - python -m flake8 --select H102 . + - name: Report on out-of-date copyright end years + run: python -m flake8 --select H102 --copyright-end-year current . diff --git a/.github/workflows/style-requirements.txt b/.github/workflows/style-requirements.txt index 1bdb38a4..692dec85 100644 --- a/.github/workflows/style-requirements.txt +++ b/.github/workflows/style-requirements.txt @@ -1,2 +1,2 @@ flake8 -flake8-ets +flake8-ets >= 1.1.0 diff --git a/etstool.py b/etstool.py index 2d851073..98ab48f2 100644 --- a/etstool.py +++ b/etstool.py @@ -94,11 +94,6 @@ #: Default Python version to use. DEFAULT_RUNTIME = "3.8" -#: Copyright end year expected by the merge-blocking style check. We hard-code -#: this (rather than using the current year) to give us a buffer on CI failures -#: when January 1st rolls around. -EXPECTED_COPYRIGHT_END_YEAR = 2026 - def edm_dependencies(runtime): """ @@ -318,7 +313,6 @@ def flake8(edm, runtime, environment): ] commands = [ "{edm} run -e {environment} -- python -m flake8 " - f"--copyright-end-year {EXPECTED_COPYRIGHT_END_YEAR} " + " ".join(targets) ] execute(commands, parameters) diff --git a/setup.cfg b/setup.cfg index c0076014..1e7a2a99 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,7 @@ [flake8] ignore = E266, W503 +# Pin the year so style checks don't fail when the year rolls over. +copyright-end-year = 2026 per-file-ignores = */api.py:F401, */__init__.py:F401,