The following issues were found

pipenv/vendor/urllib3/filepost.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              import os
from io import BytesIO

from .fields import RequestField
from .packages import six
from .packages.six import b

writer = codecs.lookup("utf-8")[3]


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from io import BytesIO

from .fields import RequestField
from .packages import six
from .packages.six import b

writer = codecs.lookup("utf-8")[3]



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from .fields import RequestField
from .packages import six
from .packages.six import b

writer = codecs.lookup("utf-8")[3]


def choose_boundary():

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

import binascii
import codecs
import os
from io import BytesIO

from .fields import RequestField
from .packages import six

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/msgpack/exceptions.py
4 issues
__init__ method from base class 'ValueError' is not called
Error

Line: 37 Column: 5

                  unpack.
    """

    def __init__(self, unpacked, extra):
        self.unpacked = unpacked
        self.extra = extra

    def __str__(self):
        return "unpack(b) received extra data."

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class UnpackException(Exception):
    """Base class for some exceptions raised while unpacking.

    NOTE: unpack may raise exception other than subclass of
    UnpackException.  If you want to catch all error, catch
    Exception instead.
    """



            

Reported by Pylint.

Missing class docstring
Error

Line: 10 Column: 1

                  """


class BufferFull(UnpackException):
    pass


class OutOfData(UnpackException):
    pass

            

Reported by Pylint.

Missing class docstring
Error

Line: 14 Column: 1

                  pass


class OutOfData(UnpackException):
    pass


class FormatError(ValueError, UnpackException):
    """Invalid msgpack format"""

            

Reported by Pylint.

pipenv/vendor/yaspin/api.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              
import signal

from .core import Yaspin
from .signal_handlers import default_handler


def yaspin(*args, **kwargs):
    """Display spinner in stdout.

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              import signal

from .core import Yaspin
from .signal_handlers import default_handler


def yaspin(*args, **kwargs):
    """Display spinner in stdout.


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 81 Column: 1

                  return Yaspin(*args, **kwargs)


def kbi_safe_yaspin(*args, **kwargs):
    kwargs["sigmap"] = {signal.SIGINT: default_handler}
    return Yaspin(*args, **kwargs)


# Handle PYTHONOPTIMIZE=2 case, when docstrings are set to None.

            

Reported by Pylint.

Constant name "_kbi_safe_doc" doesn't conform to UPPER_CASE naming style
Error

Line: 88 Column: 5

              
# Handle PYTHONOPTIMIZE=2 case, when docstrings are set to None.
if yaspin.__doc__:
    _kbi_safe_doc = yaspin.__doc__.replace("yaspin", "kbi_safe_yaspin")
    kbi_safe_yaspin.__doc__ = _kbi_safe_doc

            

Reported by Pylint.

pipenv/patched/notpip/_internal/vcs/mercurial.py
4 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves'
Error

Line: 9 Column: 1

              import logging
import os

from pipenv.patched.notpip._vendor.six.moves import configparser

from pipenv.patched.notpip._internal.exceptions import BadCommand, InstallationError
from pipenv.patched.notpip._internal.utils.misc import display_path
from pipenv.patched.notpip._internal.utils.subprocess import make_command
from pipenv.patched.notpip._internal.utils.temp_dir import TempDirectory

            

Reported by Pylint.

Parameters differ from overridden 'get_requirement_revision' method
Error

Line: 111 Column: 5

                      return current_revision

    @classmethod
    def get_requirement_revision(cls, location):
        """
        Return the changeset identification hash, as a 40-character
        hexadecimal string
        """
        current_rev_hash = cls.run_command(

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False

from __future__ import absolute_import

import logging
import os

from pipenv.patched.notpip._vendor.six.moves import configparser

            

Reported by Pylint.

Missing class docstring
Error

Line: 31 Column: 1

              logger = logging.getLogger(__name__)


class Mercurial(VersionControl):
    name = 'hg'
    dirname = '.hg'
    repo_name = 'clone'
    schemes = (
        'hg', 'hg+file', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http',

            

Reported by Pylint.

pipenv/patched/notpip/_internal/utils/typing.py
4 issues
Unused cast imported from typing
Error

Line: 33 Column: 5

              

if MYPY_CHECK_RUNNING:
    from typing import cast
else:
    # typing's cast() is needed at runtime, but we don't want to import typing.
    # Thus, we use a dummy no-op version, which we tell mypy to ignore.
    def cast(type_, value):  # type: ignore
        return value

            

Reported by Pylint.

Module import itself
Error

Line: 33 Column: 5

              

if MYPY_CHECK_RUNNING:
    from typing import cast
else:
    # typing's cast() is needed at runtime, but we don't want to import typing.
    # Thus, we use a dummy no-op version, which we tell mypy to ignore.
    def cast(type_, value):  # type: ignore
        return value

            

Reported by Pylint.

Unused argument 'type_'
Error

Line: 37 Column: 14

              else:
    # typing's cast() is needed at runtime, but we don't want to import typing.
    # Thus, we use a dummy no-op version, which we tell mypy to ignore.
    def cast(type_, value):  # type: ignore
        return value

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 37 Column: 5

              else:
    # typing's cast() is needed at runtime, but we don't want to import typing.
    # Thus, we use a dummy no-op version, which we tell mypy to ignore.
    def cast(type_, value):  # type: ignore
        return value

            

Reported by Pylint.

pipenv/vendor/urllib3/contrib/_securetransport/low_level.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              import struct
import tempfile

from .bindings import CFConst, CoreFoundation, Security

# This regular expression is used to grab PEM data out of a PEM bundle.
_PEM_CERTS_RE = re.compile(
    b"-----BEGIN CERTIFICATE-----\n(.*?)\n-----END CERTIFICATE-----", re.DOTALL
)

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 186 Column: 12

              
            CoreFoundation.CFArrayAppendValue(cert_array, cert)
            CoreFoundation.CFRelease(cert)
    except Exception:
        # We need to free the array before the exception bubbles further.
        # We only want to do that if an error occurs: otherwise, the caller
        # should free.
        CoreFoundation.CFRelease(cert_array)


            

Reported by Pylint.

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

Line: 97 Column: 5

                              CoreFoundation.CFArrayAppendValue(cf_arr, cf_str)
            finally:
                CoreFoundation.CFRelease(cf_str)
    except BaseException as e:
        if cf_arr:
            CoreFoundation.CFRelease(cf_arr)
        raise ssl.SSLError("Unable to allocate array: %s" % (e,))
    return cf_arr


            

Reported by Pylint.

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

Line: 257 Column: 30

                  identities = []
    result_array = None

    with open(path, "rb") as f:
        raw_filedata = f.read()

    try:
        filedata = CoreFoundation.CFDataCreate(
            CoreFoundation.kCFAllocatorDefault, raw_filedata, len(raw_filedata)

            

Reported by Pylint.

pipenv/vendor/yarg/client.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              
import requests

from .exceptions import HTTPError
from .package import json2package


def get(package_name, pypi_server="https://pypi.python.org/pypi/"):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              import requests

from .exceptions import HTTPError
from .package import json2package


def get(package_name, pypi_server="https://pypi.python.org/pypi/"):
    """
    Constructs a request to the PyPI server and returns a

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding: utf-8 -*-

# (The MIT License)
#
# Copyright (c) 2014 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 51 Column: 5

                  if response.status_code >= 300:
        raise HTTPError(status_code=response.status_code,
                        reason=response.reason)
    if hasattr(response.content, 'decode'):
        return json2package(response.content.decode())
    else:
        return json2package(response.content)

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/filters/alphabeticalattributes.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from . import base

from collections import OrderedDict


def _attr_key(attr):
    """Return an appropriate key for an attribute for sorting

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from . import base

from collections import OrderedDict


def _attr_key(attr):
    """Return an appropriate key for an attribute for sorting

            

Reported by Pylint.

standard import "from collections import OrderedDict" should be placed before "from . import base"
Error

Line: 5 Column: 1

              
from . import base

from collections import OrderedDict


def _attr_key(attr):
    """Return an appropriate key for an attribute for sorting


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 19 Column: 1

                  return (attr[0][0] or ''), attr[0][1]


class Filter(base.Filter):
    """Alphabetizes attributes for elements"""
    def __iter__(self):
        for token in base.Filter.__iter__(self):
            if token["type"] in ("StartTag", "EmptyTag"):
                attrs = OrderedDict()

            

Reported by Pylint.

pipenv/patched/notpip/_internal/utils/packaging.py
4 issues
Unused argument 'version_info'
Error

Line: 23 Column: 44

              logger = logging.getLogger(__name__)


def check_requires_python(requires_python, version_info):
    # type: (Optional[str], Tuple[int, ...]) -> bool
    """
    Check if the given Python version matches a "Requires-Python" specifier.

    :param version_info: A 3-tuple of ints representing a Python

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

import logging
import sys
from email.parser import FeedParser

from pipenv.patched.notpip._vendor import pkg_resources
from pipenv.patched.notpip._vendor.packaging import specifiers, version


            

Reported by Pylint.

Imports from package email are not grouped
Error

Line: 16 Column: 5

              
if MYPY_CHECK_RUNNING:
    from typing import Optional, Tuple
    from email.message import Message
    from pipenv.patched.notpip._vendor.pkg_resources import Distribution


logger = logging.getLogger(__name__)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 89 Column: 1

                  return requires_python


def get_installer(dist):
    # type: (Distribution) -> str
    if dist.has_metadata('INSTALLER'):
        for line in dist.get_metadata_lines('INSTALLER'):
            if line.strip():
                return line.strip()

            

Reported by Pylint.

pipenv/patched/notpip/_internal/distributions/wheel.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              from zipfile import ZipFile

from pipenv.patched.notpip._internal.distributions.base import AbstractDistribution
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
from pipenv.patched.notpip._internal.utils.wheel import pkg_resources_distribution_for_wheel

if MYPY_CHECK_RUNNING:
    from pipenv.patched.notpip._vendor.pkg_resources import Distribution
    from pipenv.patched.notpip._internal.index.package_finder import PackageFinder

            

Reported by Pylint.

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

Line: 25
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                      requirement.
        """
        # Set as part of preparation during download.
        assert self.req.local_file_path
        # Wheels are never unnamed.
        assert self.req.name

        with ZipFile(self.req.local_file_path, allowZip64=True) as z:
            return pkg_resources_distribution_for_wheel(

            

Reported by Bandit.

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

Line: 27
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                      # Set as part of preparation during download.
        assert self.req.local_file_path
        # Wheels are never unnamed.
        assert self.req.name

        with ZipFile(self.req.local_file_path, allowZip64=True) as z:
            return pkg_resources_distribution_for_wheel(
                z, self.req.name, self.req.local_file_path
            )

            

Reported by Bandit.

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

Line: 29 Column: 68

                      # Wheels are never unnamed.
        assert self.req.name

        with ZipFile(self.req.local_file_path, allowZip64=True) as z:
            return pkg_resources_distribution_for_wheel(
                z, self.req.name, self.req.local_file_path
            )

    def prepare_distribution_metadata(self, finder, build_isolation):

            

Reported by Pylint.