The following issues were found
pipenv/vendor/attr/__init__.py
12 issues
Line: 8
Column: 1
from functools import partial
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Attribute,
Reported by Pylint.
Line: 9
Column: 1
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Attribute,
Factory,
Reported by Pylint.
Line: 10
Column: 1
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Attribute,
Factory,
attrib,
Reported by Pylint.
Line: 11
Column: 1
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Attribute,
Factory,
attrib,
attrs,
Reported by Pylint.
Line: 22
Column: 1
make_class,
validate,
)
from ._version_info import VersionInfo
__version__ = "21.2.0"
__version_info__ = VersionInfo._from_version_string(__version__)
Reported by Pylint.
Line: 76
Column: 5
]
if sys.version_info[:2] >= (3, 6):
from ._next_gen import define, field, frozen, mutable
__all__.extend((define, field, frozen, mutable))
Reported by Pylint.
Line: 7
Column: 1
from functools import partial
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Reported by Pylint.
Line: 7
Column: 1
from functools import partial
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Reported by Pylint.
Line: 7
Column: 1
from functools import partial
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Reported by Pylint.
Line: 7
Column: 1
from functools import partial
from . import converters, exceptions, filters, setters, validators
from ._cmp import cmp_using
from ._config import get_run_validators, set_run_validators
from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
from ._make import (
NOTHING,
Reported by Pylint.
pipenv/vendor/wheel/util.py
12 issues
Line: 7
Column: 17
if sys.version_info[0] < 3:
text_type = unicode # noqa: F821
StringIO = io.BytesIO
def native(s, encoding='utf-8'):
if isinstance(s, unicode): # noqa: F821
Reported by Pylint.
Line: 12
Column: 26
StringIO = io.BytesIO
def native(s, encoding='utf-8'):
if isinstance(s, unicode): # noqa: F821
return s.encode(encoding)
return s
else:
text_type = str
Reported by Pylint.
Line: 1
Column: 1
import base64
import io
import sys
if sys.version_info[0] < 3:
text_type = unicode # noqa: F821
StringIO = io.BytesIO
Reported by Pylint.
Line: 11
Column: 5
StringIO = io.BytesIO
def native(s, encoding='utf-8'):
if isinstance(s, unicode): # noqa: F821
return s.encode(encoding)
return s
else:
text_type = str
Reported by Pylint.
Line: 11
Column: 5
StringIO = io.BytesIO
def native(s, encoding='utf-8'):
if isinstance(s, unicode): # noqa: F821
return s.encode(encoding)
return s
else:
text_type = str
Reported by Pylint.
Line: 16
Column: 5
return s.encode(encoding)
return s
else:
text_type = str
StringIO = io.StringIO
def native(s, encoding='utf-8'):
if isinstance(s, bytes):
Reported by Pylint.
Line: 20
Column: 5
StringIO = io.StringIO
def native(s, encoding='utf-8'):
if isinstance(s, bytes):
return s.decode(encoding)
return s
Reported by Pylint.
Line: 20
Column: 5
StringIO = io.StringIO
def native(s, encoding='utf-8'):
if isinstance(s, bytes):
return s.decode(encoding)
return s
Reported by Pylint.
Line: 37
Column: 1
return base64.urlsafe_b64decode(data + pad)
def as_unicode(s):
if isinstance(s, bytes):
return s.decode('utf-8')
return s
Reported by Pylint.
Line: 37
Column: 1
return base64.urlsafe_b64decode(data + pad)
def as_unicode(s):
if isinstance(s, bytes):
return s.decode('utf-8')
return s
Reported by Pylint.
pipenv/patched/notpip/_internal/req/req_tracker.py
12 issues
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
from __future__ import absolute_import
import contextlib
import errno
import hashlib
import logging
Reported by Pylint.
Line: 27
Column: 1
@contextlib.contextmanager
def update_env_context_manager(**changes):
# type: (str) -> Iterator[None]
target = os.environ
# Save values from the target and change them.
non_existent_marker = object()
Reported by Pylint.
Line: 49
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
if original_value is non_existent_marker:
del target[name]
else:
assert isinstance(original_value, str) # for mypy
target[name] = original_value
@contextlib.contextmanager
def get_requirement_tracker():
Reported by Bandit.
Line: 54
Column: 1
@contextlib.contextmanager
def get_requirement_tracker():
# type: () -> Iterator[RequirementTracker]
root = os.environ.get('PIP_REQ_TRACKER')
with contextlib2.ExitStack() as ctx:
if root is None:
root = ctx.enter_context(
Reported by Pylint.
Line: 69
Column: 1
yield tracker
class RequirementTracker(object):
def __init__(self, root):
# type: (str) -> None
self._root = root
self._entries = set() # type: Set[InstallRequirement]
Reported by Pylint.
Line: 69
Column: 1
yield tracker
class RequirementTracker(object):
def __init__(self, root):
# type: (str) -> None
self._root = root
self._entries = set() # type: Set[InstallRequirement]
Reported by Pylint.
Line: 107
Column: 38
# Try reading from the file. If it exists and can be read from, a build
# is already in progress, so a LookupError is raised.
try:
with open(entry_path) as fp:
contents = fp.read()
except IOError as e:
# if the error is anything other than "file does not exist", raise.
if e.errno != errno.ENOENT:
raise
Reported by Pylint.
Line: 109
Column: 9
try:
with open(entry_path) as fp:
contents = fp.read()
except IOError as e:
# if the error is anything other than "file does not exist", raise.
if e.errno != errno.ENOENT:
raise
else:
message = '%s is already being built: %s' % (req.link, contents)
Reported by Pylint.
Line: 118
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
raise LookupError(message)
# If we're here, req should really not be building already.
assert req not in self._entries
# Start tracking this requirement.
with open(entry_path, 'w') as fp:
fp.write(str(req))
self._entries.add(req)
Reported by Bandit.
Line: 121
Column: 39
assert req not in self._entries
# Start tracking this requirement.
with open(entry_path, 'w') as fp:
fp.write(str(req))
self._entries.add(req)
logger.debug('Added %s to build tracker %r', req, self._root)
Reported by Pylint.
pipenv/patched/piptools/logging.py
12 issues
Line: 6
Column: 1
import logging
from . import click
# Initialise the builtin logging module for other component using it.
# Ex: pip
logging.basicConfig()
Reported by Pylint.
Line: 10
Column: 1
# Initialise the builtin logging module for other component using it.
# Ex: pip
logging.basicConfig()
class LogContext(object):
def __init__(self, verbosity=0):
self.verbosity = verbosity
Reported by Pylint.
Line: 4
Column: 1
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from . import click
# Initialise the builtin logging module for other component using it.
# Ex: pip
Reported by Pylint.
Line: 1
Column: 1
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from . import click
# Initialise the builtin logging module for other component using it.
# Ex: pip
Reported by Pylint.
Line: 13
Column: 1
logging.basicConfig()
class LogContext(object):
def __init__(self, verbosity=0):
self.verbosity = verbosity
def log(self, *args, **kwargs):
kwargs.setdefault("err", True)
Reported by Pylint.
Line: 13
Column: 1
logging.basicConfig()
class LogContext(object):
def __init__(self, verbosity=0):
self.verbosity = verbosity
def log(self, *args, **kwargs):
kwargs.setdefault("err", True)
Reported by Pylint.
Line: 17
Column: 5
def __init__(self, verbosity=0):
self.verbosity = verbosity
def log(self, *args, **kwargs):
kwargs.setdefault("err", True)
click.secho(*args, **kwargs)
def debug(self, *args, **kwargs):
if self.verbosity >= 1:
Reported by Pylint.
Line: 17
Column: 5
def __init__(self, verbosity=0):
self.verbosity = verbosity
def log(self, *args, **kwargs):
kwargs.setdefault("err", True)
click.secho(*args, **kwargs)
def debug(self, *args, **kwargs):
if self.verbosity >= 1:
Reported by Pylint.
Line: 21
Column: 5
kwargs.setdefault("err", True)
click.secho(*args, **kwargs)
def debug(self, *args, **kwargs):
if self.verbosity >= 1:
self.log(*args, **kwargs)
def info(self, *args, **kwargs):
if self.verbosity >= 0:
Reported by Pylint.
Line: 25
Column: 5
if self.verbosity >= 1:
self.log(*args, **kwargs)
def info(self, *args, **kwargs):
if self.verbosity >= 0:
self.log(*args, **kwargs)
def warning(self, *args, **kwargs):
kwargs.setdefault("fg", "yellow")
Reported by Pylint.
pipenv/vendor/packaging/tags.py
12 issues
Line: 23
Column: 1
cast,
)
from . import _manylinux, _musllinux
logger = logging.getLogger(__name__)
PythonVersion = Sequence[int]
MacVersion = Tuple[int, int]
Reported by Pylint.
Line: 52
Column: 52
__slots__ = ["_interpreter", "_abi", "_platform", "_hash"]
def __init__(self, interpreter: str, abi: str, platform: str) -> None:
self._interpreter = interpreter.lower()
self._abi = abi.lower()
self._platform = platform.lower()
# The __hash__ of every single element in a Set[Tag] will be evaluated each time
# that a set calls its `.disjoint()` method, which may be called hundreds of
Reported by Pylint.
Line: 326
Column: 3
formats.extend(["intel", "fat32", "fat"])
elif cpu_arch == "ppc64":
# TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
if version > (10, 5) or version < (10, 4):
return []
formats.append("fat64")
elif cpu_arch == "ppc":
Reported by Pylint.
Line: 360
Column: 9
if version is None:
version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
else:
version = version
if arch is None:
arch = _mac_arch(cpu_arch)
else:
arch = arch
Reported by Pylint.
Line: 364
Column: 9
if arch is None:
arch = _mac_arch(cpu_arch)
else:
arch = arch
if (10, 0) <= version and version < (11, 0):
# Prior to Mac OS 11, each yearly release of Mac OS bumped the
# "minor" version number. The major version was always 10.
for minor_version in range(version[1], -1, -1):
Reported by Pylint.
Line: 1
Column: 1
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import logging
import platform
import sys
import sysconfig
from importlib.machinery import EXTENSION_SUFFIXES
Reported by Pylint.
Line: 64
Column: 5
self._hash = hash((self._interpreter, self._abi, self._platform))
@property
def interpreter(self) -> str:
return self._interpreter
@property
def abi(self) -> str:
return self._abi
Reported by Pylint.
Line: 68
Column: 5
return self._interpreter
@property
def abi(self) -> str:
return self._abi
@property
def platform(self) -> str:
return self._platform
Reported by Pylint.
Line: 72
Column: 5
return self._abi
@property
def platform(self) -> str:
return self._platform
def __eq__(self, other: object) -> bool:
if not isinstance(other, Tag):
return NotImplemented
Reported by Pylint.
Line: 345
Column: 1
return formats
def mac_platforms(
version: Optional[MacVersion] = None, arch: Optional[str] = None
) -> Iterator[str]:
"""
Yields the platform tags for a macOS system.
Reported by Pylint.
pipenv/vendor/pythonfinder/cli.py
12 issues
Line: 6
Column: 1
import click
from . import __version__
from .pythonfinder import Finder
@click.command()
@click.option("--find", default=False, nargs=1, help="Find a specific python version.")
Reported by Pylint.
Line: 7
Column: 1
import click
from . import __version__
from .pythonfinder import Finder
@click.command()
@click.option("--find", default=False, nargs=1, help="Find a specific python version.")
@click.option("--which", default=False, nargs=1, help="Run the which command.")
Reported by Pylint.
Line: 98
Column: 5
if __name__ == "__main__":
cli()
Reported by Pylint.
Line: 71
Column: 13
comes_from_path = getattr(comes_from, "path", found.path)
else:
comes_from_path = found.path
arch = getattr(py, "architecture", None)
click.secho("Found python at the following locations:", fg="green")
click.secho(
"{py.name!s}: {py.version!s} ({py.architecture!s}) @ {comes_from!s}".format(
py=py, comes_from=comes_from_path
),
Reported by Pylint.
Line: 1
Column: 1
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import click
from . import __version__
from .pythonfinder import Finder
Reported by Pylint.
Line: 24
Column: 1
envvar="PYTHONFINDER_IGNORE_UNSUPPORTED",
help="Ignore unsupported python versions.",
)
@click.version_option(prog_name="pyfinder", version=__version__)
@click.pass_context
def cli(
ctx, find=False, which=False, findall=False, version=False, ignore_unsupported=True
):
if version:
Reported by Pylint.
Line: 24
Column: 1
envvar="PYTHONFINDER_IGNORE_UNSUPPORTED",
help="Ignore unsupported python versions.",
)
@click.version_option(prog_name="pyfinder", version=__version__)
@click.pass_context
def cli(
ctx, find=False, which=False, findall=False, version=False, ignore_unsupported=True
):
if version:
Reported by Pylint.
Line: 24
Column: 1
envvar="PYTHONFINDER_IGNORE_UNSUPPORTED",
help="Ignore unsupported python versions.",
)
@click.version_option(prog_name="pyfinder", version=__version__)
@click.pass_context
def cli(
ctx, find=False, which=False, findall=False, version=False, ignore_unsupported=True
):
if version:
Reported by Pylint.
Line: 39
Column: 1
ctx.exit()
finder = Finder(ignore_unsupported=ignore_unsupported)
if findall:
versions = [v for v in finder.find_all_python_versions()]
if versions:
click.secho("Found python at the following locations:", fg="green")
for v in versions:
py = v.py_version
comes_from = getattr(py, "comes_from", None)
Reported by Pylint.
Line: 42
Column: 17
versions = [v for v in finder.find_all_python_versions()]
if versions:
click.secho("Found python at the following locations:", fg="green")
for v in versions:
py = v.py_version
comes_from = getattr(py, "comes_from", None)
if comes_from is not None:
comes_from_path = getattr(comes_from, "path", v.path)
else:
Reported by Pylint.
pipenv/patched/notpip/_vendor/chardet/latin1prober.py
12 issues
Line: 29
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState
FREQ_CAT_NUM = 4
UDF = 0 # undefined
Reported by Pylint.
Line: 30
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState
FREQ_CAT_NUM = 4
UDF = 0 # undefined
OTH = 1 # other
Reported by Pylint.
Line: 123
Column: 17
freq = Latin1ClassModel[(self._last_char_class * CLASS_NUM)
+ char_class]
if freq == 0:
self._state = ProbingState.NOT_ME
break
self._freq_counter[freq] += 1
self._last_char_class = char_class
return self.state
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
Reported by Pylint.
Line: 96
Column: 1
)
class Latin1Prober(CharSetProber):
def __init__(self):
super(Latin1Prober, self).__init__()
self._last_char_class = None
self._freq_counter = None
self.reset()
Reported by Pylint.
Line: 98
Column: 9
class Latin1Prober(CharSetProber):
def __init__(self):
super(Latin1Prober, self).__init__()
self._last_char_class = None
self._freq_counter = None
self.reset()
def reset(self):
Reported by Pylint.
Line: 103
Column: 5
self._freq_counter = None
self.reset()
def reset(self):
self._last_char_class = OTH
self._freq_counter = [0] * FREQ_CAT_NUM
CharSetProber.reset(self)
@property
Reported by Pylint.
Line: 109
Column: 5
CharSetProber.reset(self)
@property
def charset_name(self):
return "ISO-8859-1"
@property
def language(self):
return ""
Reported by Pylint.
Line: 113
Column: 5
return "ISO-8859-1"
@property
def language(self):
return ""
def feed(self, byte_str):
byte_str = self.filter_with_english_letters(byte_str)
for c in byte_str:
Reported by Pylint.
Line: 116
Column: 5
def language(self):
return ""
def feed(self, byte_str):
byte_str = self.filter_with_english_letters(byte_str)
for c in byte_str:
char_class = Latin1_CharToClass[c]
freq = Latin1ClassModel[(self._last_char_class * CLASS_NUM)
+ char_class]
Reported by Pylint.
pipenv/patched/notpip/_internal/build_env.py
12 issues
Line: 155
Column: 42
if ws.find(Requirement.parse(req)) is None:
missing.add(req)
except VersionConflict as e:
conflicting.add((str(e.args[0].as_requirement()),
str(e.args[1])))
return conflicting, missing
def install_requirements(
self,
Reported by Pylint.
Line: 111
Column: 9
).format(system_sites=system_sites, lib_dirs=self._lib_dirs))
def __enter__(self):
self._save_env = {
name: os.environ.get(name, None)
for name in ('PATH', 'PYTHONNOUSERSITE', 'PYTHONPATH')
}
path = self._bin_dirs[:]
Reported by Pylint.
Line: 209
Column: 5
"""A no-op drop-in replacement for BuildEnvironment
"""
def __init__(self):
pass
def __enter__(self):
pass
Reported by Pylint.
Line: 221
Column: 5
def cleanup(self):
pass
def install_requirements(self, finder, requirements, prefix, message):
raise NotImplementedError()
Reported by Pylint.
Line: 31
Column: 1
logger = logging.getLogger(__name__)
class _Prefix:
def __init__(self, path):
# type: (str) -> None
self.path = path
self.setup = False
Reported by Pylint.
Line: 51
Column: 1
self.lib_dirs = [purelib, platlib]
class BuildEnvironment(object):
"""Creates and manages an isolated environment to install build deps
"""
def __init__(self):
# type: () -> None
Reported by Pylint.
Line: 82
Column: 77
self._site_dir = os.path.join(self._temp_dir.path, 'site')
if not os.path.exists(self._site_dir):
os.mkdir(self._site_dir)
with open(os.path.join(self._site_dir, 'sitecustomize.py'), 'w') as fp:
fp.write(textwrap.dedent(
'''
import os, site, sys
# First, drop system-sites related paths.
Reported by Pylint.
Line: 136
Column: 5
else:
os.environ[varname] = old_value
def cleanup(self):
# type: () -> None
self._temp_dir.cleanup()
def check_requirements(self, reqs):
# type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]
Reported by Pylint.
Line: 149
Column: 13
missing = set()
conflicting = set()
if reqs:
ws = WorkingSet(self._lib_dirs)
for req in reqs:
try:
if ws.find(Requirement.parse(req)) is None:
missing.add(req)
except VersionConflict as e:
Reported by Pylint.
Line: 154
Column: 17
try:
if ws.find(Requirement.parse(req)) is None:
missing.add(req)
except VersionConflict as e:
conflicting.add((str(e.args[0].as_requirement()),
str(e.args[1])))
return conflicting, missing
def install_requirements(
Reported by Pylint.
pipenv/vendor/packaging/requirements.py
12 issues
Line: 23
Column: 1
stringStart,
)
from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
class InvalidRequirement(ValueError):
"""
Reported by Pylint.
Line: 24
Column: 1
)
from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
class InvalidRequirement(ValueError):
"""
An invalid requirement was found, users should refer to PEP 508.
Reported by Pylint.
Line: 56
Column: 24
EXTRAS_LIST = EXTRA + ZeroOrMore(COMMA + EXTRA)
EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras")
VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY
VERSION_MANY = Combine(
VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), joinString=",", adjacent=False
Reported by Pylint.
Line: 57
Column: 24
EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras")
VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY
VERSION_MANY = Combine(
VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), joinString=",", adjacent=False
)("_raw_spec")
Reported by Pylint.
Line: 64
Column: 46
VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE), joinString=",", adjacent=False
)("_raw_spec")
_VERSION_SPEC = Optional((LPAREN + VERSION_MANY + RPAREN) | VERSION_MANY)
_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or "")
VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
VERSION_SPEC.setParseAction(lambda s, l, t: t[1])
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
Reported by Pylint.
Line: 71
Column: 50
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR.setParseAction(
lambda s, l, t: Marker(s[t._original_start : t._original_end])
)
MARKER_SEPARATOR = SEMICOLON
MARKER = MARKER_SEPARATOR + MARKER_EXPR
VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER)
Reported by Pylint.
Line: 71
Column: 30
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR.setParseAction(
lambda s, l, t: Marker(s[t._original_start : t._original_end])
)
MARKER_SEPARATOR = SEMICOLON
MARKER = MARKER_SEPARATOR + MARKER_EXPR
VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER)
Reported by Pylint.
Line: 95
Column: 3
string.
"""
# TODO: Can we test whether something is contained within a requirement?
# If so how do we do that? Do we need to test against the _name_ of
# the thing as well as the version? What about the markers?
# TODO: Can we normalize the name and extra name?
def __init__(self, requirement_string: str) -> None:
Reported by Pylint.
Line: 98
Column: 3
# TODO: Can we test whether something is contained within a requirement?
# If so how do we do that? Do we need to test against the _name_ of
# the thing as well as the version? What about the markers?
# TODO: Can we normalize the name and extra name?
def __init__(self, requirement_string: str) -> None:
try:
req = REQUIREMENT.parseString(requirement_string)
except ParseException as e:
Reported by Pylint.
Line: 104
Column: 13
try:
req = REQUIREMENT.parseString(requirement_string)
except ParseException as e:
raise InvalidRequirement(
f'Parse error at "{ requirement_string[e.loc : e.loc + 8]!r}": {e.msg}'
)
self.name: str = req.name
if req.url:
Reported by Pylint.
pipenv/patched/notpip/_vendor/urllib3/util/connection.py
12 issues
Line: 3
Column: 1
from __future__ import absolute_import
import socket
from .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
Reported by Pylint.
Line: 4
Column: 1
from __future__ import absolute_import
import socket
from .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
Reported by Pylint.
Line: 35
Column: 13
# discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
):
"""Connect to *address* and return the socket object.
Reported by Pylint.
Line: 62
Column: 30
family = allowed_gai_family()
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket.socket(af, socktype, proto)
# If provided, set socket level options before connecting.
Reported by Pylint.
Line: 70
Column: 31
# If provided, set socket level options before connecting.
_set_socket_options(sock, socket_options)
if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
return sock
Reported by Pylint.
Line: 130
Column: 16
sock = socket.socket(socket.AF_INET6)
sock.bind((host, 0))
has_ipv6 = True
except Exception:
pass
if sock:
sock.close()
return has_ipv6
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import socket
from .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
Reported by Pylint.
Line: 33
Column: 1
# library test suite. Added to its signature is only `socket_options`.
# One additional modification is that we avoid binding to IPv6 servers
# discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
):
Reported by Pylint.
Line: 62
Column: 41
family = allowed_gai_family()
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket.socket(af, socktype, proto)
# If provided, set socket level options before connecting.
Reported by Pylint.
Line: 62
Column: 9
family = allowed_gai_family()
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket.socket(af, socktype, proto)
# If provided, set socket level options before connecting.
Reported by Pylint.