Browse Source

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.
tags/20.3b1
Nguyễn Gia Phong 1 month ago
parent
commit
cf6ecab627
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      .pre-commit-config.yaml
  2. +1
    -1
      src/pip/_internal/exceptions.py

+ 1
- 1
.pre-commit-config.yaml View File

@@ -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


+ 1
- 1
src/pip/_internal/exceptions.py View File

@@ -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


Loading…
Cancel
Save