The following issues were found

pipenv/vendor/chardet/hebrewprober.py
17 issues
Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState

# This prober doesn't actually recognize a language or a charset.
# It is a helper prober for the use of the Hebrew model probers


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState

# This prober doesn't actually recognize a language or a charset.
# It is a helper prober for the use of the Hebrew model probers

### General ideas of the Hebrew charset recognition ###

            

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
#          Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

Missing class docstring
Error

Line: 128 Column: 1

              # model probers scores. The answer is returned in the form of the name of the
# charset identified, either "windows-1255" or "ISO-8859-8".

class HebrewProber(CharSetProber):
    # windows-1255 / ISO-8859-8 code points of interest
    FINAL_KAF = 0xea
    NORMAL_KAF = 0xeb
    FINAL_MEM = 0xed
    NORMAL_MEM = 0xee

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 155 Column: 9

                  LOGICAL_HEBREW_NAME = "windows-1255"

    def __init__(self):
        super(HebrewProber, self).__init__()
        self._final_char_logical_score = None
        self._final_char_visual_score = None
        self._prev = None
        self._before_prev = None
        self._logical_prober = None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 164 Column: 5

                      self._visual_prober = None
        self.reset()

    def reset(self):
        self._final_char_logical_score = 0
        self._final_char_visual_score = 0
        # The two last characters seen in the previous buffer,
        # mPrev and mBeforePrev are initialized to space in order to simulate
        # a word delimiter at the beginning of the data

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 174 Column: 5

                      self._before_prev = ' '
        # These probers are owned by the group prober.

    def set_model_probers(self, logicalProber, visualProber):
        self._logical_prober = logicalProber
        self._visual_prober = visualProber

    def is_final(self, c):
        return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN,

            

Reported by Pylint.

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

Line: 174 Column: 5

                      self._before_prev = ' '
        # These probers are owned by the group prober.

    def set_model_probers(self, logicalProber, visualProber):
        self._logical_prober = logicalProber
        self._visual_prober = visualProber

    def is_final(self, c):
        return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN,

            

Reported by Pylint.

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

Line: 174 Column: 5

                      self._before_prev = ' '
        # These probers are owned by the group prober.

    def set_model_probers(self, logicalProber, visualProber):
        self._logical_prober = logicalProber
        self._visual_prober = visualProber

    def is_final(self, c):
        return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN,

            

Reported by Pylint.

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

Line: 178 Column: 5

                      self._logical_prober = logicalProber
        self._visual_prober = visualProber

    def is_final(self, c):
        return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN,
                     self.FINAL_PE, self.FINAL_TSADI]

    def is_non_final(self, c):
        # The normal Tsadi is not a good Non-Final letter due to words like

            

Reported by Pylint.

pipenv/vendor/cached_property.py
17 issues
Missing module docstring
Error

Line: 1 Column: 1

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

__author__ = "Daniel Greenfeld"
__email__ = "pydanny@gmail.com"
__version__ = "1.5.2"
__license__ = "BSD"

from functools import wraps
from time import time

            

Reported by Pylint.

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

Line: 18 Column: 1

                  asyncio = None


class cached_property(object):
    """
    A property that is only computed once per instance and then replaces itself
    with an ordinary attribute. Deleting the attribute resets the property.
    Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
    """  # noqa

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 18 Column: 1

                  asyncio = None


class cached_property(object):
    """
    A property that is only computed once per instance and then replaces itself
    with an ordinary attribute. Deleting the attribute resets the property.
    Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
    """  # noqa

            

Reported by Pylint.

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

Line: 18 Column: 1

                  asyncio = None


class cached_property(object):
    """
    A property that is only computed once per instance and then replaces itself
    with an ordinary attribute. Deleting the attribute resets the property.
    Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
    """  # noqa

            

Reported by Pylint.

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

Line: 50 Column: 1

                      return wrapper()


class threaded_cached_property(object):
    """
    A cached_property version for use in environments where multiple threads
    might concurrently try to access the property.
    """


            

Reported by Pylint.

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

Line: 50 Column: 1

                      return wrapper()


class threaded_cached_property(object):
    """
    A cached_property version for use in environments where multiple threads
    might concurrently try to access the property.
    """


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 50 Column: 1

                      return wrapper()


class threaded_cached_property(object):
    """
    A cached_property version for use in environments where multiple threads
    might concurrently try to access the property.
    """


            

Reported by Pylint.

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

Line: 77 Column: 1

                              return obj_dict.setdefault(name, self.func(obj))


class cached_property_with_ttl(object):
    """
    A property that is only computed once per instance and then replaces itself
    with an ordinary attribute. Setting the ttl to a number expresses how long
    the property will last before being timed out.
    """

            

Reported by Pylint.

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

Line: 77 Column: 1

                              return obj_dict.setdefault(name, self.func(obj))


class cached_property_with_ttl(object):
    """
    A property that is only computed once per instance and then replaces itself
    with an ordinary attribute. Setting the ttl to a number expresses how long
    the property will last before being timed out.
    """

            

Reported by Pylint.

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

Line: 132 Column: 1

              

# Aliases to make cached_property_with_ttl easier to use
cached_property_ttl = cached_property_with_ttl
timed_cached_property = cached_property_with_ttl


class threaded_cached_property_with_ttl(cached_property_with_ttl):
    """

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/cachecontrol/controller.py
17 issues
Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              
from pipenv.patched.notpip._vendor.requests.structures import CaseInsensitiveDict

from .cache import DictCache
from .serialize import Serializer


logger = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from pipenv.patched.notpip._vendor.requests.structures import CaseInsensitiveDict

from .cache import DictCache
from .serialize import Serializer


logger = logging.getLogger(__name__)

URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?")

            

Reported by Pylint.

Unused variable 'fragment'
Error

Line: 45 Column: 42

                  @classmethod
    def _urlnorm(cls, uri):
        """Normalize the URL to create a safe key for the cache"""
        (scheme, authority, path, query, fragment) = parse_uri(uri)
        if not scheme or not authority:
            raise Exception("Only absolute URIs are allowed. uri = %s" % uri)

        scheme = scheme.lower()
        authority = authority.lower()

            

Reported by Pylint.

TODO: There is an assumption that the result will be a
Error

Line: 181 Column: 3

                      current_age = max(0, now - date)
        logger.debug("Current age based on date: %i", current_age)

        # TODO: There is an assumption that the result will be a
        #       urllib3 response object. This may not be best since we
        #       could probably avoid instantiating or constructing the
        #       response until we know we need it.
        resp_cc = self.parse_cache_control(headers)


            

Reported by Pylint.

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

Line: 30 Column: 1

                  return (groups[1], groups[3], groups[4], groups[6], groups[8])


class CacheController(object):
    """An interface to see if request should cached or not.
    """

    def __init__(
        self, cache=None, cache_etags=True, serializer=None, status_codes=None

            

Reported by Pylint.

Consider using ternary ('?'.join([path, query]) if query else path)
Error

Line: 57 Column: 9

              
        # Could do syntax based normalization of the URI before
        # computing the digest. See Section 6.2.2 of Std 66.
        request_uri = query and "?".join([path, query]) or path
        defrag_uri = scheme + "://" + authority + request_uri

        return defrag_uri

    @classmethod

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 63 Column: 5

                      return defrag_uri

    @classmethod
    def cache_url(cls, uri):
        return cls._urlnorm(uri)

    def parse_cache_control(self, headers):
        known_directives = {
            # https://tools.ietf.org/html/rfc7234#section-5.2

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 66 Column: 5

                  def cache_url(cls, uri):
        return cls._urlnorm(uri)

    def parse_cache_control(self, headers):
        known_directives = {
            # https://tools.ietf.org/html/rfc7234#section-5.2
            "max-age": (int, True),
            "max-stale": (int, False),
            "min-fresh": (int, True),

            

Reported by Pylint.

Method could be a function
Error

Line: 66 Column: 5

                  def cache_url(cls, uri):
        return cls._urlnorm(uri)

    def parse_cache_control(self, headers):
        known_directives = {
            # https://tools.ietf.org/html/rfc7234#section-5.2
            "max-age": (int, True),
            "max-stale": (int, False),
            "min-fresh": (int, True),

            

Reported by Pylint.

Too many statements (51/50)
Error

Line: 120 Column: 5

              
        return retval

    def cached_request(self, request):
        """
        Return a cached response if it exists in the cache, otherwise
        return False.
        """
        cache_url = self.cache_url(request.url)

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/packaging/requirements.py
17 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves.urllib'
Error

Line: 12 Column: 1

              from pipenv.patched.notpip._vendor.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
from pipenv.patched.notpip._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
from pipenv.patched.notpip._vendor.pyparsing import Literal as L  # noqa
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urlparse

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


            

Reported by Pylint.

No name 'urllib' in module '_MovedItems'
Error

Line: 12 Column: 1

              from pipenv.patched.notpip._vendor.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
from pipenv.patched.notpip._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
from pipenv.patched.notpip._vendor.pyparsing import Literal as L  # noqa
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urlparse

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


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from pipenv.patched.notpip._vendor.pyparsing import Literal as L  # noqa
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urlparse

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

if MYPY_CHECK_RUNNING:  # pragma: no cover
    from typing import List

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urlparse

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

if MYPY_CHECK_RUNNING:  # pragma: no cover
    from typing import List


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

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

if MYPY_CHECK_RUNNING:  # pragma: no cover
    from typing import List



            

Reported by Pylint.

Access to a protected member _regex_str of a client class
Error

Line: 51 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: 52 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: 59 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: 66 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: 66 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.

pipenv/patched/notpip/_vendor/idna/codec.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 1 Column: 1

              from .core import encode, decode, alabel, ulabel, IDNAError
import codecs
import re

_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')

class Codec(codecs.Codec):

    def encode(self, data, errors='strict'):

            

Reported by Pylint.

Undefined variable 'unicode'
Error

Line: 71 Column: 29

                          return (u"", 0)

        # IDNA allows decoding to operate on Unicode strings, too.
        if isinstance(data, unicode):
            labels = _unicode_dots_re.split(data)
        else:
            # Must be ASCII string
            data = str(data)
            unicode(data, "ascii")

            

Reported by Pylint.

Undefined variable 'unicode'
Error

Line: 76 Column: 13

                      else:
            # Must be ASCII string
            data = str(data)
            unicode(data, "ascii")
            labels = data.split(".")

        trailing_dot = u''
        if labels:
            if not labels[-1]:

            

Reported by Pylint.

Parameters differ from overridden 'encode' method
Error

Line: 9 Column: 5

              
class Codec(codecs.Codec):

    def encode(self, data, errors='strict'):

        if errors != 'strict':
            raise IDNAError("Unsupported error handling \"{0}\"".format(errors))

        if not data:

            

Reported by Pylint.

Parameters differ from overridden 'decode' method
Error

Line: 19 Column: 5

              
        return encode(data), len(data)

    def decode(self, data, errors='strict'):

        if errors != 'strict':
            raise IDNAError("Unsupported error handling \"{0}\"".format(errors))

        if not data:

            

Reported by Pylint.

Parameters differ from overridden '_buffer_encode' method
Error

Line: 30 Column: 5

                      return decode(data), len(data)

class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
    def _buffer_encode(self, data, errors, final):
        if errors != 'strict':
            raise IDNAError("Unsupported error handling \"{0}\"".format(errors))

        if not data:
            return ("", 0)

            

Reported by Pylint.

Parameters differ from overridden '_buffer_decode' method
Error

Line: 63 Column: 5

                      return (result, size)

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    def _buffer_decode(self, data, errors, final):
        if errors != 'strict':
            raise IDNAError("Unsupported error handling \"{0}\"".format(errors))

        if not data:
            return (u"", 0)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from .core import encode, decode, alabel, ulabel, IDNAError
import codecs
import re

_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')

class Codec(codecs.Codec):

    def encode(self, data, errors='strict'):

            

Reported by Pylint.

standard import "import codecs" should be placed before "from .core import encode, decode, alabel, ulabel, IDNAError"
Error

Line: 2 Column: 1

              from .core import encode, decode, alabel, ulabel, IDNAError
import codecs
import re

_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')

class Codec(codecs.Codec):

    def encode(self, data, errors='strict'):

            

Reported by Pylint.

standard import "import re" should be placed before "from .core import encode, decode, alabel, ulabel, IDNAError"
Error

Line: 3 Column: 1

              from .core import encode, decode, alabel, ulabel, IDNAError
import codecs
import re

_unicode_dots_re = re.compile(u'[\u002e\u3002\uff0e\uff61]')

class Codec(codecs.Codec):

    def encode(self, data, errors='strict'):

            

Reported by Pylint.

pipenv/patched/notpip/_internal/vcs/git.py
16 issues
No name 'urllib' in module '_MovedItems'
Error

Line: 11 Column: 1

              import re

from pipenv.patched.notpip._vendor.packaging.version import parse as parse_version
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request

from pipenv.patched.notpip._internal.exceptions import BadCommand
from pipenv.patched.notpip._internal.utils.misc import display_path, hide_url
from pipenv.patched.notpip._internal.utils.subprocess import make_command

            

Reported by Pylint.

Unable to import 'pipenv.patched.notpip._vendor.six.moves.urllib'
Error

Line: 11 Column: 1

              import re

from pipenv.patched.notpip._vendor.packaging.version import parse as parse_version
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request

from pipenv.patched.notpip._internal.exceptions import BadCommand
from pipenv.patched.notpip._internal.utils.misc import display_path, hide_url
from pipenv.patched.notpip._internal.utils.subprocess import make_command

            

Reported by Pylint.

Unable to import 'pipenv.patched.notpip._vendor.six.moves.urllib'
Error

Line: 12 Column: 1

              
from pipenv.patched.notpip._vendor.packaging.version import parse as parse_version
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request

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

            

Reported by Pylint.

No name 'urllib' in module '_MovedItems'
Error

Line: 12 Column: 1

              
from pipenv.patched.notpip._vendor.packaging.version import parse as parse_version
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request

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

            

Reported by Pylint.

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

Line: 146 Column: 17

                          except ValueError:
                # Include the offending line to simplify troubleshooting if
                # this error ever occurs.
                raise ValueError('unexpected show-ref line: {!r}'.format(line))

            refs[ref] = sha

        branch_ref = 'refs/remotes/origin/{}'.format(rev)
        tag_ref = 'refs/tags/{}'.format(rev)

            

Reported by Pylint.

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

Line: 295 Column: 13

                      try:
            found_remote = remotes[0]
        except IndexError:
            raise RemoteNotFoundError

        for remote in remotes:
            if remote.startswith('remote.origin.url '):
                found_remote = remote
                break

            

Reported by Pylint.

Parameters differ from overridden 'get_revision' method
Error

Line: 305 Column: 5

                      return url.strip()

    @classmethod
    def get_revision(cls, location, rev=None):
        if rev is None:
            rev = 'HEAD'
        current_rev = cls.run_command(
            ['rev-parse', rev], show_stdout=False, cwd=location,
        )

            

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.path
import re


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 42 Column: 1

              HASH_REGEX = re.compile('^[a-fA-F0-9]{40}$')


def looks_like_hash(sha):
    return bool(HASH_REGEX.match(sha))


class Git(VersionControl):
    name = 'git'

            

Reported by Pylint.

Missing class docstring
Error

Line: 46 Column: 1

                  return bool(HASH_REGEX.match(sha))


class Git(VersionControl):
    name = 'git'
    dirname = '.git'
    repo_name = 'clone'
    schemes = (
        'git', 'git+http', 'git+https', 'git+ssh', 'git+git', 'git+file',

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/treewalkers/dom.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
from xml.dom import Node

from . import base


class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from xml.dom import Node

from . import base


class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):

            

Reported by Pylint.

Missing class docstring
Error

Line: 8 Column: 1

              from . import base


class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return base.DOCTYPE, node.name, node.publicId, node.systemId

        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 9 Column: 5

              

class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return base.DOCTYPE, node.name, node.publicId, node.systemId

        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
            return base.TEXT, node.nodeValue

            

Reported by Pylint.

Method name "getNodeDetails" doesn't conform to snake_case naming style
Error

Line: 9 Column: 5

              

class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return base.DOCTYPE, node.name, node.publicId, node.systemId

        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
            return base.TEXT, node.nodeValue

            

Reported by Pylint.

Method could be a function
Error

Line: 9 Column: 5

              

class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return base.DOCTYPE, node.name, node.publicId, node.systemId

        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
            return base.TEXT, node.nodeValue

            

Reported by Pylint.

Unnecessary "elif" after "return"
Error

Line: 10 Column: 9

              
class TreeWalker(base.NonRecursiveTreeWalker):
    def getNodeDetails(self, node):
        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return base.DOCTYPE, node.name, node.publicId, node.systemId

        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
            return base.TEXT, node.nodeValue


            

Reported by Pylint.

Method could be a function
Error

Line: 36 Column: 5

                      else:
            return base.UNKNOWN, node.nodeType

    def getFirstChild(self, node):
        return node.firstChild

    def getNextSibling(self, node):
        return node.nextSibling


            

Reported by Pylint.

Method name "getFirstChild" doesn't conform to snake_case naming style
Error

Line: 36 Column: 5

                      else:
            return base.UNKNOWN, node.nodeType

    def getFirstChild(self, node):
        return node.firstChild

    def getNextSibling(self, node):
        return node.nextSibling


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 36 Column: 5

                      else:
            return base.UNKNOWN, node.nodeType

    def getFirstChild(self, node):
        return node.firstChild

    def getNextSibling(self, node):
        return node.nextSibling


            

Reported by Pylint.

pipenv/vendor/chardet/sbcsgroupprober.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .hebrewprober import HebrewProber
from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
                                 WINDOWS_1251_BULGARIAN_MODEL)
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .hebrewprober import HebrewProber
from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
                                 WINDOWS_1251_BULGARIAN_MODEL)
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .hebrewprober import HebrewProber
from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
                                 WINDOWS_1251_BULGARIAN_MODEL)
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,
#                                  WINDOWS_1250_HUNGARIAN_MODEL)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 33 Column: 1

              from .hebrewprober import HebrewProber
from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
                                 WINDOWS_1251_BULGARIAN_MODEL)
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,
#                                  WINDOWS_1250_HUNGARIAN_MODEL)
from .langrussianmodel import (IBM855_RUSSIAN_MODEL, IBM866_RUSSIAN_MODEL,
                               ISO_8859_5_RUSSIAN_MODEL, KOI8_R_RUSSIAN_MODEL,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

              from .langbulgarianmodel import (ISO_8859_5_BULGARIAN_MODEL,
                                 WINDOWS_1251_BULGARIAN_MODEL)
from .langgreekmodel import ISO_8859_7_GREEK_MODEL, WINDOWS_1253_GREEK_MODEL
from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,
#                                  WINDOWS_1250_HUNGARIAN_MODEL)
from .langrussianmodel import (IBM855_RUSSIAN_MODEL, IBM866_RUSSIAN_MODEL,
                               ISO_8859_5_RUSSIAN_MODEL, KOI8_R_RUSSIAN_MODEL,
                               MACCYRILLIC_RUSSIAN_MODEL,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 37 Column: 1

              from .langhebrewmodel import WINDOWS_1255_HEBREW_MODEL
# from .langhungarianmodel import (ISO_8859_2_HUNGARIAN_MODEL,
#                                  WINDOWS_1250_HUNGARIAN_MODEL)
from .langrussianmodel import (IBM855_RUSSIAN_MODEL, IBM866_RUSSIAN_MODEL,
                               ISO_8859_5_RUSSIAN_MODEL, KOI8_R_RUSSIAN_MODEL,
                               MACCYRILLIC_RUSSIAN_MODEL,
                               WINDOWS_1251_RUSSIAN_MODEL)
from .langthaimodel import TIS_620_THAI_MODEL
from .langturkishmodel import ISO_8859_9_TURKISH_MODEL

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 41 Column: 1

                                             ISO_8859_5_RUSSIAN_MODEL, KOI8_R_RUSSIAN_MODEL,
                               MACCYRILLIC_RUSSIAN_MODEL,
                               WINDOWS_1251_RUSSIAN_MODEL)
from .langthaimodel import TIS_620_THAI_MODEL
from .langturkishmodel import ISO_8859_9_TURKISH_MODEL
from .sbcharsetprober import SingleByteCharSetProber


class SBCSGroupProber(CharSetGroupProber):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 42 Column: 1

                                             MACCYRILLIC_RUSSIAN_MODEL,
                               WINDOWS_1251_RUSSIAN_MODEL)
from .langthaimodel import TIS_620_THAI_MODEL
from .langturkishmodel import ISO_8859_9_TURKISH_MODEL
from .sbcharsetprober import SingleByteCharSetProber


class SBCSGroupProber(CharSetGroupProber):
    def __init__(self):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 43 Column: 1

                                             WINDOWS_1251_RUSSIAN_MODEL)
from .langthaimodel import TIS_620_THAI_MODEL
from .langturkishmodel import ISO_8859_9_TURKISH_MODEL
from .sbcharsetprober import SingleByteCharSetProber


class SBCSGroupProber(CharSetGroupProber):
    def __init__(self):
        super(SBCSGroupProber, self).__init__()

            

Reported by Pylint.

TODO: See if using ISO-8859-8 Hebrew model works better here, since
Error

Line: 52 Column: 3

                      hebrew_prober = HebrewProber()
        logical_hebrew_prober = SingleByteCharSetProber(WINDOWS_1255_HEBREW_MODEL,
                                                        False, hebrew_prober)
        # TODO: See if using ISO-8859-8 Hebrew model works better here, since
        #       it's actually the visual one
        visual_hebrew_prober = SingleByteCharSetProber(WINDOWS_1255_HEBREW_MODEL,
                                                       True, hebrew_prober)
        hebrew_prober.set_model_probers(logical_hebrew_prober,
                                        visual_hebrew_prober)

            

Reported by Pylint.

pipenv/patched/notpip/_internal/cache.py
16 issues
TODO remove legacy path lookup in pip>=21
Error

Line: 145 Column: 3

                      if os.path.isdir(path):
            for candidate in os.listdir(path):
                candidates.append((candidate, path))
        # TODO remove legacy path lookup in pip>=21
        legacy_path = self.get_path_for_link_legacy(link)
        if os.path.isdir(legacy_path):
            for candidate in os.listdir(legacy_path):
                candidates.append((candidate, legacy_path))
        return candidates

            

Reported by Pylint.

Use lazy % formatting in logging functions
Error

Line: 237 Column: 21

                              continue
            if canonicalize_name(wheel.name) != canonical_package_name:
                logger.debug(
                    "Ignoring cached wheel {} for {} as it "
                    "does not match the expected distribution name {}.".format(
                        wheel_name, link, package_name
                    )
                )
                continue

            

Reported by Pylint.

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

Line: 32 Column: 1

              logger = logging.getLogger(__name__)


def _hash_dict(d):
    # type: (Dict[str, str]) -> str
    """Return a stable sha224 of a dictionary."""
    s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
    return hashlib.sha224(s.encode("ascii")).hexdigest()


            

Reported by Pylint.

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

Line: 35 Column: 5

              def _hash_dict(d):
    # type: (Dict[str, str]) -> str
    """Return a stable sha224 of a dictionary."""
    s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
    return hashlib.sha224(s.encode("ascii")).hexdigest()


class Cache(object):
    """An abstract class - provides cache directories for data from links

            

Reported by Pylint.

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

Line: 39 Column: 1

                  return hashlib.sha224(s.encode("ascii")).hexdigest()


class Cache(object):
    """An abstract class - provides cache directories for data from links


        :param cache_dir: The root of the cache.
        :param format_control: An object of FormatControl class to limit

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 52 Column: 9

              
    def __init__(self, cache_dir, format_control, allowed_formats):
        # type: (str, FormatControl, Set[str]) -> None
        super(Cache, self).__init__()
        assert not cache_dir or os.path.isabs(cache_dir)
        self.cache_dir = cache_dir or None
        self.format_control = format_control
        self.allowed_formats = allowed_formats


            

Reported by Pylint.

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

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

                  def __init__(self, cache_dir, format_control, allowed_formats):
        # type: (str, FormatControl, Set[str]) -> None
        super(Cache, self).__init__()
        assert not cache_dir or os.path.isabs(cache_dir)
        self.cache_dir = cache_dir or None
        self.format_control = format_control
        self.allowed_formats = allowed_formats

        _valid_formats = {"source", "binary"}

            

Reported by Bandit.

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

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

                      self.allowed_formats = allowed_formats

        _valid_formats = {"source", "binary"}
        assert self.allowed_formats.union(_valid_formats) == _valid_formats

    def _get_cache_path_parts_legacy(self, link):
        # type: (Link) -> List[str]
        """Get parts of part that must be os.path.joined with cache_dir


            

Reported by Bandit.

Method could be a function
Error

Line: 61 Column: 5

                      _valid_formats = {"source", "binary"}
        assert self.allowed_formats.union(_valid_formats) == _valid_formats

    def _get_cache_path_parts_legacy(self, link):
        # type: (Link) -> List[str]
        """Get parts of part that must be os.path.joined with cache_dir

        Legacy cache key (pip < 20) for compatibility with older caches.
        """

            

Reported by Pylint.

Method could be a function
Error

Line: 89 Column: 5

              
        return parts

    def _get_cache_path_parts(self, link):
        # type: (Link) -> List[str]
        """Get parts of part that must be os.path.joined with cache_dir
        """

        # We want to generate an url to use as our cache key, we don't want to

            

Reported by Pylint.

pipenv/patched/piptools/scripts/sync.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import shlex
import sys

from ._compat import get_installed_distributions, InstallCommand

from .. import click, sync
from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from ._compat import get_installed_distributions, InstallCommand

from .. import click, sync
from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from ._compat import get_installed_distributions, InstallCommand

from .. import click, sync
from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              
from .. import click, sync
from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map

DEFAULT_REQUIREMENTS_FILE = "requirements.txt"

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from .. import click, sync
from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map

DEFAULT_REQUIREMENTS_FILE = "requirements.txt"


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              from .._compat import parse_requirements
from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map

DEFAULT_REQUIREMENTS_FILE = "requirements.txt"



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from ..exceptions import PipToolsError
from ..logging import log
from ..repositories import PyPIRepository
from ..utils import flat_map

DEFAULT_REQUIREMENTS_FILE = "requirements.txt"


@click.command()

            

Reported by Pylint.

Access to a protected member _build_session of a client class
Error

Line: 116 Column: 15

              
    install_command = InstallCommand()
    options, _ = install_command.parse_args([])
    session = install_command._build_session(options)
    finder = install_command._build_package_finder(options=options, session=session)

    # Parse requirements file. Note, all options inside requirements file
    # will be collected by the finder.
    requirements = flat_map(

            

Reported by Pylint.

Access to a protected member _build_package_finder of a client class
Error

Line: 117 Column: 14

                  install_command = InstallCommand()
    options, _ = install_command.parse_args([])
    session = install_command._build_session(options)
    finder = install_command._build_package_finder(options=options, session=session)

    # Parse requirements file. Note, all options inside requirements file
    # will be collected by the finder.
    requirements = flat_map(
        lambda src: parse_requirements(src, finder=finder, session=session), src_files

            

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 itertools
import os
import shlex
import sys

from ._compat import get_installed_distributions, InstallCommand

            

Reported by Pylint.