The following issues were found

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

Line: 32 Column: 1

              import logging
import re

from .enums import ProbingState


class CharSetProber(object):

    SHORTCUT_THRESHOLD = 0.95

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              from .enums import ProbingState


class CharSetProber(object):

    SHORTCUT_THRESHOLD = 0.95

    def __init__(self, lang_filter=None):
        self._state = None

            

Reported by Pylint.

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

Line: 35 Column: 1

              from .enums import ProbingState


class CharSetProber(object):

    SHORTCUT_THRESHOLD = 0.95

    def __init__(self, lang_filter=None):
        self._state = None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 44 Column: 5

                      self.lang_filter = lang_filter
        self.logger = logging.getLogger(__name__)

    def reset(self):
        self._state = ProbingState.DETECTING

    @property
    def charset_name(self):
        return None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                      self._state = ProbingState.DETECTING

    @property
    def charset_name(self):
        return None

    def feed(self, buf):
        pass


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 5

                  def charset_name(self):
        return None

    def feed(self, buf):
        pass

    @property
    def state(self):
        return self._state

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 55 Column: 5

                      pass

    @property
    def state(self):
        return self._state

    def get_confidence(self):
        return 0.0


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 58 Column: 5

                  def state(self):
        return self._state

    def get_confidence(self):
        return 0.0

    @staticmethod
    def filter_high_byte_only(buf):
        buf = re.sub(b'([\x00-\x7F])+', b' ', buf)

            

Reported by Pylint.

Method could be a function
Error

Line: 58 Column: 5

                  def state(self):
        return self._state

    def get_confidence(self):
        return 0.0

    @staticmethod
    def filter_high_byte_only(buf):
        buf = re.sub(b'([\x00-\x7F])+', b' ', buf)

            

Reported by Pylint.

pipenv/patched/notpip/_internal/utils/setuptools_build.py
11 issues
Missing module docstring
Error

Line: 1 Column: 1

              import os
import sys

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

if MYPY_CHECK_RUNNING:
    from typing import List, Optional, Sequence

# Shim to wrap setup.py invocation with setuptools

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 52 Column: 1

                  return args


def make_setuptools_bdist_wheel_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
    build_options,  # type: Sequence[str]
    destination_dir,  # type: str
):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 73 Column: 1

                  return args


def make_setuptools_clean_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
):
    # type: (...) -> List[str]
    args = make_setuptools_shim_args(

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 87 Column: 1

                  return args


def make_setuptools_develop_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
    install_options,  # type: Sequence[str]
    no_user_config,  # type: bool
    prefix,  # type: Optional[str]

            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 87 Column: 1

                  return args


def make_setuptools_develop_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
    install_options,  # type: Sequence[str]
    no_user_config,  # type: bool
    prefix,  # type: Optional[str]

            

Reported by Pylint.

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

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

                  use_user_site,  # type: bool
):
    # type: (...) -> List[str]
    assert not (use_user_site and prefix)

    args = make_setuptools_shim_args(
        setup_py_path,
        global_options=global_options,
        no_user_config=no_user_config,

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 120 Column: 1

                  return args


def make_setuptools_egg_info_args(
    setup_py_path,  # type: str
    egg_info_dir,  # type: Optional[str]
    no_user_config,  # type: bool
):
    # type: (...) -> List[str]

            

Reported by Pylint.

Too many arguments (11/5)
Error

Line: 138 Column: 1

                  return args


def make_setuptools_install_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
    install_options,  # type: Sequence[str]
    record_filename,  # type: str
    root,  # type: Optional[str]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 138 Column: 1

                  return args


def make_setuptools_install_args(
    setup_py_path,  # type: str
    global_options,  # type: Sequence[str]
    install_options,  # type: Sequence[str]
    record_filename,  # type: str
    root,  # type: Optional[str]

            

Reported by Pylint.

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

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

                  pycompile  # type: bool
):
    # type: (...) -> List[str]
    assert not (use_user_site and prefix)
    assert not (use_user_site and root)

    args = make_setuptools_shim_args(
        setup_py_path,
        global_options=global_options,

            

Reported by Bandit.

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

Line: 3 Column: 1

              import typing as t

from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              import typing as t

from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace

if t.TYPE_CHECKING:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace

if t.TYPE_CHECKING:
    import typing_extensions as te

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace

if t.TYPE_CHECKING:
    import typing_extensions as te


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace

if t.TYPE_CHECKING:
    import typing_extensions as te

# defaults for the parser / lexer

            

Reported by Pylint.

Unable to import 'typing_extensions'
Error

Line: 11 Column: 5

              from .utils import Namespace

if t.TYPE_CHECKING:
    import typing_extensions as te

# defaults for the parser / lexer
BLOCK_START_STRING = "{%"
BLOCK_END_STRING = "%}"
VARIABLE_START_STRING = "{{"

            

Reported by Pylint.

Unused FILTERS imported from filters as DEFAULT_FILTERS
Error

Line: 3 Column: 1

              import typing as t

from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace


            

Reported by Pylint.

Unused TESTS imported from tests as DEFAULT_TESTS
Error

Line: 4 Column: 1

              import typing as t

from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
from .tests import TESTS as DEFAULT_TESTS  # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace


            

Reported by Pylint.

Unused typing_extensions imported as te
Error

Line: 11 Column: 5

              from .utils import Namespace

if t.TYPE_CHECKING:
    import typing_extensions as te

# defaults for the parser / lexer
BLOCK_START_STRING = "{%"
BLOCK_END_STRING = "%}"
VARIABLE_START_STRING = "{{"

            

Reported by Pylint.

pipenv/vendor/urllib3/__init__.py
11 issues
Unable to import '__init__._version'
Error

Line: 12 Column: 1

              from logging import NullHandler

from . import exceptions
from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers

            

Reported by Pylint.

Unable to import '__init__.connectionpool'
Error

Line: 13 Column: 1

              
from . import exceptions
from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry

            

Reported by Pylint.

Unable to import '__init__.filepost'
Error

Line: 14 Column: 1

              from . import exceptions
from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout

            

Reported by Pylint.

Unable to import '__init__.poolmanager'
Error

Line: 15 Column: 1

              from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host

            

Reported by Pylint.

Unable to import '__init__.response'
Error

Line: 16 Column: 1

              from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host


            

Reported by Pylint.

Unable to import '__init__.util.request'
Error

Line: 17 Column: 1

              from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host

__author__ = "Andrey Petrov (andrey.petrov@shazow.net)"

            

Reported by Pylint.

Unable to import '__init__.util.retry'
Error

Line: 18 Column: 1

              from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host

__author__ = "Andrey Petrov (andrey.petrov@shazow.net)"
__license__ = "MIT"

            

Reported by Pylint.

Unable to import '__init__.util.timeout'
Error

Line: 19 Column: 1

              from .response import HTTPResponse
from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host

__author__ = "Andrey Petrov (andrey.petrov@shazow.net)"
__license__ = "MIT"
__version__ = __version__

            

Reported by Pylint.

Unable to import '__init__.util.url'
Error

Line: 20 Column: 1

              from .util.request import make_headers
from .util.retry import Retry
from .util.timeout import Timeout
from .util.url import get_host

__author__ = "Andrey Petrov (andrey.petrov@shazow.net)"
__license__ = "MIT"
__version__ = __version__


            

Reported by Pylint.

Module import itself
Error

Line: 11 Column: 1

              import warnings
from logging import NullHandler

from . import exceptions
from ._version import __version__
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import HTTPResponse

            

Reported by Pylint.

pipenv/vendor/dateutil/parser/isoparser.py
11 issues
standard import "from functools import wraps" should be placed before "from dateutil import tz"
Error

Line: 14 Column: 1

              import calendar
from dateutil import tz

from functools import wraps

import re
import six

__all__ = ["isoparse", "isoparser"]

            

Reported by Pylint.

standard import "import re" should be placed before "from dateutil import tz"
Error

Line: 16 Column: 1

              
from functools import wraps

import re
import six

__all__ = ["isoparse", "isoparser"]



            

Reported by Pylint.

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

Line: 22 Column: 1

              __all__ = ["isoparse", "isoparser"]


def _takes_ascii(f):
    @wraps(f)
    def func(self, str_in, *args, **kwargs):
        # If it's a stream, read the whole thing
        str_in = getattr(str_in, 'read', lambda: str_in)()


            

Reported by Pylint.

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

Line: 33 Column: 13

                          # ASCII is the same in UTF-8
            try:
                str_in = str_in.encode('ascii')
            except UnicodeEncodeError as e:
                msg = 'ISO-8601 strings should contain only ASCII characters'
                six.raise_from(ValueError(msg), e)

        return f(self, str_in, *args, **kwargs)


            

Reported by Pylint.

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

Line: 42 Column: 1

                  return func


class isoparser(object):
    def __init__(self, sep=None):
        """
        :param sep:
            A single character that separates date and time portions. If
            ``None``, the parser will accept any single character.

            

Reported by Pylint.

Missing class docstring
Error

Line: 42 Column: 1

                  return func


class isoparser(object):
    def __init__(self, sep=None):
        """
        :param sep:
            A single character that separates date and time portions. If
            ``None``, the parser will accept any single character.

            

Reported by Pylint.

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

Line: 42 Column: 1

                  return func


class isoparser(object):
    def __init__(self, sep=None):
        """
        :param sep:
            A single character that separates date and time portions. If
            ``None``, the parser will accept any single character.

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 237 Column: 13

                      pos += 2

        if pos >= len_str:
            if has_sep:
                return components, pos
            else:
                raise ValueError('Invalid ISO format')

        if has_sep:

            

Reported by Pylint.

Method could be a function
Error

Line: 297 Column: 5

                      components = [base_date.year, base_date.month, base_date.day]
        return components, pos

    def _calculate_weekdate(self, year, week, day):
        """
        Calculate the day of corresponding to the ISO year-week-day calendar.

        This function is effectively the inverse of
        :func:`datetime.date.isocalendar`.

            

Reported by Pylint.

Consider merging these comparisons with "in" to "tzstr in (b'Z', b'z')"
Error

Line: 384 Column: 12

                      return components

    def _parse_tzstr(self, tzstr, zero_as_utc=True):
        if tzstr == b'Z' or tzstr == b'z':
            return tz.UTC

        if len(tzstr) not in {3, 5, 6}:
            raise ValueError('Time zone offset must be 1, 3, 5 or 6 characters')


            

Reported by Pylint.

pipenv/vendor/pep517/build.py
11 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import os
import shutil

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError, toml_load

log = logging.getLogger(__name__)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import shutil

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError, toml_load

log = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError, toml_load

log = logging.getLogger(__name__)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError, toml_load

log = logging.getLogger(__name__)


def validate_system(system):

            

Reported by Pylint.

Redefining built-in 'FileNotFoundError'
Error

Line: 12 Column: 1

              from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError, toml_load

log = logging.getLogger(__name__)


def validate_system(system):

            

Reported by Pylint.

Redefining name 'build' from outer scope (line 76)
Error

Line: 70 Column: 9

                  with tempdir() as td:
        log.info('Trying to build %s in %s', dist, td)
        build_name = 'build_{dist}'.format(**locals())
        build = getattr(hooks, build_name)
        filename = build(td, {})
        source = os.path.join(td, filename)
        shutil.move(source, os.path.join(dest, os.path.basename(filename)))



            

Reported by Pylint.

Unnecessary parens after 'not' keyword
Error

Line: 22 Column: 1

                  Ensure build system has the requisite fields.
    """
    required = {'requires', 'build-backend'}
    if not (required <= set(system)):
        message = "Missing required fields: {missing}".format(
            missing=required-set(system),
        )
        raise ValueError(message)


            

Reported by Pylint.

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

Line: 34 Column: 50

                  Load the build system from a source dir (pyproject.toml).
    """
    pyproject = os.path.join(source_dir, 'pyproject.toml')
    with io.open(pyproject, encoding="utf-8") as f:
        pyproject_data = toml_load(f)
    return pyproject_data['build-system']


def compat_system(source_dir):

            

Reported by Pylint.

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

Line: 67 Column: 23

                  env.pip_install(reqs)
    log.info('Installed dynamic build dependencies')

    with tempdir() as td:
        log.info('Trying to build %s in %s', dist, td)
        build_name = 'build_{dist}'.format(**locals())
        build = getattr(hooks, build_name)
        filename = build(td, {})
        source = os.path.join(td, filename)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 76 Column: 1

                      shutil.move(source, os.path.join(dest, os.path.basename(filename)))


def build(source_dir, dist, dest=None, system=None):
    system = system or load_system(source_dir)
    dest = os.path.join(source_dir, dest or 'dist')
    mkdir_p(dest)

    validate_system(system)

            

Reported by Pylint.

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

Line: 21 Column: 1

              
from collections import OrderedDict

from .exceptions import InvalidHeader
from .packages import six
from .packages.six import iterkeys, itervalues

__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 22 Column: 1

              from collections import OrderedDict

from .exceptions import InvalidHeader
from .packages import six
from .packages.six import iterkeys, itervalues

__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

              
from .exceptions import InvalidHeader
from .packages import six
from .packages.six import iterkeys, itervalues

__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]


_Null = object()

            

Reported by Pylint.

Access to a protected member _copy_from of a client class
Error

Line: 292 Column: 9

              
    def copy(self):
        clone = type(self)()
        clone._copy_from(self)
        return clone

    def iteritems(self):
        """Iterate over all header lines, including duplicate ones."""
        for key in self:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

try:
    from collections.abc import Mapping, MutableMapping
except ImportError:
    from collections import Mapping, MutableMapping
try:
    from threading import RLock
except ImportError:  # Platform-specific: No threads available

            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 5

                  from threading import RLock
except ImportError:  # Platform-specific: No threads available

    class RLock:
        def __enter__(self):
            pass

        def __exit__(self, exc_type, exc_value, traceback):
            pass

            

Reported by Pylint.

Imports from package collections are not grouped
Error

Line: 19 Column: 1

                          pass


from collections import OrderedDict

from .exceptions import InvalidHeader
from .packages import six
from .packages.six import iterkeys, itervalues


            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 142 Column: 9

                  """

    def __init__(self, headers=None, **kwargs):
        super(HTTPHeaderDict, self).__init__()
        self._container = OrderedDict()
        if headers is not None:
            if isinstance(headers, HTTPHeaderDict):
                self._copy_from(headers)
            else:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 209 Column: 5

                          del self[key]
            return value

    def discard(self, key):
        try:
            del self[key]
        except KeyError:
            pass


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 290 Column: 5

                              val = list(val)
            self._container[key.lower()] = [key] + val

    def copy(self):
        clone = type(self)()
        clone._copy_from(self)
        return clone

    def iteritems(self):

            

Reported by Pylint.

pipenv/vendor/dateutil/easter.py
11 issues
Unnecessary parens after 'not' keyword
Error

Line: 52 Column: 1

              
    """

    if not (1 <= method <= 3):
        raise ValueError("invalid method")

    # g - Golden year - 1
    # c - Century
    # h - (23 - Epact) mod 30

            

Reported by Pylint.

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

Line: 65 Column: 5

                  # e - Extra days to add for method 2 (converting Julian
    #     date to Gregorian date)

    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30

            

Reported by Pylint.

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

Line: 66 Column: 5

                  #     date to Gregorian date)

    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30
        j = (y + y//4 + i) % 7

            

Reported by Pylint.

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

Line: 67 Column: 5

              
    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30
        j = (y + y//4 + i) % 7
        if method == 2:

            

Reported by Pylint.

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

Line: 74 Column: 13

                      j = (y + y//4 + i) % 7
        if method == 2:
            # Extra dates to convert Julian to Gregorian date
            e = 10
            if y > 1600:
                e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100

            

Reported by Pylint.

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

Line: 76 Column: 17

                          # Extra dates to convert Julian to Gregorian date
            e = 10
            if y > 1600:
                e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))

            

Reported by Pylint.

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

Line: 79 Column: 9

                              e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
        j = (y + y//4 + i + 2 - c + c//4) % 7

    # p can be from -6 to 56 corresponding to dates 22 March to 23 May

            

Reported by Pylint.

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

Line: 80 Column: 9

                  else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
        j = (y + y//4 + i + 2 - c + c//4) % 7

    # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)

            

Reported by Pylint.

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

Line: 86 Column: 5

              
    # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)
    p = i - j + e
    d = 1 + (p + 27 + (p + 6)//40) % 31
    m = 3 + (p + 26)//30
    return datetime.date(int(y), int(m), int(d))

            

Reported by Pylint.

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

Line: 87 Column: 5

                  # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)
    p = i - j + e
    d = 1 + (p + 27 + (p + 6)//40) % 31
    m = 3 + (p + 26)//30
    return datetime.date(int(y), int(m), int(d))

            

Reported by Pylint.

pipenv/vendor/pythonfinder/compat.py
11 issues
Unable to import 'pathlib2'
Error

Line: 7 Column: 5

              import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

if six.PY3:
    from functools import lru_cache

            

Reported by Pylint.

Unable to import 'backports.functools_lru_cache'
Error

Line: 15 Column: 5

                  from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass



            

Reported by Pylint.

Unused Path imported from pathlib2
Error

Line: 7 Column: 5

              import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

if six.PY3:
    from functools import lru_cache

            

Reported by Pylint.

Unused lru_cache imported from functools
Error

Line: 12 Column: 5

                  from pathlib import Path

if six.PY3:
    from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):

            

Reported by Pylint.

Unused TimeoutError imported from builtins
Error

Line: 13 Column: 5

              
if six.PY3:
    from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding=utf-8 -*-
import sys

import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

            

Reported by Pylint.

Missing class docstring
Error

Line: 17 Column: 5

              else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass


def getpreferredencoding():
    import locale

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 1

                      pass


def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":

            

Reported by Pylint.

Import outside toplevel (locale)
Error

Line: 22 Column: 5

              

def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":
        _default_encoding = locale.getdefaultlocale()[1]

            

Reported by Pylint.

Consider changing "not sys.platform == 'win32'" to "sys.platform != 'win32'"
Error

Line: 26 Column: 20

                  # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":
        _default_encoding = locale.getdefaultlocale()[1]
        if _default_encoding is not None:
            _encoding = _default_encoding
    return _encoding


            

Reported by Pylint.

pipenv/patched/notpip/_internal/self_outdated_check.py
11 issues
Unused import optparse
Error

Line: 35 Column: 5

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

if MYPY_CHECK_RUNNING:
    import optparse
    from optparse import Values
    from typing import Any, Dict, Text, Union

    from pipenv.patched.notpip._internal.network.session import PipSession


            

Reported by Pylint.

Uses of a deprecated module 'optparse'
Error

Line: 35 Column: 5

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

if MYPY_CHECK_RUNNING:
    import optparse
    from optparse import Values
    from typing import Any, Dict, Text, Union

    from pipenv.patched.notpip._internal.network.session import PipSession


            

Reported by Pylint.

Uses of a deprecated module 'optparse'
Error

Line: 36 Column: 5

              
if MYPY_CHECK_RUNNING:
    import optparse
    from optparse import Values
    from typing import Any, Dict, Text, Union

    from pipenv.patched.notpip._internal.network.session import PipSession



            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 238 Column: 12

                          "'%s install --upgrade pip' command.",
            pip_version, pypi_version, pip_cmd
        )
    except Exception:
        logger.debug(
            "There was an error checking the latest version of pip",
            exc_info=True,
        )

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

from __future__ import absolute_import

import datetime
import hashlib
import json
import logging

            

Reported by Pylint.

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

Line: 86 Column: 1

                  return name


class SelfCheckState(object):
    def __init__(self, cache_dir):
        # type: (str) -> None
        self.state = {}  # type: Dict[str, Any]
        self.statefile_path = None


            

Reported by Pylint.

Missing class docstring
Error

Line: 86 Column: 1

                  return name


class SelfCheckState(object):
    def __init__(self, cache_dir):
        # type: (str) -> None
        self.state = {}  # type: Dict[str, Any]
        self.statefile_path = None


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 106 Column: 5

                              pass

    @property
    def key(self):
        return sys.prefix

    def save(self, pypi_version, current_time):
        # type: (str, datetime.datetime) -> None
        # If we do not have a path to cache in, don't bother saving.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 109 Column: 5

                  def key(self):
        return sys.prefix

    def save(self, pypi_version, current_time):
        # type: (str, datetime.datetime) -> None
        # If we do not have a path to cache in, don't bother saving.
        if not self.statefile_path:
            return


            

Reported by Pylint.

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

Line: 133 Column: 56

              
        text = json.dumps(state, sort_keys=True, separators=(",", ":"))

        with adjacent_tmp_file(self.statefile_path) as f:
            f.write(ensure_binary(text))

        try:
            # Since we have a prefix-specific state file, we can just
            # overwrite whatever is there, no need to check.

            

Reported by Pylint.