Skip to content

Be less strict about the copyright end year#596

Merged
mdickinson merged 5 commits intomainfrom
be-less-strict-about-copyright-end-year
Feb 24, 2026
Merged

Be less strict about the copyright end year#596
mdickinson merged 5 commits intomainfrom
be-less-strict-about-copyright-end-year

Conversation

@mdickinson
Copy link
Member

@mdickinson mdickinson commented Feb 23, 2026

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 .venv directory from flake8 checks (useful if you're using uv to create a venv locally).

Note: the solution is a little bit awkward: I would have liked to include the copyright-end-year in the config file and overridden it in the workflows. But we can't give a value for copyright-end-year that means "use the current year". In hindsight, that would have been useful to have.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .venv directory 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 .
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. That's not really the intent. An explanatory comment would make some sense, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented in 3d94205

@mdickinson mdickinson merged commit a933c1e into main Feb 24, 2026
12 checks passed
@mdickinson mdickinson deleted the be-less-strict-about-copyright-end-year branch February 24, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants