The following issues were found

pipenv/patched/yaml3/representer.py
65 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              __all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
    'RepresenterError']

from .error import *
from .nodes import *

import datetime, copyreg, types, base64, collections

class RepresenterError(YAMLError):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

                  'RepresenterError']

from .error import *
from .nodes import *

import datetime, copyreg, types, base64, collections

class RepresenterError(YAMLError):
    pass

            

Reported by Pylint.

Undefined variable 'YAMLError'
Error

Line: 10 Column: 24

              
import datetime, copyreg, types, base64, collections

class RepresenterError(YAMLError):
    pass

class BaseRepresenter:

    yaml_representers = {}

            

Reported by Pylint.

Instance of 'BaseRepresenter' has no 'serialize' member
Error

Line: 28 Column: 9

              
    def represent(self, data):
        node = self.represent_data(data)
        self.serialize(node)
        self.represented_objects = {}
        self.object_keeper = []
        self.alias_key = None

    def represent_data(self, data):

            

Reported by Pylint.

Undefined variable 'ScalarNode'
Error

Line: 60 Column: 28

                              elif None in self.yaml_representers:
                    node = self.yaml_representers[None](self, data)
                else:
                    node = ScalarNode(None, str(data))
        #if alias_key is not None:
        #    self.represented_objects[alias_key] = node
        return node

    @classmethod

            

Reported by Pylint.

Undefined variable 'ScalarNode'
Error

Line: 80 Column: 16

                  def represent_scalar(self, tag, value, style=None):
        if style is None:
            style = self.default_style
        node = ScalarNode(tag, value, style=style)
        if self.alias_key is not None:
            self.represented_objects[self.alias_key] = node
        return node

    def represent_sequence(self, tag, sequence, flow_style=None):

            

Reported by Pylint.

Undefined variable 'SequenceNode'
Error

Line: 87 Column: 16

              
    def represent_sequence(self, tag, sequence, flow_style=None):
        value = []
        node = SequenceNode(tag, value, flow_style=flow_style)
        if self.alias_key is not None:
            self.represented_objects[self.alias_key] = node
        best_style = True
        for item in sequence:
            node_item = self.represent_data(item)

            

Reported by Pylint.

Undefined variable 'ScalarNode'
Error

Line: 93 Column: 43

                      best_style = True
        for item in sequence:
            node_item = self.represent_data(item)
            if not (isinstance(node_item, ScalarNode) and not node_item.style):
                best_style = False
            value.append(node_item)
        if flow_style is None:
            if self.default_flow_style is not None:
                node.flow_style = self.default_flow_style

            

Reported by Pylint.

Undefined variable 'MappingNode'
Error

Line: 105 Column: 16

              
    def represent_mapping(self, tag, mapping, flow_style=None):
        value = []
        node = MappingNode(tag, value, flow_style=flow_style)
        if self.alias_key is not None:
            self.represented_objects[self.alias_key] = node
        best_style = True
        if hasattr(mapping, 'items'):
            mapping = list(mapping.items())

            

Reported by Pylint.

Undefined variable 'ScalarNode'
Error

Line: 119 Column: 42

                      for item_key, item_value in mapping:
            node_key = self.represent_data(item_key)
            node_value = self.represent_data(item_value)
            if not (isinstance(node_key, ScalarNode) and not node_key.style):
                best_style = False
            if not (isinstance(node_value, ScalarNode) and not node_value.style):
                best_style = False
            value.append((node_key, node_value))
        if flow_style is None:

            

Reported by Pylint.

pipenv/patched/yaml3/cyaml.py
64 issues
Unable to import 'yaml._yaml'
Error

Line: 7 Column: 1

                  'CBaseDumper', 'CSafeDumper', 'CDumper'
]

from yaml._yaml import CParser, CEmitter

from .constructor import *

from .serializer import *
from .representer import *

            

Reported by Pylint.

No name '_yaml' in module 'yaml'
Error

Line: 7 Column: 1

                  'CBaseDumper', 'CSafeDumper', 'CDumper'
]

from yaml._yaml import CParser, CEmitter

from .constructor import *

from .serializer import *
from .representer import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              
from yaml._yaml import CParser, CEmitter

from .constructor import *

from .serializer import *
from .representer import *

from .resolver import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from .constructor import *

from .serializer import *
from .representer import *

from .resolver import *

class CBaseLoader(CParser, BaseConstructor, BaseResolver):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .constructor import *

from .serializer import *
from .representer import *

from .resolver import *

class CBaseLoader(CParser, BaseConstructor, BaseResolver):


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from .serializer import *
from .representer import *

from .resolver import *

class CBaseLoader(CParser, BaseConstructor, BaseResolver):

    def __init__(self, stream):
        CParser.__init__(self, stream)

            

Reported by Pylint.

Undefined variable 'BaseResolver'
Error

Line: 16 Column: 45

              
from .resolver import *

class CBaseLoader(CParser, BaseConstructor, BaseResolver):

    def __init__(self, stream):
        CParser.__init__(self, stream)
        BaseConstructor.__init__(self)
        BaseResolver.__init__(self)

            

Reported by Pylint.

Undefined variable 'BaseConstructor'
Error

Line: 16 Column: 28

              
from .resolver import *

class CBaseLoader(CParser, BaseConstructor, BaseResolver):

    def __init__(self, stream):
        CParser.__init__(self, stream)
        BaseConstructor.__init__(self)
        BaseResolver.__init__(self)

            

Reported by Pylint.

Undefined variable 'BaseConstructor'
Error

Line: 20 Column: 9

              
    def __init__(self, stream):
        CParser.__init__(self, stream)
        BaseConstructor.__init__(self)
        BaseResolver.__init__(self)

class CSafeLoader(CParser, SafeConstructor, Resolver):

    def __init__(self, stream):

            

Reported by Pylint.

Undefined variable 'BaseResolver'
Error

Line: 21 Column: 9

                  def __init__(self, stream):
        CParser.__init__(self, stream)
        BaseConstructor.__init__(self)
        BaseResolver.__init__(self)

class CSafeLoader(CParser, SafeConstructor, Resolver):

    def __init__(self, stream):
        CParser.__init__(self, stream)

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/requests/compat.py
63 issues
No name 'getproxies_environment' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'proxy_bypass_environment' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'proxy_bypass' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'quote_plus' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'unquote' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'quote' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'urlencode' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'getproxies' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'unquote_plus' in module 'urllib'
Error

Line: 42 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

Unable to import 'urlparse'
Error

Line: 45 Column: 5

                  from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib
    from Cookie import Morsel
    from StringIO import StringIO
    from collections import Callable, Mapping, MutableMapping, OrderedDict

            

Reported by Pylint.

pipenv/vendor/requirementslib/utils.py
62 issues
Unable to import 'pip_shims.shims'
Error

Line: 8 Column: 1

              import os
import sys

import pip_shims.shims
import six
import six.moves
import tomlkit
import vistir
from six.moves.urllib.parse import urlparse, urlsplit, urlunparse

            

Reported by Pylint.

Unable to import 'tomlkit'
Error

Line: 11 Column: 1

              import pip_shims.shims
import six
import six.moves
import tomlkit
import vistir
from six.moves.urllib.parse import urlparse, urlsplit, urlunparse
from vistir.compat import Path, fs_decode
from vistir.path import ensure_mkdir_p, is_valid_url


            

Reported by Pylint.

Unable to import 'vistir'
Error

Line: 12 Column: 1

              import six
import six.moves
import tomlkit
import vistir
from six.moves.urllib.parse import urlparse, urlsplit, urlunparse
from vistir.compat import Path, fs_decode
from vistir.path import ensure_mkdir_p, is_valid_url

from .environment import MYPY_RUNNING

            

Reported by Pylint.

Unable to import 'vistir.compat'
Error

Line: 14 Column: 1

              import tomlkit
import vistir
from six.moves.urllib.parse import urlparse, urlsplit, urlunparse
from vistir.compat import Path, fs_decode
from vistir.path import ensure_mkdir_p, is_valid_url

from .environment import MYPY_RUNNING

# fmt: off

            

Reported by Pylint.

Unable to import 'vistir.path'
Error

Line: 15 Column: 1

              import vistir
from six.moves.urllib.parse import urlparse, urlsplit, urlunparse
from vistir.compat import Path, fs_decode
from vistir.path import ensure_mkdir_p, is_valid_url

from .environment import MYPY_RUNNING

# fmt: off
six.add_move(  # type: ignore

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              from vistir.compat import Path, fs_decode
from vistir.path import ensure_mkdir_p, is_valid_url

from .environment import MYPY_RUNNING

# fmt: off
six.add_move(  # type: ignore
    six.MovedAttribute("Mapping", "collections", "collections.abc")  # type: ignore
)  # noqa  # isort:skip

            

Reported by Pylint.

Unable to import 'packaging'
Error

Line: 191 Column: 5

              def is_installable_file(path):
    # type: (PipfileType) -> bool
    """Determine if a path can potentially be installed"""
    from packaging import specifiers

    if isinstance(path, Mapping):
        path = convert_entry_to_path(path)

    # If the string starts with a valid specifier operator, test if it is a valid

            

Reported by Pylint.

Unused Iterable imported from typing
Error

Line: 37 Column: 5

              

if MYPY_RUNNING:
    from typing import Dict, Any, Optional, Union, Tuple, List, Iterable, Text, TypeVar

    STRING_TYPE = Union[bytes, str, Text]
    S = TypeVar("S", bytes, str, Text)
    PipfileEntryType = Union[STRING_TYPE, bool, Tuple[STRING_TYPE], List[STRING_TYPE]]
    PipfileType = Union[STRING_TYPE, Dict[STRING_TYPE, PipfileEntryType]]

            

Reported by Pylint.

Unused Any imported from typing
Error

Line: 37 Column: 5

              

if MYPY_RUNNING:
    from typing import Dict, Any, Optional, Union, Tuple, List, Iterable, Text, TypeVar

    STRING_TYPE = Union[bytes, str, Text]
    S = TypeVar("S", bytes, str, Text)
    PipfileEntryType = Union[STRING_TYPE, bool, Tuple[STRING_TYPE], List[STRING_TYPE]]
    PipfileType = Union[STRING_TYPE, Dict[STRING_TYPE, PipfileEntryType]]

            

Reported by Pylint.

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

Line: 351 Column: 5

                  object.
    """

    def __init__(self, exc, seg, path):
        self.exc = exc
        self.seg = seg
        self.path = path

    def __repr__(self):

            

Reported by Pylint.

pipenv/vendor/cerberus/schema.py
62 issues
Unable to import 'cerberus'
Error

Line: 5 Column: 1

              
from warnings import warn

from cerberus import errors
from cerberus.platform import (
    _str_type,
    Callable,
    Hashable,
    Mapping,

            

Reported by Pylint.

Unable to import 'cerberus.platform'
Error

Line: 6 Column: 1

              from warnings import warn

from cerberus import errors
from cerberus.platform import (
    _str_type,
    Callable,
    Hashable,
    Mapping,
    MutableMapping,

            

Reported by Pylint.

Unable to import 'cerberus.utils'
Error

Line: 14 Column: 1

                  MutableMapping,
    Sequence,
)
from cerberus.utils import (
    get_Validator_class,
    validator_factory,
    mapping_hash,
    TypeDefinition,
)

            

Reported by Pylint.

Instance of 'Registry' has no '_expand_definition' member
Error

Line: 499 Column: 31

                      :param definition: The definition.
        :type definition: any :term:`mapping`
        """
        self._storage[name] = self._expand_definition(definition)

    def all(self):
        """
        Returns a :class:`dict` with all registered definitions mapped to their name.
        """

            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 31 Column: 5

                  Raised when the validation schema is missing, has the wrong format or contains
    errors."""

    pass


class DefinitionSchema(MutableMapping):
    """A dict-subclass for caching of validated schemas."""


            

Reported by Pylint.

Unused argument 'args'
Error

Line: 37 Column: 1

              class DefinitionSchema(MutableMapping):
    """A dict-subclass for caching of validated schemas."""

    def __new__(cls, *args, **kwargs):
        if 'SchemaValidator' not in globals():
            global SchemaValidator
            SchemaValidator = validator_factory('SchemaValidator', SchemaValidatorMixin)
            types_mapping = SchemaValidator.types_mapping.copy()
            types_mapping.update(

            

Reported by Pylint.

Unused argument 'kwargs'
Error

Line: 37 Column: 1

              class DefinitionSchema(MutableMapping):
    """A dict-subclass for caching of validated schemas."""

    def __new__(cls, *args, **kwargs):
        if 'SchemaValidator' not in globals():
            global SchemaValidator
            SchemaValidator = validator_factory('SchemaValidator', SchemaValidatorMixin)
            types_mapping = SchemaValidator.types_mapping.copy()
            types_mapping.update(

            

Reported by Pylint.

Global variable 'SchemaValidator' undefined at the module level
Error

Line: 39 Column: 13

              
    def __new__(cls, *args, **kwargs):
        if 'SchemaValidator' not in globals():
            global SchemaValidator
            SchemaValidator = validator_factory('SchemaValidator', SchemaValidatorMixin)
            types_mapping = SchemaValidator.types_mapping.copy()
            types_mapping.update(
                {
                    'callable': TypeDefinition('callable', (Callable,), ()),

            

Reported by Pylint.

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

Line: 70 Column: 17

                          try:
                schema = dict(schema)
            except Exception:
                raise SchemaError(errors.SCHEMA_ERROR_DEFINITION_TYPE.format(schema))

        self.validation_schema = SchemaValidationSchema(validator)
        self.schema_validator = SchemaValidator(
            None,
            allow_unknown=self.validation_schema,

            

Reported by Pylint.

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

Line: 90 Column: 13

                      try:
            del _new_schema[key]
        except ValueError:
            raise SchemaError("Schema has no field '%s' defined" % key)
        except Exception as e:
            raise e
        else:
            del self.schema[key]


            

Reported by Pylint.

pipenv/vendor/requests/compat.py
62 issues
No name 'proxy_bypass' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'getproxies_environment' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'proxy_bypass_environment' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'getproxies' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'urlencode' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'unquote_plus' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'quote_plus' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'unquote' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

No name 'quote' in module 'urllib'
Error

Line: 41 Column: 5

              # ---------

if is_py2:
    from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib

            

Reported by Pylint.

Unable to import 'urlparse'
Error

Line: 44 Column: 5

                  from urllib import (
        quote, unquote, quote_plus, unquote_plus, urlencode, getproxies,
        proxy_bypass, proxy_bypass_environment, getproxies_environment)
    from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
    from urllib2 import parse_http_list
    import cookielib
    from Cookie import Morsel
    from StringIO import StringIO
    # Keep OrderedDict for backwards compatibility.

            

Reported by Pylint.

pipenv/patched/notpip/_internal/utils/misc.py
61 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves'
Error

Line: 25 Column: 1

              #       why we ignore the type on this import.
from pipenv.patched.notpip._vendor.retrying import retry  # type: ignore
from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError

            

Reported by Pylint.

No name 'urllib' in module '_MovedItems'
Error

Line: 26 Column: 1

              from pipenv.patched.notpip._vendor.retrying import retry  # type: ignore
from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError
from pipenv.patched.notpip._internal.locations import (

            

Reported by Pylint.

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

Line: 26 Column: 1

              from pipenv.patched.notpip._vendor.retrying import retry  # type: ignore
from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError
from pipenv.patched.notpip._internal.locations import (

            

Reported by Pylint.

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

Line: 27 Column: 1

              from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError
from pipenv.patched.notpip._internal.locations import (
    get_major_minor_version,

            

Reported by Pylint.

No name 'urllib' in module '_MovedItems'
Error

Line: 27 Column: 1

              from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError
from pipenv.patched.notpip._internal.locations import (
    get_major_minor_version,

            

Reported by Pylint.

The raise statement is not inside an except clause
Error

Line: 156 Column: 9

                      func(path)
        return
    else:
        raise


def path_to_display(path):
    # type: (Optional[Union[str, Text]]) -> Optional[Text]
    """

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 25 Column: 1

              #       why we ignore the type on this import.
from pipenv.patched.notpip._vendor.retrying import retry  # type: ignore
from pipenv.patched.notpip._vendor.six import PY2, text_type
from pipenv.patched.notpip._vendor.six.moves import input
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib.parse import unquote as urllib_unquote

from pipenv.patched.notpip import __version__
from pipenv.patched.notpip._internal.exceptions import CommandError

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 133 Column: 12

              
# Retry every half second for up to 3 seconds
@retry(stop_max_delay=3000, wait_fixed=500)
def rmtree(dir, ignore_errors=False):
    # type: (str, bool) -> None
    from pipenv.vendor.vistir.path import rmtree as vistir_rmtree, handle_remove_readonly
    vistir_rmtree(dir, onerror=handle_remove_readonly, ignore_errors=ignore_errors)



            

Reported by Pylint.

Unused argument 'exc_info'
Error

Line: 139 Column: 37

                  vistir_rmtree(dir, onerror=handle_remove_readonly, ignore_errors=ignore_errors)


def rmtree_errorhandler(func, path, exc_info):
    """On Windows, the files in .svn are read-only, so when rmtree() tries to
    remove them, an exception is thrown.  We catch that here, remove the
    read-only attribute, and hopefully continue without problems."""
    try:
        has_attr_readonly = not (os.stat(path).st_mode & stat.S_IWRITE)

            

Reported by Pylint.

Redefining name 'display_path' from outer scope (line 193)
Error

Line: 174 Column: 9

                      return path
    # Otherwise, path is a bytes object (str in Python 2).
    try:
        display_path = path.decode(sys.getfilesystemencoding(), 'strict')
    except UnicodeDecodeError:
        # Include the full bytes to make troubleshooting easier, even though
        # it may not be very human readable.
        if PY2:
            # Convert the bytes to a readable str representation using

            

Reported by Pylint.

pipenv/vendor/jinja2/utils.py
60 issues
Unable to import 'typing_extensions'
Error

Line: 18 Column: 5

              import markupsafe

if t.TYPE_CHECKING:
    import typing_extensions as te

F = t.TypeVar("F", bound=t.Callable[..., t.Any])

# special singleton representing missing values for the runtime
missing: t.Any = type("MissingType", (), {"__repr__": lambda x: "missing"})()

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 173 Column: 5

                              return default
            return var
    """
    from .runtime import Undefined

    return isinstance(obj, Undefined)


def consume(iterable: t.Iterable[t.Any]) -> None:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 190 Column: 5

                  the time.  Normally you don't have to care about that but if you are
    measuring memory consumption you may want to clean the caches.
    """
    from .environment import get_spontaneous_environment
    from .lexer import _lexer_cache

    get_spontaneous_environment.cache_clear()
    _lexer_cache.clear()


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 191 Column: 5

                  measuring memory consumption you may want to clean the caches.
    """
    from .environment import get_spontaneous_environment
    from .lexer import _lexer_cache

    get_spontaneous_environment.cache_clear()
    _lexer_cache.clear()



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 412 Column: 5

                  n: int = 5, html: bool = True, min: int = 20, max: int = 100
) -> str:
    """Generate some lorem ipsum for the template."""
    from .constants import LOREM_IPSUM_WORDS

    words = LOREM_IPSUM_WORDS.split()
    result = []

    for _ in range(n):

            

Reported by Pylint.

Method has no argument
Error

Line: 816 Column: 5

                  """A namespace object that can hold arbitrary attributes.  It may be
    initialized from a dictionary or with keyword arguments."""

    def __init__(*args: t.Any, **kwargs: t.Any) -> None:  # noqa: B902
        self, args = args[0], args[1:]
        self.__attrs = dict(*args, **kwargs)

    def __getattribute__(self, name: str) -> t.Any:
        # __class__ is needed for the awaitable check in async mode

            

Reported by Pylint.

Unused typing_extensions imported as te
Error

Line: 18 Column: 5

              import markupsafe

if t.TYPE_CHECKING:
    import typing_extensions as te

F = t.TypeVar("F", bound=t.Callable[..., t.Any])

# special singleton representing missing values for the runtime
missing: t.Any = type("MissingType", (), {"__repr__": lambda x: "missing"})()

            

Reported by Pylint.

Redefining name 'pformat' from outer scope (line 249)
Error

Line: 251 Column: 5

              
def pformat(obj: t.Any) -> str:
    """Format an object using :func:`pprint.pformat`."""
    from pprint import pformat  # type: ignore

    return pformat(obj)


_http_re = re.compile(

            

Reported by Pylint.

Redefining built-in 'max'
Error

Line: 409 Column: 51

              

def generate_lorem_ipsum(
    n: int = 5, html: bool = True, min: int = 20, max: int = 100
) -> str:
    """Generate some lorem ipsum for the template."""
    from .constants import LOREM_IPSUM_WORDS

    words = LOREM_IPSUM_WORDS.split()

            

Reported by Pylint.

Redefining built-in 'min'
Error

Line: 409 Column: 36

              

def generate_lorem_ipsum(
    n: int = 5, html: bool = True, min: int = 20, max: int = 100
) -> str:
    """Generate some lorem ipsum for the template."""
    from .constants import LOREM_IPSUM_WORDS

    words = LOREM_IPSUM_WORDS.split()

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/serializer.py
59 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from codecs import register_error, xmlcharrefreplace_errors

from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . import treewalkers, _utils
from xml.sax.saxutils import escape

_quoteAttributeSpecChars = "".join(spaceCharacters) + "\"'=<>`"

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from codecs import register_error, xmlcharrefreplace_errors

from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . import treewalkers, _utils
from xml.sax.saxutils import escape

_quoteAttributeSpecChars = "".join(spaceCharacters) + "\"'=<>`"
_quoteAttributeSpec = re.compile("[" + _quoteAttributeSpecChars + "]")

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . import treewalkers, _utils
from xml.sax.saxutils import escape

_quoteAttributeSpecChars = "".join(spaceCharacters) + "\"'=<>`"
_quoteAttributeSpec = re.compile("[" + _quoteAttributeSpecChars + "]")
_quoteAttributeLegacy = re.compile("[" + _quoteAttributeSpecChars +

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 245 Column: 13

                      self.errors = []

        if encoding and self.inject_meta_charset:
            from .filters.inject_meta_charset import Filter
            treewalker = Filter(treewalker, encoding)
        # Alphabetical attributes is here under the assumption that none of
        # the later filters add or change order of attributes; it needs to be
        # before the sanitizer so escaped elements come out correctly
        if self.alphabetical_attributes:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 251 Column: 13

                      # the later filters add or change order of attributes; it needs to be
        # before the sanitizer so escaped elements come out correctly
        if self.alphabetical_attributes:
            from .filters.alphabeticalattributes import Filter
            treewalker = Filter(treewalker)
        # WhitespaceFilter should be used before OptionalTagFilter
        # for maximum efficiently of this latter filter
        if self.strip_whitespace:
            from .filters.whitespace import Filter

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 256 Column: 13

                      # WhitespaceFilter should be used before OptionalTagFilter
        # for maximum efficiently of this latter filter
        if self.strip_whitespace:
            from .filters.whitespace import Filter
            treewalker = Filter(treewalker)
        if self.sanitize:
            from .filters.sanitizer import Filter
            treewalker = Filter(treewalker)
        if self.omit_optional_tags:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 259 Column: 13

                          from .filters.whitespace import Filter
            treewalker = Filter(treewalker)
        if self.sanitize:
            from .filters.sanitizer import Filter
            treewalker = Filter(treewalker)
        if self.omit_optional_tags:
            from .filters.optionaltags import Filter
            treewalker = Filter(treewalker)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 262 Column: 13

                          from .filters.sanitizer import Filter
            treewalker = Filter(treewalker)
        if self.omit_optional_tags:
            from .filters.optionaltags import Filter
            treewalker = Filter(treewalker)

        for token in treewalker:
            type = token["type"]
            if type == "Doctype":

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 75 Column: 15

              register_error("htmlentityreplace", htmlentityreplace_errors)


def serialize(input, tree="etree", encoding=None, **serializer_opts):
    """Serializes the input token stream using the specified treewalker

    :arg input: the token stream to serialize

    :arg tree: the treewalker to use

            

Reported by Pylint.

XXX: Should we cache this?
Error

Line: 98 Column: 3

                  '<html><head></head><body><p>Hi!</p></body></html>'

    """
    # XXX: Should we cache this?
    walker = treewalkers.getTreeWalker(tree)
    s = HTMLSerializer(**serializer_opts)
    return s.render(walker(input), encoding)



            

Reported by Pylint.

pipenv/patched/notpip/_internal/req/req_install.py
59 issues
FIXME: Is there a better place to create the build_dir? (hg and bzr
Error

Line: 369 Column: 3

                          name = self.name.lower()
        else:
            name = self.name
        # FIXME: Is there a better place to create the build_dir? (hg and bzr
        # need this)
        if not os.path.exists(build_dir):
            logger.debug('Creating directory %s', build_dir)
            os.makedirs(build_dir)
            write_delete_marker_file(build_dir)

            

Reported by Pylint.

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

Line: 455 Column: 21

                                  self.should_reinstall = True
                elif (running_under_virtualenv() and
                        dist_in_site_packages(existing_dist)):
                    raise InstallationError(
                        "Will not install to the user site because it will "
                        "lack sys.path precedence to %s in %s" %
                        (existing_dist.project_name, existing_dist.location)
                    )
            else:

            

Reported by Pylint.

Attribute '_metadata' defined outside __init__
Error

Line: 578 Column: 13

                  def metadata(self):
        # type: () -> Any
        if not hasattr(self, '_metadata'):
            self._metadata = get_metadata(self.get_dist())

        return self._metadata

    def get_dist(self):
        # type: () -> Distribution

            

Reported by Pylint.

Unused variable 'url'
Error

Line: 635 Column: 18

                          # Static paths don't get updated
            return
        assert '+' in self.link.url, "bad url: %r" % self.link.url
        vc_type, url = self.link.url.split('+', 1)
        vcs_backend = vcs.get_backend(vc_type)
        if vcs_backend:
            if not self.link.is_vcs:
                reason = (
                    "This form of VCS requirement is being deprecated: {}."

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 745 Column: 13

                          archive_path, 'w', zipfile.ZIP_DEFLATED, allowZip64=True,
        )
        with zip_output:
            dir = os.path.normcase(
                os.path.abspath(self.unpacked_source_directory)
            )
            for dirpath, dirnames, filenames in os.walk(dir):
                if 'pip-egg-info' in dirnames:
                    dirnames.remove('pip-egg-info')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # The following comment should be removed at some point in the future.
# mypy: strict-optional=False

from __future__ import absolute_import

import logging
import os
import shutil
import sys

            

Reported by Pylint.

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

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

                  if dist_dir.endswith(".egg-info"):
        dist_cls = pkg_resources.Distribution
    else:
        assert dist_dir.endswith(".dist-info")
        dist_cls = pkg_resources.DistInfoDistribution

    # Build a PathMetadata object, from path to metadata. :wink:
    base_dir, dist_dir_name = os.path.split(dist_dir)
    dist_name = os.path.splitext(dist_dir_name)[0]

            

Reported by Bandit.

Too many public methods (28/20)
Error

Line: 99 Column: 1

                  )


class InstallRequirement(object):
    """
    Represents something that may be installed later on, may have information
    about where to fetch the relevant requirement and also contains logic for
    installing the said requirement.
    """

            

Reported by Pylint.

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

Line: 99 Column: 1

                  )


class InstallRequirement(object):
    """
    Represents something that may be installed later on, may have information
    about where to fetch the relevant requirement and also contains logic for
    installing the said requirement.
    """

            

Reported by Pylint.

Too many instance attributes (26/7)
Error

Line: 99 Column: 1

                  )


class InstallRequirement(object):
    """
    Represents something that may be installed later on, may have information
    about where to fetch the relevant requirement and also contains logic for
    installing the said requirement.
    """

            

Reported by Pylint.