Enable check-builtin-literals

This commit is contained in:
Pradyun Gedam 2019-09-24 17:15:19 +05:30
parent 0a25c7d4a6
commit 40a0f189b9
No known key found for this signature in database
GPG Key ID: DA17C4B29CB32E4B
4 changed files with 10 additions and 10 deletions

View File

@ -4,7 +4,7 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
# - id: check-builtin-literals # TODO: enable when fixed.
- id: check-builtin-literals
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml

View File

@ -34,7 +34,7 @@ from pip._internal.wheel import Wheel
if MYPY_CHECK_RUNNING:
from typing import (
Any, FrozenSet, Iterable, List, Optional, Set, Text, Tuple,
FrozenSet, Iterable, List, Optional, Set, Text, Tuple, Union,
)
from pip._vendor.packaging.version import _BaseVersion
from pip._internal.collector import LinkCollector
@ -43,7 +43,7 @@ if MYPY_CHECK_RUNNING:
from pip._internal.pep425tags import Pep425Tag
from pip._internal.utils.hashes import Hashes
BuildTag = Tuple[Any, ...] # either empty tuple or Tuple[int, str]
BuildTag = Union[Tuple[()], Tuple[int, str]]
CandidateSortingKey = (
Tuple[int, int, int, _BaseVersion, BuildTag, Optional[int]]
)
@ -511,7 +511,7 @@ class CandidateEvaluator(object):
"""
valid_tags = self._supported_tags
support_num = len(valid_tags)
build_tag = tuple() # type: BuildTag
build_tag = () # type: BuildTag
binary_preference = 0
link = candidate.link
if link.is_wheel:

View File

@ -68,8 +68,8 @@ def check_package_set(package_set, should_ignore=None):
def should_ignore(name):
return False
missing = dict()
conflicting = dict()
missing = {}
conflicting = {}
for package_name in package_set:
# Info about dependencies of package_name

View File

@ -181,10 +181,10 @@ def pip_src(tmpdir_factory):
return to_ignore
# Ignore all compiled files and egg-info.
ignored = list()
for pattern in ["__pycache__", "*.pyc", "pip.egg-info"]:
ignored.extend(fnmatch.filter(names, pattern))
return set(ignored)
ignored = set()
for pattern in ("__pycache__", "*.pyc", "pip.egg-info"):
ignored.update(fnmatch.filter(names, pattern))
return ignored
pip_src = Path(str(tmpdir_factory.mktemp('pip_src'))).joinpath('pip_src')
# Copy over our source tree so that each use is self contained