The following issues were found

pipenv/vendor/attr/__init__.py
12 issues
Unable to import '__init__._cmp'
Error

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.

Unable to import '__init__._config'
Error

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.

Unable to import '__init__._funcs'
Error

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.

Unable to import '__init__._make'
Error

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.

Unable to import '__init__._version_info'
Error

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.

Unable to import '__init__._next_gen'
Error

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.

Module import itself
Error

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.

Module import itself
Error

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.

Module import itself
Error

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.

Module import itself
Error

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
Undefined variable 'unicode'
Error

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.

Undefined variable 'unicode'
Error

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.

Missing module docstring
Error

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.

Argument name "s" doesn't conform to snake_case naming style
Error

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.

Missing function or method docstring
Error

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.

Class name "text_type" doesn't conform to PascalCase naming style
Error

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.

Missing function or method docstring
Error

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.

Argument name "s" doesn't conform to snake_case naming style
Error

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.

Argument name "s" doesn't conform to snake_case naming style
Error

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.

Missing function or method docstring
Error

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
Missing module docstring
Error

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.

Missing function or method docstring
Error

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.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

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.

Missing function or method docstring
Error

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.

Missing class docstring
Error

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.

Class 'RequirementTracker' inherits from object, can be safely removed from bases in python3
Error

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.

Variable name "fp" doesn't conform to snake_case naming style
Error

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.

Variable name "e" doesn't conform to snake_case naming style
Error

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.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

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.

Variable name "fp" doesn't conform to snake_case naming style
Error

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
Attempted relative import beyond top-level package
Error

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.

Module 'logging' has no 'basicConfig' member
Error

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.

Module import itself
Error

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.

Missing module docstring
Error

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.

Missing class docstring
Error

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.

Class 'LogContext' inherits from object, can be safely removed from bases in python3
Error

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.

Method could be a function
Error

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.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

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
Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

                  cast,
)

from . import _manylinux, _musllinux

logger = logging.getLogger(__name__)

PythonVersion = Sequence[int]
MacVersion = Tuple[int, int]

            

Reported by Pylint.

Redefining name 'platform' from outer scope (line 6)
Error

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.

TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
Error

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.

Assigning the same variable 'version' to itself
Error

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.

Assigning the same variable 'arch' to itself
Error

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.

Missing module docstring
Error

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.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

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.

Too many branches (16/12)
Error

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
Attempted relative import beyond top-level package
Error

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.

Attempted relative import beyond top-level package
Error

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.

No value for argument 'ctx' in function call
Error

Line: 98 Column: 5

              

if __name__ == "__main__":
    cli()

            

Reported by Pylint.

Unused variable 'arch'
Error

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.

Missing module docstring
Error

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.

Missing function or method docstring
Error

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.

Too many branches (16/12)
Error

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.

Too many arguments (6/5)
Error

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.

Unnecessary use of a comprehension
Error

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.

Variable name "v" doesn't conform to snake_case naming style
Error

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
Attempted relative import beyond top-level package
Error

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.

Attempted relative import beyond top-level package
Error

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.

Attribute '_state' defined outside __init__
Error

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.

Missing module docstring
Error

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.

Missing class docstring
Error

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.

Consider using Python 3 style super() without arguments
Error

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.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

Line: 109 Column: 5

                      CharSetProber.reset(self)

    @property
    def charset_name(self):
        return "ISO-8859-1"

    @property
    def language(self):
        return ""

            

Reported by Pylint.

Missing function or method docstring
Error

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.

Missing function or method docstring
Error

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
Instance of 'str' has no 'as_requirement' member
Error

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.

Attribute '_save_env' defined outside __init__
Error

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.

__init__ method from base class 'BuildEnvironment' is not called
Error

Line: 209 Column: 5

                  """A no-op drop-in replacement for BuildEnvironment
    """

    def __init__(self):
        pass

    def __enter__(self):
        pass


            

Reported by Pylint.

Parameters differ from overridden 'install_requirements' method
Error

Line: 221 Column: 5

                  def cleanup(self):
        pass

    def install_requirements(self, finder, requirements, prefix, message):
        raise NotImplementedError()

            

Reported by Pylint.

Too few public methods (0/2)
Error

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.

Class 'BuildEnvironment' inherits from object, can be safely removed from bases in python3
Error

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.

Variable name "fp" doesn't conform to snake_case naming style
Error

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.

Missing function or method docstring
Error

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.

Variable name "ws" doesn't conform to snake_case naming style
Error

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.

Variable name "e" doesn't conform to snake_case naming style
Error

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
Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

                  stringStart,
)

from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet


class InvalidRequirement(ValueError):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

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.

Access to a protected member _regex_str of a client class
Error

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.

Access to a protected member _regex_str of a client class
Error

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.

Access to a protected member _raw_spec of a client class
Error

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.

Access to a protected member _original_end of a client class
Error

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.

Access to a protected member _original_start of a client class
Error

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.

TODO: Can we test whether something is contained within a requirement?
Error

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.

TODO: Can we normalize the name and extra name?
Error

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.

Consider explicitly re-raising using the 'from' keyword
Error

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
Attempted relative import beyond top-level package
Error

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.

Attempted relative import beyond top-level package
Error

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.

Access to a protected member _GLOBAL_DEFAULT_TIMEOUT of a client class
Error

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.

Unused variable 'canonname'
Error

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.

Access to a protected member _GLOBAL_DEFAULT_TIMEOUT of a client class
Error

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.

Catching too general exception Exception
Error

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.

Missing module docstring
Error

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.

Too many local variables (16/15)
Error

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.

Variable name "sa" doesn't conform to snake_case naming style
Error

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.

Variable name "af" doesn't conform to snake_case naming style
Error

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.