The following issues were found

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

Line: 28 Column: 1

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

from .enums import ProbingState
from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

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

from .enums import ProbingState
from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 76 Column: 17

                              continue
            if state == ProbingState.FOUND_IT:
                self._best_guess_prober = prober
                self._state = ProbingState.FOUND_IT
                return self.state
            elif state == ProbingState.NOT_ME:
                prober.active = False
                self._active_num -= 1
                if self._active_num <= 0:

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 82 Column: 21

                              prober.active = False
                self._active_num -= 1
                if self._active_num <= 0:
                    self._state = ProbingState.NOT_ME
                    return self.state
        return self.state

    def get_confidence(self):
        state = self.state

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

Missing class docstring
Error

Line: 32 Column: 1

              from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
        self._active_num = 0
        self.probers = []
        self._best_guess_prober = None

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 34 Column: 9

              
class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
        self._active_num = 0
        self.probers = []
        self._best_guess_prober = None

    def reset(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                      self.probers = []
        self._best_guess_prober = None

    def reset(self):
        super(CharSetGroupProber, self).reset()
        self._active_num = 0
        for prober in self.probers:
            if prober:
                prober.reset()

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 40 Column: 9

                      self._best_guess_prober = None

    def reset(self):
        super(CharSetGroupProber, self).reset()
        self._active_num = 0
        for prober in self.probers:
            if prober:
                prober.reset()
                prober.active = True

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

                      self._best_guess_prober = None

    @property
    def charset_name(self):
        if not self._best_guess_prober:
            self.get_confidence()
            if not self._best_guess_prober:
                return None
        return self._best_guess_prober.charset_name

            

Reported by Pylint.

pipenv/_compat.py
14 issues
Unable to import 'vistir'
Error

Line: 9 Column: 1

              import sys
import warnings

import vistir

from pipenv.vendor.vistir.compat import (
    NamedTemporaryFile, Path, ResourceWarning, TemporaryDirectory
)


            

Reported by Pylint.

Redefining built-in 'ResourceWarning'
Error

Line: 11 Column: 1

              
import vistir

from pipenv.vendor.vistir.compat import (
    NamedTemporaryFile, Path, ResourceWarning, TemporaryDirectory
)

warnings.filterwarnings("ignore", category=ResourceWarning)


            

Reported by Pylint.

Unused argument 'target'
Error

Line: 106 Column: 31

              }


def decode_for_output(output, target=sys.stdout):
    return vistir.misc.decode_for_output(
        output, sys.stdout, translation_map=UNICODE_TO_ASCII_TRANSLATION_MAP
    )



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 25 Column: 1

              ]


def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    return locale.getpreferredencoding(False)


            

Reported by Pylint.

Import outside toplevel (locale)
Error

Line: 26 Column: 5

              

def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    return locale.getpreferredencoding(False)



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 35 Column: 1

              DEFAULT_ENCODING = getpreferredencoding()


def canonical_encoding_name(name):
    import codecs
    try:
        codec = codecs.lookup(name)
    except LookupError:
        return name

            

Reported by Pylint.

Import outside toplevel (codecs)
Error

Line: 36 Column: 5

              

def canonical_encoding_name(name):
    import codecs
    try:
        codec = codecs.lookup(name)
    except LookupError:
        return name
    else:

            

Reported by Pylint.

Too many branches (16/12)
Error

Line: 47 Column: 1

              
# From https://github.com/CarlFK/veyepar/blob/5c5de47/dj/scripts/fixunicode.py
# MIT LIcensed, thanks Carl!
def force_encoding():
    try:
        stdout_isatty = sys.stdout.isatty
        stderr_isatty = sys.stderr.isatty
    except AttributeError:
        return DEFAULT_ENCODING, DEFAULT_ENCODING

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 47 Column: 1

              
# From https://github.com/CarlFK/veyepar/blob/5c5de47/dj/scripts/fixunicode.py
# MIT LIcensed, thanks Carl!
def force_encoding():
    try:
        stdout_isatty = sys.stdout.isatty
        stderr_isatty = sys.stderr.isatty
    except AttributeError:
        return DEFAULT_ENCODING, DEFAULT_ENCODING

            

Reported by Pylint.

Import outside toplevel (ctypes.pythonapi, ctypes.py_object, ctypes.c_char_p)
Error

Line: 63 Column: 13

                  if stdout_encoding != "utf-8" or stderr_encoding != "utf-8":

        try:
            from ctypes import pythonapi, py_object, c_char_p
        except ImportError:
            return DEFAULT_ENCODING, DEFAULT_ENCODING
        try:
            PyFile_SetEncoding = pythonapi.PyFile_SetEncoding
        except AttributeError:

            

Reported by Pylint.

pipenv/vendor/importlib_resources/_compat.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 45 Column: 9

                      return self.spec.origin

    def get_resource_reader(self, name):
        from . import readers, _adapters

        def _zip_reader(spec):
            with suppress(AttributeError):
                return readers.ZipReader(spec.loader, spec.name)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 96 Column: 5

                  Supersedes _adapters.wrap_spec to use TraversableResourcesLoader
    from above for older Python compatibility (<3.10).
    """
    from . import _adapters

    return _adapters.SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)

            

Reported by Pylint.

Unused Path imported from zipfile as ZipPath
Error

Line: 9 Column: 5

              from contextlib import suppress

if sys.version_info >= (3, 10):
    from zipfile import Path as ZipPath  # type: ignore
else:
    from zipp import Path as ZipPath  # type: ignore


try:

            

Reported by Pylint.

Unused runtime_checkable imported from typing
Error

Line: 15 Column: 5

              

try:
    from typing import runtime_checkable  # type: ignore
except ImportError:

    def runtime_checkable(cls):  # type: ignore
        return cls


            

Reported by Pylint.

Unused Protocol imported from typing
Error

Line: 23 Column: 5

              

try:
    from typing import Protocol  # type: ignore
except ImportError:
    Protocol = abc.ABC  # type: ignore


class TraversableResourcesLoader:

            

Reported by Pylint.

Unused argument 'name'
Error

Line: 44 Column: 35

                  def path(self):
        return self.spec.origin

    def get_resource_reader(self, name):
        from . import readers, _adapters

        def _zip_reader(spec):
            with suppress(AttributeError):
                return readers.ZipReader(spec.loader, spec.name)

            

Reported by Pylint.

Unused argument 'spec'
Error

Line: 63 Column: 26

                          reader = _available_reader(spec)
            return reader if hasattr(reader, 'files') else None

        def _file_reader(spec):
            try:
                path = pathlib.Path(self.path)
            except TypeError:
                return None
            if path.exists():

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # flake8: noqa

import abc
import sys
import pathlib
from contextlib import suppress

if sys.version_info >= (3, 10):
    from zipfile import Path as ZipPath  # type: ignore

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 18 Column: 5

                  from typing import runtime_checkable  # type: ignore
except ImportError:

    def runtime_checkable(cls):  # type: ignore
        return cls


try:
    from typing import Protocol  # type: ignore

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 41 Column: 5

                      self.spec = spec

    @property
    def path(self):
        return self.spec.origin

    def get_resource_reader(self, name):
        from . import readers, _adapters


            

Reported by Pylint.

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

Line: 1 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 2 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Undefined variable 'encode'
Error

Line: 5 Column: 12

              from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)

def nameprep(s):

            

Reported by Pylint.

Undefined variable 'decode'
Error

Line: 8 Column: 12

                  return encode(label)

def ToUnicode(label):
    return decode(label)

def nameprep(s):
    raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol")


            

Reported by Pylint.

Wildcard import core
Error

Line: 1 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Wildcard import codec
Error

Line: 2 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Function name "ToASCII" doesn't conform to snake_case naming style
Error

Line: 4 Column: 1

              from .core import *
from .codec import *

def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)


            

Reported by Pylint.

Function name "ToUnicode" doesn't conform to snake_case naming style
Error

Line: 7 Column: 1

              def ToASCII(label):
    return encode(label)

def ToUnicode(label):
    return decode(label)

def nameprep(s):
    raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol")


            

Reported by Pylint.

pipenv/patched/notpip/_internal/cli/req_command.py
14 issues
Uses of a deprecated module 'optparse'
Error

Line: 34 Column: 5

              from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from optparse import Values
    from typing import List, Optional, Tuple
    from pipenv.patched.notpip._internal.cache import WheelCache
    from pipenv.patched.notpip._internal.models.target_python import TargetPython
    from pipenv.patched.notpip._internal.req.req_set import RequirementSet
    from pipenv.patched.notpip._internal.req.req_tracker import RequirementTracker

            

Reported by Pylint.

Method 'run' is abstract in class 'Command' but is not overridden
Error

Line: 121 Column: 1

                      return session


class IndexGroupCommand(Command, SessionCommandMixin):

    """
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.

            

Reported by Pylint.

Method 'run' is abstract in class 'Command' but is not overridden
Error

Line: 152 Column: 1

                          pip_self_version_check(session, options)


class RequirementCommand(IndexGroupCommand):

    @staticmethod
    def make_requirement_preparer(
        temp_build_dir,           # type: TempDirectory
        options,                  # type: Values

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 52 Column: 9

                  """
    def __init__(self):
        # type: () -> None
        super(SessionCommandMixin, self).__init__()
        self._session = None  # Optional[PipSession]

    @classmethod
    def _get_index_urls(cls, options):
        # type: (Values) -> Optional[List[str]]

            

Reported by Pylint.

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

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

                          # there's no type annotation on requests.Session, so it's
            # automatically ContextManager[Any] and self._session becomes Any,
            # then https://github.com/python/mypy/issues/7696 kicks in
            assert self._session is not None
        return self._session

    def _build_session(self, options, retries=None, timeout=None):
        # type: (Values, Optional[int], Optional[int]) -> PipSession
        assert not options.cache_dir or os.path.isabs(options.cache_dir)

            

Reported by Bandit.

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

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

              
    def _build_session(self, options, retries=None, timeout=None):
        # type: (Values, Optional[int], Optional[int]) -> PipSession
        assert not options.cache_dir or os.path.isabs(options.cache_dir)
        session = PipSession(
            cache=(
                os.path.join(options.cache_dir, "http")
                if options.cache_dir else None
            ),

            

Reported by Bandit.

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

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

                      This overrides the default behavior of not doing the check.
        """
        # Make sure the index_group options are present.
        assert hasattr(options, 'no_index')

        if options.disable_pip_version_check or options.no_index:
            return

        # Otherwise, check if we're using the latest version of pip available.

            

Reported by Bandit.

Missing class docstring
Error

Line: 152 Column: 1

                          pip_self_version_check(session, options)


class RequirementCommand(IndexGroupCommand):

    @staticmethod
    def make_requirement_preparer(
        temp_build_dir,           # type: TempDirectory
        options,                  # type: Values

            

Reported by Pylint.

Too many arguments (8/5)
Error

Line: 155 Column: 5

              class RequirementCommand(IndexGroupCommand):

    @staticmethod
    def make_requirement_preparer(
        temp_build_dir,           # type: TempDirectory
        options,                  # type: Values
        req_tracker,              # type: RequirementTracker
        session,                  # type: PipSession
        finder,                   # type: PackageFinder

            

Reported by Pylint.

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

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

                      downloader = Downloader(session, progress_bar=options.progress_bar)

        temp_build_dir_path = temp_build_dir.path
        assert temp_build_dir_path is not None

        return RequirementPreparer(
            build_dir=temp_build_dir_path,
            src_dir=options.src_dir,
            download_dir=download_dir,

            

Reported by Bandit.

pipenv/patched/notpip/_vendor/html5lib/treewalkers/genshi.py
14 issues
No name 'core' in module 'genshi'
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces

            

Reported by Pylint.

Unable to import 'genshi.core'
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces

            

Reported by Pylint.

Unable to import 'genshi.core'
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces

            

Reported by Pylint.

No name 'core' in module 'genshi'
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces

            

Reported by Pylint.

Unable to import 'genshi.core'
Error

Line: 5 Column: 1

              
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces


            

Reported by Pylint.

No name 'core' in module 'genshi'
Error

Line: 5 Column: 1

              
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces


class TreeWalker(base.TreeWalker):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              
from . import base

from ..constants import voidElements, namespaces


class TreeWalker(base.TreeWalker):
    def __iter__(self):
        # Buffer the events so we can pass in the following one

            

Reported by Pylint.

Redefining built-in 'next'
Error

Line: 27 Column: 29

                          for token in self.tokens(previous, None):
                yield token

    def tokens(self, event, next):
        kind, data, _ = event
        if kind == START:
            tag, attribs = data
            name = tag.localname
            namespace = tag.namespace

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT

from . import base

from ..constants import voidElements, namespaces

            

Reported by Pylint.

pipenv/vendor/ptyprocess/util.py
14 issues
Unused which imported from shutil
Error

Line: 2 Column: 5

              try:
    from shutil import which  # Python >= 3.3
except ImportError:
    import os, sys
    
    # This is copied from Python 3.4.1
    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
        """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 59 Column: 13

                          files = [cmd]
    
        seen = set()
        for dir in path:
            normdir = os.path.normcase(dir)
            if not normdir in seen:
                seen.add(normdir)
                for thefile in files:
                    name = os.path.join(dir, thefile)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from shutil import which  # Python >= 3.3
except ImportError:
    import os, sys
    
    # This is copied from Python 3.4.1
    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
        """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such

            

Reported by Pylint.

Multiple imports on one line (os, sys)
Error

Line: 4 Column: 5

              try:
    from shutil import which  # Python >= 3.3
except ImportError:
    import os, sys
    
    # This is copied from Python 3.4.1
    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
        """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such

            

Reported by Pylint.

Trailing whitespace
Error

Line: 5 Column: 1

                  from shutil import which  # Python >= 3.3
except ImportError:
    import os, sys
    
    # This is copied from Python 3.4.1
    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
        """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

            

Reported by Pylint.

Too many branches (13/12)
Error

Line: 7 Column: 5

                  import os, sys
    
    # This is copied from Python 3.4.1
    def which(cmd, mode=os.F_OK | os.X_OK, path=None):
        """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.
    
        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result

            

Reported by Pylint.

Trailing whitespace
Error

Line: 11 Column: 1

                      """Given a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.
    
        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
    
        """

            

Reported by Pylint.

Trailing whitespace
Error

Line: 15 Column: 1

                      `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.
    
        """
        # Check that a given file can be accessed with the correct mode.
        # Additionally check that `file` is not a directory, as on Windows
        # directories pass the os.access check.
        def _access_check(fn, mode):

            

Reported by Pylint.

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

Line: 20 Column: 9

                      # Check that a given file can be accessed with the correct mode.
        # Additionally check that `file` is not a directory, as on Windows
        # directories pass the os.access check.
        def _access_check(fn, mode):
            return (os.path.exists(fn) and os.access(fn, mode)
                    and not os.path.isdir(fn))
    
        # If we're given a path with a directory part, look it up directly rather
        # than referring to PATH directories. This includes checking relative to the

            

Reported by Pylint.

Trailing whitespace
Error

Line: 23 Column: 1

                      def _access_check(fn, mode):
            return (os.path.exists(fn) and os.access(fn, mode)
                    and not os.path.isdir(fn))
    
        # If we're given a path with a directory part, look it up directly rather
        # than referring to PATH directories. This includes checking relative to the
        # current directory, e.g. ./script
        if os.path.dirname(cmd):
            if _access_check(cmd, mode):

            

Reported by Pylint.

pipenv/vendor/click_completion/__init__.py
14 issues
Unable to import 'click_completion.core'
Error

Line: 11 Column: 1

              from click import ParamType
from enum import Enum

from click_completion.core import completion_configuration, get_code, install, shells, resolve_ctx, get_choices, \
    startswith, Shell
from click_completion.lib import get_auto_shell
from click_completion.patch import patch as _patch

__version__ = '0.5.2'

            

Reported by Pylint.

Unable to import 'click_completion.lib'
Error

Line: 13 Column: 1

              
from click_completion.core import completion_configuration, get_code, install, shells, resolve_ctx, get_choices, \
    startswith, Shell
from click_completion.lib import get_auto_shell
from click_completion.patch import patch as _patch

__version__ = '0.5.2'

_initialized = False

            

Reported by Pylint.

Unable to import 'click_completion.patch'
Error

Line: 14 Column: 1

              from click_completion.core import completion_configuration, get_code, install, shells, resolve_ctx, get_choices, \
    startswith, Shell
from click_completion.lib import get_auto_shell
from click_completion.patch import patch as _patch

__version__ = '0.5.2'

_initialized = False


            

Reported by Pylint.

Using the global statement
Error

Line: 32 Column: 5

                      a function with two parameters choice and incomplete. Must return True
        if incomplete is a correct match for choice, False otherwise.
    """
    global _initialized
    if not _initialized:
        _patch()
        completion_configuration.complete_options = complete_options
        if match_incomplete is not None:
            completion_configuration.match_incomplete = match_incomplete

            

Reported by Pylint.

Unused argument 'ctx'
Error

Line: 86 Column: 24

                  def __repr__(self):
        return 'DocumentedChoice(%r)' % list(self.choices.keys())

    def complete(self, ctx, incomplete):
        match = completion_configuration.match_incomplete
        return [(c, v) for c, v in six.iteritems(self.choices) if match(c, incomplete)]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
# -*- coding:utf-8 -*-

from __future__ import print_function, absolute_import

import six

from click import ParamType
from enum import Enum

            

Reported by Pylint.

standard import "from enum import Enum" should be placed before "import six"
Error

Line: 9 Column: 1

              import six

from click import ParamType
from enum import Enum

from click_completion.core import completion_configuration, get_code, install, shells, resolve_ctx, get_choices, \
    startswith, Shell
from click_completion.lib import get_auto_shell
from click_completion.patch import patch as _patch

            

Reported by Pylint.

Line too long (114/100)
Error

Line: 11 Column: 1

              from click import ParamType
from enum import Enum

from click_completion.core import completion_configuration, get_code, install, shells, resolve_ctx, get_choices, \
    startswith, Shell
from click_completion.lib import get_auto_shell
from click_completion.patch import patch as _patch

__version__ = '0.5.2'

            

Reported by Pylint.

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

Line: 18 Column: 1

              
__version__ = '0.5.2'

_initialized = False


def init(complete_options=False, match_incomplete=None):
    """Initialize the enhanced click completion


            

Reported by Pylint.

Line too long (105/100)
Error

Line: 27 Column: 1

                  Parameters
    ----------
    complete_options : bool
        always complete the options, even when the user hasn't typed a first dash (Default value = False)
    match_incomplete : func
        a function with two parameters choice and incomplete. Must return True
        if incomplete is a correct match for choice, False otherwise.
    """
    global _initialized

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/chardet/universaldetector.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 43 Column: 1

              import logging
import re

from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 44 Column: 1

              import re

from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 45 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 46 Column: 1

              from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 47 Column: 1

              from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 48 Column: 1

              from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """
    The ``UniversalDetector`` class underlies the ``chardet.detect`` function

            

Reported by Pylint.

Using possibly undefined loop variable 'prober'
Error

Line: 283 Column: 43

                                                            prober.get_confidence())
                    else:
                        self.logger.debug('%s %s confidence = %s',
                                          prober.charset_name,
                                          prober.language,
                                          prober.get_confidence())
        return self.result

            

Reported by Pylint.

Using possibly undefined loop variable 'prober'
Error

Line: 284 Column: 43

                                  else:
                        self.logger.debug('%s %s confidence = %s',
                                          prober.charset_name,
                                          prober.language,
                                          prober.get_confidence())
        return self.result

            

Reported by Pylint.

Using possibly undefined loop variable 'prober'
Error

Line: 285 Column: 43

                                      self.logger.debug('%s %s confidence = %s',
                                          prober.charset_name,
                                          prober.language,
                                          prober.get_confidence())
        return self.result

            

Reported by Pylint.

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

Line: 51 Column: 1

              from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """
    The ``UniversalDetector`` class underlies the ``chardet.detect`` function
    and coordinates all of the different charset probers.

    To get a ``dict`` containing an encoding and its confidence, you can simply

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/chardet/sbcsgroupprober.py
14 issues
Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

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

from .charsetgroupprober import CharSetGroupProber
from .sbcharsetprober import SingleByteCharSetProber
from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
                                Latin5CyrillicModel, MacCyrillicModel,
                                Ibm866Model, Ibm855Model)
from .langgreekmodel import Latin7GreekModel, Win1253GreekModel

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

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

from .charsetgroupprober import CharSetGroupProber
from .sbcharsetprober import SingleByteCharSetProber
from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
                                Latin5CyrillicModel, MacCyrillicModel,
                                Ibm866Model, Ibm855Model)
from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .sbcharsetprober import SingleByteCharSetProber
from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
                                Latin5CyrillicModel, MacCyrillicModel,
                                Ibm866Model, Ibm855Model)
from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

              from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
                                Latin5CyrillicModel, MacCyrillicModel,
                                Ibm866Model, Ibm855Model)
from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 35 Column: 1

                                              Latin5CyrillicModel, MacCyrillicModel,
                                Ibm866Model, Ibm855Model)
from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber
from .langturkishmodel import Latin5TurkishModel

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 37 Column: 1

              from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber
from .langturkishmodel import Latin5TurkishModel



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 38 Column: 1

              from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber
from .langturkishmodel import Latin5TurkishModel


class SBCSGroupProber(CharSetGroupProber):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 39 Column: 1

              # from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber
from .langturkishmodel import Latin5TurkishModel


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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 40 Column: 1

              from .langthaimodel import TIS620ThaiModel
from .langhebrewmodel import Win1255HebrewModel
from .hebrewprober import HebrewProber
from .langturkishmodel import Latin5TurkishModel


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

            

Reported by Pylint.

TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250)
Error

Line: 57 Column: 3

                          SingleByteCharSetProber(Win1253GreekModel),
            SingleByteCharSetProber(Latin5BulgarianModel),
            SingleByteCharSetProber(Win1251BulgarianModel),
            # TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250)
            #       after we retrain model.
            # SingleByteCharSetProber(Latin2HungarianModel),
            # SingleByteCharSetProber(Win1250HungarianModel),
            SingleByteCharSetProber(TIS620ThaiModel),
            SingleByteCharSetProber(Latin5TurkishModel),

            

Reported by Pylint.