From cf6ecab62729cd361e5913bfa0132d104ec11ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Mon, 12 Oct 2020 17:36:51 +0700 Subject: [PATCH] Bump mypy to 0.790 for Python 3.9 compat HashError.order is now annotated as an int to allow HashErrors.errors.sort(key=lambda e: e.order). Alternatively we can define a function which assert e is not None but I prefer the more concise version, since we never raise HashError directly anyway. --- .pre-commit-config.yaml | 2 +- src/pip/_internal/exceptions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 13b3abc62bd..838b1f24ebe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: files: \.py$ - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.770 + rev: v0.790 hooks: - id: mypy exclude: docs|tests diff --git a/src/pip/_internal/exceptions.py b/src/pip/_internal/exceptions.py index 62bde1eeda4..56482caf77b 100644 --- a/src/pip/_internal/exceptions.py +++ b/src/pip/_internal/exceptions.py @@ -200,7 +200,7 @@ class HashError(InstallationError): """ req = None # type: Optional[InstallRequirement] head = '' - order = None # type: Optional[int] + order = -1 # type: int def body(self): # type: () -> str