Be less strict about the copyright end year#596
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses the problem of CI failures at the start of each new year due to outdated copyright headers. It introduces a two-tier approach: a regular style check that allows copyright years from the previous year, and a separate strict style check that requires current-year copyrights but doesn't block PR merges.
Changes:
- Split copyright year validation into permissive (merge-blocking) and strict (non-blocking) workflows
- Update Python version in style-checking workflows from 3.11 to 3.14
- Add
.venvdirectory to flake8 exclusions for improved local development experience
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/check-style.yml | Modified to use Python 3.14 and hard-code copyright end year to 2025, making checks less strict |
| .github/workflows/check-style-strict.yml | New workflow that enforces current-year copyright headers without blocking merges |
| .flake8 | Added .venv to excluded directories for better compatibility with modern Python tooling like uv |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - run: python -m pip install -r .github/workflows/style-requirements.txt | ||
| - run: | | ||
| python -m black --check --diff . | ||
| python -m isort --check --diff . |
There was a problem hiding this comment.
The hard-coded copyright year 2025 will need to be manually updated each year to stay one year behind the current year. Consider adding a comment or documentation noting that this value should be updated annually (e.g., to 2026 at the start of 2027) to maintain the intended behavior of allowing PRs to be merged in the new year before all copyright headers are updated.
| python -m isort --check --diff . | |
| python -m isort --check --diff . | |
| # NOTE: Keep this one year behind the current year (e.g., set to 2026 at the start of 2027) |
There was a problem hiding this comment.
Hmm. That's not really the intent. An explanatory comment would make some sense, though.
Issue: on many of our ETS repositories, we have a check for the copyright end year. However, that means that when each new year rolls around, whichever PR is first created in that new year can't be merged (e.g., see #594 on this repository), because of the failed style check resulting from out-of-date copyright years.
This PR attempts to fix that issue by hard-coding the current copyright end year in the style-check workflow, and having a separate "strict" workflow that requires the copyright end year to match the current year. The idea is that the regular style check gets applied to PRs as usual, and is required to pass for PR merge, while the strict style check still runs (so we still get a prominent red cross in our CI run results) but doesn't prevent merge.
The goal is that the arrival of a new year doesn't abruptly turn passing CI into failing CI. The strict style check should still be required to pass before any release of the package.
While we're touching the workflows, we also update the version of Python used to 3.14, and exclude any
.venvdirectory from flake8 checks (useful if you're usinguvto create a venv locally).Note: the solution is a little bit awkward: I would have liked to include the
copyright-end-yearin the config file and overridden it in the workflows. But we can't give a value forcopyright-end-yearthat means "use the current year". In hindsight, that would have been useful to have.