Skip to content

Pin flake8 - #1781

Merged
victorlin merged 2 commits into
masterfrom
victorlin/pin-flake8
Apr 3, 2025
Merged

Pin flake8#1781
victorlin merged 2 commits into
masterfrom
victorlin/pin-flake8

Conversation

@victorlin

@victorlin victorlin commented Apr 3, 2025

Copy link
Copy Markdown
Member

Description of proposed changes

Flake8 was previously unpinned which led to a linting error in the latest 7.2.0 release, as noted in #1756 (comment). This PR initially pins to <7.2.0, then since there is only one linting error, I went ahead and fixed it, relaxing the pin. It should still be beneficial to use new flake8 versions. We can always tighten the pin to not install a specific version if new errors become annoying.

Checklist

  • Automated checks pass
  • Check if you need to add a changelog message dev change
  • Check if you need to add tests
  • Check if you need to update docs

7.2.0 introduces a new rule on unused globals/nonlocals (F824) which
will be addressed separately.
Address the F824 rule violation and update the pin to major version 7.
@victorlin victorlin self-assigned this Apr 3, 2025
@victorlin
victorlin merged commit 8d575c3 into master Apr 3, 2025
@victorlin
victorlin deleted the victorlin/pin-flake8 branch April 3, 2025 18:50
Comment thread setup.py
"cram >=0.7",
"deepdiff >=4.3.2, <8.0.0",
"flake8",
"flake8 >=7.0.0, <8",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The error which prompted this PR was due to 7.1.2 to 7.2.0 bump, so wouldn't this pin not have prevented the CI failure and thus keep the door open to future similar issues?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, but I think it's still useful to have new flake8 versions. Note that Nextstrain CLI has no upper pin on most dev deps, including flake8. But maybe, related to #1557, we should pin exact and update ~regularly?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with the desire to keep current for deps such as these. But having CI fail like it did in #1756 (comment) isn't good for development and should be avoided. A better approach would be a dependebot-like PR for flake8 upgrades.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is well-suited for #1538. I'll try to revisit that PR sometime.

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.

3 participants