This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
Ensure predictable mypy's type-checking rules in CI/CD #265
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.
The type-checking rules should be predictable over time.
Description
mypy
New
mypy
releases sometimes break the CI/CD builds when no significant code changes are introduced to the codebase. The CI/CD builds are expected to succeed as before.Just happened in #262 — a documentation/CRD change, that got
asyncio.wait()
type-checks inkopf.reactor.running
broken. A broken build: https://travis-ci.org/zalando-incubator/kopf/builds/620169471Caused by a regression in
mypy==0.750
with type inference (python/mypy#8051). The fix is going to be released 1 month after the regression was introduced: 21.11.2019 .. 16.12.2019. We cannot afford to wait 1 month with a broken CI/CD pipeline.Previously, there were similar sudden changes in
mypy
with new rules in a new mypy release: e.g. #208.It is expected that such backward-incompatible changes or regressions will be introduced in the future too — due to active development of
mypy
. So, since now, we keep the version pinned, and upgrade it explicitly as a separate PR (manual or maybe automatic) — possibly with relevant code changes to satisfy new type-checking rules.urllib3
The urllib3 version ceiling was introduced in May 2019 in a256445 — due to setuptools/pkg_resources version conflicts and inability to run the CI/CD scripts. This ceiling was applied only to our own CI/CD. The apps were free to handle these issues their own way.
The issue seems to be fixed in psf/requests#5067 in April 2019.
Types of Changes