Revert "Don't depend on flake8 at runtime (#6830)" #7836
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I realized I forgot to update the
.python-version
file to3.8
, so we're still installing an olderflake8
version. And it's also breaking when runs ondependabot-core
because it sees this3.7
and says "that's not a supported version!"Furthermore, we haven't configured to watch the
./requirements.txt
which is separate from./python/helpers/requirements.txt
.I started to update both of those but the complexity here didn't smell right. This way of installing
flake8
is actually different than linters for other native helpers, where we just include them incomposer.json
,package.json
, etc. So the intuitive thing is to installflake8
into./python/helpers/requirements.txt
.In fact we used to do this, but in
#6830 / f407685 we switched to this new method because
flake8
dropped3.6
support before we were ready to do that here in .Given that in we're moving toward aligning our support policies with upstream Python... ie, when they EOL a version, we will also drop support for it, then the risk of having a
flake8
version that's dropping support for a Python version that isn't yet EOL is quite small.Interestingly,
flake8
was very slow to drop3.6
, but when they did, the maintainer also dropped3.7
to save himself time even though it was a few months before it was EOL'd. So we could hit this scenario again... but I think the odds of that are somewhat low given the amount of blowback the maintainer got about dropping 3.7 before it was EOL'd. And regardless the consequences are also low... we'd simply revert thatflake8
version bump and temporarily hold it back for a few months until the upstream python version was dropped.Overall this feels like six one way, half a dozen the other as either way we are protecting against something. But switching back to how we do it for our other native helpers is both much simpler setup and also more internally consistent.
So let's solve this by reverting back to the simpler way of installing the linter alongside the helper.
As an aside, restoring this simplicity is yet another win from us choosing to align with upstream Python's EOL policy.
This reverts commit f407685.