mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Enable check-builtin-literals
This commit is contained in:
parent
0a25c7d4a6
commit
40a0f189b9
|
@ -4,7 +4,7 @@ repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.3.0
|
rev: v2.3.0
|
||||||
hooks:
|
hooks:
|
||||||
# - id: check-builtin-literals # TODO: enable when fixed.
|
- id: check-builtin-literals
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
|
|
|
@ -34,7 +34,7 @@ from pip._internal.wheel import Wheel
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
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._vendor.packaging.version import _BaseVersion
|
||||||
from pip._internal.collector import LinkCollector
|
from pip._internal.collector import LinkCollector
|
||||||
|
@ -43,7 +43,7 @@ if MYPY_CHECK_RUNNING:
|
||||||
from pip._internal.pep425tags import Pep425Tag
|
from pip._internal.pep425tags import Pep425Tag
|
||||||
from pip._internal.utils.hashes import Hashes
|
from pip._internal.utils.hashes import Hashes
|
||||||
|
|
||||||
BuildTag = Tuple[Any, ...] # either empty tuple or Tuple[int, str]
|
BuildTag = Union[Tuple[()], Tuple[int, str]]
|
||||||
CandidateSortingKey = (
|
CandidateSortingKey = (
|
||||||
Tuple[int, int, int, _BaseVersion, BuildTag, Optional[int]]
|
Tuple[int, int, int, _BaseVersion, BuildTag, Optional[int]]
|
||||||
)
|
)
|
||||||
|
@ -511,7 +511,7 @@ class CandidateEvaluator(object):
|
||||||
"""
|
"""
|
||||||
valid_tags = self._supported_tags
|
valid_tags = self._supported_tags
|
||||||
support_num = len(valid_tags)
|
support_num = len(valid_tags)
|
||||||
build_tag = tuple() # type: BuildTag
|
build_tag = () # type: BuildTag
|
||||||
binary_preference = 0
|
binary_preference = 0
|
||||||
link = candidate.link
|
link = candidate.link
|
||||||
if link.is_wheel:
|
if link.is_wheel:
|
||||||
|
|
|
@ -68,8 +68,8 @@ def check_package_set(package_set, should_ignore=None):
|
||||||
def should_ignore(name):
|
def should_ignore(name):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
missing = dict()
|
missing = {}
|
||||||
conflicting = dict()
|
conflicting = {}
|
||||||
|
|
||||||
for package_name in package_set:
|
for package_name in package_set:
|
||||||
# Info about dependencies of package_name
|
# Info about dependencies of package_name
|
||||||
|
|
|
@ -181,10 +181,10 @@ def pip_src(tmpdir_factory):
|
||||||
return to_ignore
|
return to_ignore
|
||||||
|
|
||||||
# Ignore all compiled files and egg-info.
|
# Ignore all compiled files and egg-info.
|
||||||
ignored = list()
|
ignored = set()
|
||||||
for pattern in ["__pycache__", "*.pyc", "pip.egg-info"]:
|
for pattern in ("__pycache__", "*.pyc", "pip.egg-info"):
|
||||||
ignored.extend(fnmatch.filter(names, pattern))
|
ignored.update(fnmatch.filter(names, pattern))
|
||||||
return set(ignored)
|
return ignored
|
||||||
|
|
||||||
pip_src = Path(str(tmpdir_factory.mktemp('pip_src'))).joinpath('pip_src')
|
pip_src = Path(str(tmpdir_factory.mktemp('pip_src'))).joinpath('pip_src')
|
||||||
# Copy over our source tree so that each use is self contained
|
# Copy over our source tree so that each use is self contained
|
||||||
|
|
Loading…
Reference in a new issue