The following issues were found

pipenv/vendor/jinja2/tests.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from collections import abc
from numbers import Number

from .runtime import Undefined
from .utils import pass_environment

if t.TYPE_CHECKING:
    from .environment import Environment


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from numbers import Number

from .runtime import Undefined
from .utils import pass_environment

if t.TYPE_CHECKING:
    from .environment import Environment



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 5

              from .utils import pass_environment

if t.TYPE_CHECKING:
    from .environment import Environment


def test_odd(value: int) -> bool:
    """Return true if the variable is odd."""
    return value % 2 == 1

            

Reported by Pylint.

Unused Environment imported from environment
Error

Line: 11 Column: 5

              from .utils import pass_environment

if t.TYPE_CHECKING:
    from .environment import Environment


def test_odd(value: int) -> bool:
    """Return true if the variable is odd."""
    return value % 2 == 1

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 172 Column: 9

                  """
    try:
        len(value)
        value.__getitem__
    except Exception:
        return False

    return True


            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 173 Column: 12

                  try:
        len(value)
        value.__getitem__
    except Exception:
        return False

    return True



            

Reported by Pylint.

tests/fixtures/cython-import-package/setup.py
6 issues
Unable to import 'Cython.Build'
Error

Line: 9 Column: 1

              
# ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100
import Cython.Distutils



ROOT = os.path.dirname(__file__)

            

Reported by Pylint.

Unable to import 'Cython.Distutils'
Error

Line: 10 Column: 1

              # ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100
import Cython.Distutils



ROOT = os.path.dirname(__file__)


            

Reported by Pylint.

Unused test imported from setuptools.command.test as TestCommand
Error

Line: 5 Column: 1

              import os

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

# ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100
import Cython.Distutils

            

Reported by Pylint.

Unused cythonize imported from Cython.Build
Error

Line: 9 Column: 1

              
# ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100
import Cython.Distutils



ROOT = os.path.dirname(__file__)

            

Reported by Pylint.

Unused import Cython.Distutils
Error

Line: 10 Column: 1

              # ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100
import Cython.Distutils



ROOT = os.path.dirname(__file__)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import ast
import os

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

# ORDER MATTERS
# Import this after setuptools or it will fail
from Cython.Build import cythonize  # noqa: I100

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/contrib/_securetransport/bindings.py
6 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 394 Column: 5

                  CoreFoundation.CFDictionaryRef = CFDictionaryRef

except (AttributeError):
    raise ImportError("Error initializing ctypes")


class CFConst(object):
    """
    A class object that acts as essentially a namespace for CoreFoundation

            

Reported by Pylint.

Unnecessary parens after 'except' keyword
Error

Line: 393 Column: 1

                  CoreFoundation.CFStringRef = CFStringRef
    CoreFoundation.CFDictionaryRef = CFDictionaryRef

except (AttributeError):
    raise ImportError("Error initializing ctypes")


class CFConst(object):
    """

            

Reported by Pylint.

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

Line: 397 Column: 1

                  raise ImportError("Error initializing ctypes")


class CFConst(object):
    """
    A class object that acts as essentially a namespace for CoreFoundation
    constants.
    """


            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 397 Column: 1

                  raise ImportError("Error initializing ctypes")


class CFConst(object):
    """
    A class object that acts as essentially a namespace for CoreFoundation
    constants.
    """


            

Reported by Pylint.

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

Line: 406 Column: 1

                  kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)


class SecurityConst(object):
    """
    A class object that acts as essentially a namespace for Security constants.
    """

    kSSLSessionOptionBreakOnServerAuth = 0

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 406 Column: 1

                  kCFStringEncodingUTF8 = CFStringEncoding(0x08000100)


class SecurityConst(object):
    """
    A class object that acts as essentially a namespace for Security constants.
    """

    kSSLSessionOptionBreakOnServerAuth = 0

            

Reported by Pylint.

pipenv/vendor/urllib3/util/request.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
from base64 import b64encode

from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types

# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Encoding``,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from base64 import b64encode

from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types

# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.
# The only headers that are supported are ``Accept-Encoding``,
# ``Host``, and ``User-Agent``.

            

Reported by Pylint.

Unused brotli imported as _unused_module_brotli
Error

Line: 17 Column: 5

              
ACCEPT_ENCODING = "gzip,deflate"
try:
    import brotli as _unused_module_brotli  # noqa: F401
except ImportError:
    pass
else:
    ACCEPT_ENCODING += ",br"


            

Reported by Pylint.

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

Line: 132 Column: 13

                      try:
            body_seek(body_pos)
        except (IOError, OSError):
            raise UnrewindableBodyError(
                "An error occurred when rewinding request body for redirect/retry."
            )
    elif body_pos is _FAILEDTELL:
        raise UnrewindableBodyError(
            "Unable to record file position for rewinding "

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

from base64 import b64encode

from ..exceptions import UnrewindableBodyError
from ..packages.six import b, integer_types

# Pass as a value within ``headers`` to skip
# emitting some HTTP headers that are added automatically.

            

Reported by Pylint.

Too many arguments (6/5)
Error

Line: 26 Column: 1

              _FAILEDTELL = object()


def make_headers(
    keep_alive=None,
    accept_encoding=None,
    user_agent=None,
    basic_auth=None,
    proxy_basic_auth=None,

            

Reported by Pylint.

pipenv/vendor/plette/models/scripts.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
import six

from .base import DataView


class Script(DataView):
    """Parse a script line (in Pipfile's [scripts] section).


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import re
import shlex

import six

from .base import DataView


class Script(DataView):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 25 Column: 9

                  }

    def __init__(self, data):
        super(Script, self).__init__(data)
        if isinstance(data, six.string_types):
            data = shlex.split(data)
        self._parts = [data[0]]
        self._parts.extend(data[1:])


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 32 Column: 5

                      self._parts.extend(data[1:])

    @classmethod
    def validate(cls, data):
        # HACK: Make this validatable for Cerberus. See comments in validation
        # side for more information.
        return super(Script, cls).validate({"__script__": data})

    def __repr__(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 41 Column: 5

                      return "Script({0!r})".format(self._parts)

    @property
    def command(self):
        return self._parts[0]

    @property
    def args(self):
        return self._parts[1:]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                      return self._parts[0]

    @property
    def args(self):
        return self._parts[1:]

    def cmdify(self, extra_args=None):
        """Encode into a cmd-executable string.


            

Reported by Pylint.

pipenv/vendor/shellingham/posix/proc.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              import re
import sys

from ._core import Process


STAT_PPID = 3
STAT_TTY = 6


            

Reported by Pylint.

XXX: Command line arguments can be arbitrary byte sequences, not
Error

Line: 43 Column: 3

                  path = os.path.join("/proc", str(pid), "cmdline")
    encoding = sys.getfilesystemencoding() or "utf-8"
    with io.open(path, encoding=encoding, errors="replace") as f:
        # XXX: Command line arguments can be arbitrary byte sequences, not
        # necessarily decodable. For Shellingham's purpose, however, we don't
        # care. (pypa/pipenv#2820)
        # cmdline appends an extra NULL at the end, hence the [:-1].
        return tuple(f.read().split("\0")[:-1])


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import io
import os
import re
import sys

from ._core import Process


STAT_PPID = 3

            

Reported by Pylint.

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

Line: 33 Column: 63

              
def _get_stat(pid, name):
    path = os.path.join("/proc", str(pid), name)
    with io.open(path, encoding="ascii", errors="replace") as f:
        # We only care about TTY and PPID -- all numbers.
        parts = STAT_PATTERN.findall(f.read())
        return parts[STAT_TTY], parts[STAT_PPID]



            

Reported by Pylint.

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

Line: 42 Column: 64

              def _get_cmdline(pid):
    path = os.path.join("/proc", str(pid), "cmdline")
    encoding = sys.getfilesystemencoding() or "utf-8"
    with io.open(path, encoding=encoding, errors="replace") as f:
        # XXX: Command line arguments can be arbitrary byte sequences, not
        # necessarily decodable. For Shellingham's purpose, however, we don't
        # care. (pypa/pipenv#2820)
        # cmdline appends an extra NULL at the end, hence the [:-1].
        return tuple(f.read().split("\0")[:-1])

            

Reported by Pylint.

Missing class docstring
Error

Line: 50 Column: 1

                      return tuple(f.read().split("\0")[:-1])


class ProcFormatError(EnvironmentError):
    pass


def get_process_mapping():
    """Try to look up the process tree via the /proc interface."""

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/requests/help.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from pipenv.patched.notpip._vendor import urllib3
from pipenv.patched.notpip._vendor import chardet

from . import __version__ as requests_version

try:
    from pipenv.patched.notpip._vendor.urllib3.contrib import pyopenssl
except ImportError:
    pyopenssl = None

            

Reported by Pylint.

Module 'sys' has no 'pypy_version_info' member
Error

Line: 42 Column: 48

                  if implementation == 'CPython':
        implementation_version = platform.python_version()
    elif implementation == 'PyPy':
        implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major,
                                               sys.pypy_version_info.minor,
                                               sys.pypy_version_info.micro)
        if sys.pypy_version_info.releaselevel != 'final':
            implementation_version = ''.join([
                implementation_version, sys.pypy_version_info.releaselevel

            

Reported by Pylint.

Module 'sys' has no 'pypy_version_info' member
Error

Line: 43 Column: 48

                      implementation_version = platform.python_version()
    elif implementation == 'PyPy':
        implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major,
                                               sys.pypy_version_info.minor,
                                               sys.pypy_version_info.micro)
        if sys.pypy_version_info.releaselevel != 'final':
            implementation_version = ''.join([
                implementation_version, sys.pypy_version_info.releaselevel
            ])

            

Reported by Pylint.

Module 'sys' has no 'pypy_version_info' member
Error

Line: 44 Column: 48

                  elif implementation == 'PyPy':
        implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major,
                                               sys.pypy_version_info.minor,
                                               sys.pypy_version_info.micro)
        if sys.pypy_version_info.releaselevel != 'final':
            implementation_version = ''.join([
                implementation_version, sys.pypy_version_info.releaselevel
            ])
    elif implementation == 'Jython':

            

Reported by Pylint.

Module 'sys' has no 'pypy_version_info' member
Error

Line: 45 Column: 12

                      implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major,
                                               sys.pypy_version_info.minor,
                                               sys.pypy_version_info.micro)
        if sys.pypy_version_info.releaselevel != 'final':
            implementation_version = ''.join([
                implementation_version, sys.pypy_version_info.releaselevel
            ])
    elif implementation == 'Jython':
        implementation_version = platform.python_version()  # Complete Guess

            

Reported by Pylint.

Module 'sys' has no 'pypy_version_info' member
Error

Line: 47 Column: 41

                                                             sys.pypy_version_info.micro)
        if sys.pypy_version_info.releaselevel != 'final':
            implementation_version = ''.join([
                implementation_version, sys.pypy_version_info.releaselevel
            ])
    elif implementation == 'Jython':
        implementation_version = platform.python_version()  # Complete Guess
    elif implementation == 'IronPython':
        implementation_version = platform.python_version()  # Complete Guess

            

Reported by Pylint.

pipenv/vendor/plette/models/packages.py
6 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              import six

from .base import DataView


class Package(DataView):
    """A package requirement specified in a Pipfile.

    This is the base class of variants appearing in either `[packages]` or

            

Reported by Pylint.

Access to member '_data' before its definition line 43
Error

Line: 42 Column: 46

                  def __setattr__(self, key, value):
        if key == "_data":
            super(Package, self).__setattr__(key, value)
        elif key == "version" and isinstance(self._data, six.string_types):
            self._data = value
        else:
            self._data[key] = value

            

Reported by Pylint.

Attribute '_data' defined outside __init__
Error

Line: 43 Column: 13

                      if key == "_data":
            super(Package, self).__setattr__(key, value)
        elif key == "version" and isinstance(self._data, six.string_types):
            self._data = value
        else:
            self._data[key] = value

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import six

from .base import DataView


class Package(DataView):
    """A package requirement specified in a Pipfile.

    This is the base class of variants appearing in either `[packages]` or

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 23 Column: 5

                  }

    @classmethod
    def validate(cls, data):
        # HACK: Make this validatable for Cerberus. See comments in validation
        # side for more information.
        return super(Package, cls).validate({"__package__": data})

    def __getattr__(self, key):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 41 Column: 13

              
    def __setattr__(self, key, value):
        if key == "_data":
            super(Package, self).__setattr__(key, value)
        elif key == "version" and isinstance(self._data, six.string_types):
            self._data = value
        else:
            self._data[key] = value

            

Reported by Pylint.

pipenv/patched/notpip/_internal/network/xmlrpc.py
6 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves'
Error

Line: 12 Column: 1

              from pipenv.patched.notpip._vendor import requests
# NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
#       why we ignore the type on this import
from pipenv.patched.notpip._vendor.six.moves import xmlrpc_client  # type: ignore
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse

logger = logging.getLogger(__name__)



            

Reported by Pylint.

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

Line: 13 Column: 1

              # NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
#       why we ignore the type on this import
from pipenv.patched.notpip._vendor.six.moves import xmlrpc_client  # type: ignore
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse

logger = logging.getLogger(__name__)


class PipXmlrpcTransport(xmlrpc_client.Transport):

            

Reported by Pylint.

No name 'urllib' in module '_MovedItems'
Error

Line: 13 Column: 1

              # NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
#       why we ignore the type on this import
from pipenv.patched.notpip._vendor.six.moves import xmlrpc_client  # type: ignore
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse

logger = logging.getLogger(__name__)


class PipXmlrpcTransport(xmlrpc_client.Transport):

            

Reported by Pylint.

Attribute 'verbose' defined outside __init__
Error

Line: 37 Column: 13

                          response = self._session.post(url, data=request_body,
                                          headers=headers, stream=True)
            response.raise_for_status()
            self.verbose = verbose
            return self.parse_response(response.raw)
        except requests.HTTPError as exc:
            logger.critical(
                "HTTP error %s while getting %s",
                exc.response.status_code, url,

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 18 Column: 1

              logger = logging.getLogger(__name__)


class PipXmlrpcTransport(xmlrpc_client.Transport):
    """Provide a `xmlrpclib.Transport` implementation via a `PipSession`
    object.
    """

    def __init__(self, index_url, session, use_datetime=False):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 29 Column: 5

                      self._scheme = index_parts.scheme
        self._session = session

    def request(self, host, handler, request_body, verbose=False):
        parts = (self._scheme, host, handler, None, None, None)
        url = urllib_parse.urlunparse(parts)
        try:
            headers = {'Content-Type': 'text/xml'}
            response = self._session.post(url, data=request_body,

            

Reported by Pylint.

pipenv/vendor/importlib_metadata/_collections.py
6 issues
self.default_factory is not callable
Error

Line: 24 Column: 36

                      return getattr(self, '_frozen', super().__missing__)(key)

    def freeze(self):
        self._frozen = lambda key: self.default_factory()


class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod
    def parse(cls, text):

            

Reported by Pylint.

Attribute '_frozen' defined outside __init__
Error

Line: 24 Column: 9

                      return getattr(self, '_frozen', super().__missing__)(key)

    def freeze(self):
        self._frozen = lambda key: self.default_factory()


class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod
    def parse(cls, text):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import collections


# from jaraco.collections 3.3
class FreezableDefaultDict(collections.defaultdict):
    """
    Often it is desirable to prevent the mutation of
    a default dict after its initial construction, such
    as to prevent mutation during iteration.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 23 Column: 5

                  def __missing__(self, key):
        return getattr(self, '_frozen', super().__missing__)(key)

    def freeze(self):
        self._frozen = lambda key: self.default_factory()


class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod

            

Reported by Pylint.

Missing class docstring
Error

Line: 27 Column: 1

                      self._frozen = lambda key: self.default_factory()


class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod
    def parse(cls, text):
        return cls(*map(str.strip, text.split("=", 1)))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 29 Column: 5

              
class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod
    def parse(cls, text):
        return cls(*map(str.strip, text.split("=", 1)))

            

Reported by Pylint.