The following issues were found

pipenv/vendor/dparse/parser.py
49 issues
Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from configparser import SafeConfigParser, NoOptionError


from .regex import URL_REGEX, HASH_REGEX

from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
from . import filetypes
import toml

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              
from .regex import URL_REGEX, HASH_REGEX

from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
from . import filetypes
import toml
from packaging.specifiers import SpecifierSet
import json

            

Reported by Pylint.

Unable to import 'packaging.requirements'
Error

Line: 15 Column: 1

              from .regex import URL_REGEX, HASH_REGEX

from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
from . import filetypes
import toml
from packaging.specifiers import SpecifierSet
import json


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              
from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
from . import filetypes
import toml
from packaging.specifiers import SpecifierSet
import json



            

Reported by Pylint.

Unable to import 'packaging.specifiers'
Error

Line: 18 Column: 1

              from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
from . import filetypes
import toml
from packaging.specifiers import SpecifierSet
import json


# this is a backport from setuptools 26.1
def setuptools_parse_requirements_backport(strs):  # pragma: no cover

            

Reported by Pylint.

Using deprecated method readfp()
Error

Line: 278 Column: 9

                      :return:
        """
        parser = SafeConfigParser()
        parser.readfp(StringIO(self.obj.content))
        for section in parser.sections():
            try:
                content = parser.get(section=section, option="deps")
                for n, line in enumerate(content.splitlines()):
                    if self.is_marked_line(line):

            

Reported by Pylint.

Unused variable 'n'
Error

Line: 282 Column: 21

                      for section in parser.sections():
            try:
                content = parser.get(section=section, option="deps")
                for n, line in enumerate(content.splitlines()):
                    if self.is_marked_line(line):
                        continue
                    if line:
                        req = RequirementsTXTLineParser.parse(line)
                        if req:

            

Reported by Pylint.

Unused variable 'n'
Error

Line: 309 Column: 29

                          if data and 'dependencies' in data and isinstance(data['dependencies'], list):
                for dep in data['dependencies']:
                    if isinstance(dep, dict) and 'pip' in dep:
                        for n, line in enumerate(dep['pip']):
                            if self.is_marked_line(line):
                                continue
                            req = RequirementsTXTLineParser.parse(line)
                            if req:
                                req.dependency_type = self.obj.file_type

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 346 Column: 9

                                                  section=package_type
                                )
                            )
        except (toml.TomlDecodeError, IndexError) as e:
            pass

class PipfileLockParser(Parser):

    def parse(self):

            

Reported by Pylint.

Using deprecated method readfp()
Error

Line: 383 Column: 9

              class SetupCfgParser(Parser):
    def parse(self):
        parser = SafeConfigParser()
        parser.readfp(StringIO(self.obj.content))
        for section in parser.values():
            if section.name == 'options':
                options = 'install_requires', 'setup_requires', 'test_require'
                for name in options:
                    content = section.get(name)

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/treewalkers/etree_lxml.py
49 issues
Unable to import 'lxml'
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type

from lxml import etree
from ..treebuilders.etree import tag_regexp

from . import base

from .. import _ihatexml

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              from pipenv.patched.notpip._vendor.six import text_type

from lxml import etree
from ..treebuilders.etree import tag_regexp

from . import base

from .. import _ihatexml


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from lxml import etree
from ..treebuilders.etree import tag_regexp

from . import base

from .. import _ihatexml


def ensure_str(s):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              
from . import base

from .. import _ihatexml


def ensure_str(s):
    if s is None:
        return None

            

Reported by Pylint.

Bad option value 'redefined-variable-type'
Error

Line: 127 Column: 1

              
class TreeWalker(base.NonRecursiveTreeWalker):
    def __init__(self, tree):
        # pylint:disable=redefined-variable-type
        if isinstance(tree, list):
            self.fragmentChildren = set(tree)
            tree = FragmentRoot(tree)
        else:
            self.fragmentChildren = set()

            

Reported by Pylint.

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

Line: 74 Column: 5

              

class FragmentRoot(Root):
    def __init__(self, children):
        self.children = [FragmentWrapper(self, child) for child in children]
        self.text = self.tail = None

    def getnext(self):
        return None

            

Reported by Pylint.

XXX: we cannot use a "bool(node) and node[0] or None" construct here
Error

Line: 192 Column: 3

                          node, key = node
            assert key in ("text", "tail"), "Text nodes are text or tail, found %s" % key
            if key == "text":
                # XXX: we cannot use a "bool(node) and node[0] or None" construct here
                # because node[0] might evaluate to False if it has no child element
                if len(node):
                    return node[0]
                else:
                    return None

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type

from lxml import etree
from ..treebuilders.etree import tag_regexp

from . import base

from .. import _ihatexml

            

Reported by Pylint.

Using etree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace etree with the equivalent defusedxml package.
Security blacklist

Line: 4
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b410-import-lxml

              from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type

from lxml import etree
from ..treebuilders.etree import tag_regexp

from . import base

from .. import _ihatexml

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 12 Column: 1

              from .. import _ihatexml


def ensure_str(s):
    if s is None:
        return None
    elif isinstance(s, text_type):
        return s
    else:

            

Reported by Pylint.

pipenv/vendor/tomlkit/api.py
49 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
from typing import Tuple

from ._utils import parse_rfc3339
from .container import Container
from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from typing import Tuple

from ._utils import parse_rfc3339
from .container import Container
from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment
from .items import Date

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              
from ._utils import parse_rfc3339
from .container import Container
from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from ._utils import parse_rfc3339
from .container import Container
from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from .container import Container
from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              from .items import AoT
from .items import Array
from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable
from .items import Integer

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from .items import Array
from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable
from .items import Integer
from .items import Item as _Item

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .items import Bool
from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable
from .items import Integer
from .items import Item as _Item
from .items import Key

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from .items import Comment
from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable
from .items import Integer
from .items import Item as _Item
from .items import Key
from .items import String

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from .items import Date
from .items import DateTime
from .items import Float
from .items import InlineTable
from .items import Integer
from .items import Item as _Item
from .items import Key
from .items import String
from .items import Table

            

Reported by Pylint.

pipenv/vendor/cerberus/tests/test_schema.py
49 issues
Unable to import 'pytest'
Error

Line: 5 Column: 1

              
import re

import pytest

from cerberus import Validator, errors, SchemaError
from cerberus.schema import UnvalidatedSchema
from cerberus.tests import assert_schema_error


            

Reported by Pylint.

Unable to import 'cerberus'
Error

Line: 7 Column: 1

              
import pytest

from cerberus import Validator, errors, SchemaError
from cerberus.schema import UnvalidatedSchema
from cerberus.tests import assert_schema_error


def test_empty_schema():

            

Reported by Pylint.

Unable to import 'cerberus.schema'
Error

Line: 8 Column: 1

              import pytest

from cerberus import Validator, errors, SchemaError
from cerberus.schema import UnvalidatedSchema
from cerberus.tests import assert_schema_error


def test_empty_schema():
    validator = Validator()

            

Reported by Pylint.

Unable to import 'cerberus.tests'
Error

Line: 9 Column: 1

              
from cerberus import Validator, errors, SchemaError
from cerberus.schema import UnvalidatedSchema
from cerberus.tests import assert_schema_error


def test_empty_schema():
    validator = Validator()
    with pytest.raises(SchemaError, match=errors.SCHEMA_ERROR_MISSING):

            

Reported by Pylint.

Access to a protected member _valid_schemas of a client class
Error

Line: 82 Column: 22

              
def test_validated_schema_cache():
    v = Validator({'foozifix': {'coerce': int}})
    cache_size = len(v._valid_schemas)

    v = Validator({'foozifix': {'type': 'integer'}})
    cache_size += 1
    assert len(v._valid_schemas) == cache_size


            

Reported by Pylint.

Access to a protected member _valid_schemas of a client class
Error

Line: 86 Column: 16

              
    v = Validator({'foozifix': {'type': 'integer'}})
    cache_size += 1
    assert len(v._valid_schemas) == cache_size

    v = Validator({'foozifix': {'coerce': int}})
    assert len(v._valid_schemas) == cache_size

    max_cache_size = 163

            

Reported by Pylint.

Access to a protected member _valid_schemas of a client class
Error

Line: 89 Column: 16

                  assert len(v._valid_schemas) == cache_size

    v = Validator({'foozifix': {'coerce': int}})
    assert len(v._valid_schemas) == cache_size

    max_cache_size = 163
    assert cache_size <= max_cache_size, (
        "There's an unexpected high amount (%s) of cached valid "
        "definition schemas. Unless you added further tests, "

            

Reported by Pylint.

TODO remove with next major release
Error

Line: 116 Column: 3

                  assert schema_copy == schema


# TODO remove with next major release
def test_deprecated_rule_names_in_valueschema():
    def check_with(field, value, error):
        pass

    schema = {

            

Reported by Pylint.

Unused argument 'field'
Error

Line: 118 Column: 20

              
# TODO remove with next major release
def test_deprecated_rule_names_in_valueschema():
    def check_with(field, value, error):
        pass

    schema = {
        "field_1": {
            "type": "dict",

            

Reported by Pylint.

Unused argument 'value'
Error

Line: 118 Column: 27

              
# TODO remove with next major release
def test_deprecated_rule_names_in_valueschema():
    def check_with(field, value, error):
        pass

    schema = {
        "field_1": {
            "type": "dict",

            

Reported by Pylint.

pipenv/vendor/funcsigs/__init__.py
49 issues
Unable to import 'funcsigs.version'
Error

Line: 18 Column: 1

              except ImportError:
    from ordereddict import OrderedDict

from funcsigs.version import __version__

__all__ = ['BoundArguments', 'Parameter', 'Signature', 'signature']


_WrapperDescriptor = type(type.__call__)

            

Reported by Pylint.

Instance of '_ParameterKind' has no '_name' member
Error

Line: 205 Column: 16

                      return obj

    def __str__(self):
        return self._name

    def __repr__(self):
        return '<_ParameterKind: {0!r}>'.format(self._name)



            

Reported by Pylint.

Instance of '_ParameterKind' has no '_name' member
Error

Line: 208 Column: 49

                      return self._name

    def __repr__(self):
        return '<_ParameterKind: {0!r}>'.format(self._name)


_POSITIONAL_ONLY        = _ParameterKind(0, name='POSITIONAL_ONLY')
_POSITIONAL_OR_KEYWORD  = _ParameterKind(1, name='POSITIONAL_OR_KEYWORD')
_VAR_POSITIONAL         = _ParameterKind(2, name='VAR_POSITIONAL')

            

Reported by Pylint.

Method has no argument
Error

Line: 787 Column: 5

              
        return self._bound_arguments_cls(self, arguments)

    def bind(*args, **kwargs):
        '''Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        '''
        return args[0]._bind(args[1:], kwargs)

            

Reported by Pylint.

Unused variable 'ex'
Error

Line: 116 Column: 9

                      partial_keywords = obj.keywords or {}
        try:
            ba = sig.bind_partial(*partial_args, **partial_keywords)
        except TypeError as ex:
            msg = 'partial object {0!r} has incorrect arguments'.format(obj)
            raise ValueError(msg)

        for arg_name, arg_value in ba.arguments.items():
            param = new_params[arg_name]

            

Reported by Pylint.

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

Line: 118 Column: 13

                          ba = sig.bind_partial(*partial_args, **partial_keywords)
        except TypeError as ex:
            msg = 'partial object {0!r} has incorrect arguments'.format(obj)
            raise ValueError(msg)

        for arg_name, arg_value in ba.arguments.items():
            param = new_params[arg_name]
            if arg_name in partial_keywords:
                # We set a new default value, because the following code

            

Reported by Pylint.

Access to a protected member _partial_kwarg of a client class
Error

Line: 144 Column: 33

                                                                   _partial_kwarg=True)

            elif (param.kind not in (_VAR_KEYWORD, _VAR_POSITIONAL) and
                            not param._partial_kwarg):
                new_params.pop(arg_name)

        return sig.replace(parameters=new_params.values())

    sig = None

            

Reported by Pylint.

Redefining name 'signature' from outer scope (line 55)
Error

Line: 375 Column: 24

                      Dict of keyword arguments values.
    '''

    def __init__(self, signature, arguments):
        self.arguments = arguments
        self._signature = signature

    @property
    def signature(self):

            

Reported by Pylint.

Access to a protected member _partial_kwarg of a client class
Error

Line: 388 Column: 53

                      args = []
        for param_name, param in self._signature.parameters.items():
            if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
                                                    param._partial_kwarg):
                # Keyword arguments mapped by 'functools.partial'
                # (Parameter._partial_kwarg is True) are mapped
                # in 'BoundArguments.kwargs', along with VAR_KEYWORD &
                # KEYWORD_ONLY
                break

            

Reported by Pylint.

Access to a protected member _partial_kwarg of a client class
Error

Line: 418 Column: 49

                      for param_name, param in self._signature.parameters.items():
            if not kwargs_started:
                if (param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY) or
                                                param._partial_kwarg):
                    kwargs_started = True
                else:
                    if param_name not in self.arguments:
                        kwargs_started = True
                        continue

            

Reported by Pylint.

tests/integration/test_pipenv.py
48 issues
Unable to import 'pytest'
Error

Line: 8 Column: 1

              
import os

import pytest

from pipenv.project import Project
from pipenv.utils import subprocess_run, temp_environ



            

Reported by Pylint.

Unused argument 'raw_venv'
Error

Line: 91 Column: 38

              

@pytest.mark.cli
def test_directory_with_leading_dash(raw_venv, PipenvInstance):
    with temp_environ():
        with PipenvInstance(chdir=True, venv_in_project=False, name="-project-with-dash") as p:
            if "PIPENV_VENV_IN_PROJECT" in os.environ:
                del os.environ['PIPENV_VENV_IN_PROJECT']
            c = p.pipenv('run pip freeze')

            

Reported by Pylint.

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

Line: 17 Column: 1

              @pytest.mark.code
@pytest.mark.install
@pytest.mark.skip(reason='non deterministic')
def test_code_import_manual(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with open('t.py', 'w') as f:
            f.write('import requests')
        p.pipenv('install -c .')
        assert 'requests' in p.pipfile['packages']

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 1

              @pytest.mark.code
@pytest.mark.install
@pytest.mark.skip(reason='non deterministic')
def test_code_import_manual(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with open('t.py', 'w') as f:
            f.write('import requests')
        p.pipenv('install -c .')
        assert 'requests' in p.pipfile['packages']

            

Reported by Pylint.

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

Line: 18 Column: 40

              @pytest.mark.install
@pytest.mark.skip(reason='non deterministic')
def test_code_import_manual(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with open('t.py', 'w') as f:
            f.write('import requests')
        p.pipenv('install -c .')
        assert 'requests' in p.pipfile['packages']


            

Reported by Pylint.

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

Line: 19 Column: 35

              @pytest.mark.skip(reason='non deterministic')
def test_code_import_manual(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with open('t.py', 'w') as f:
            f.write('import requests')
        p.pipenv('install -c .')
        assert 'requests' in p.pipfile['packages']



            

Reported by Pylint.

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

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

                      with open('t.py', 'w') as f:
            f.write('import requests')
        p.pipenv('install -c .')
        assert 'requests' in p.pipfile['packages']


@pytest.mark.lock
@pytest.mark.deploy
def test_deploy_works(PipenvInstance):

            

Reported by Bandit.

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

Line: 27 Column: 1

              
@pytest.mark.lock
@pytest.mark.deploy
def test_deploy_works(PipenvInstance):

    with PipenvInstance(chdir=True) as p:
        with open(p.pipfile_path, 'w') as f:
            contents = """
[packages]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 27 Column: 1

              
@pytest.mark.lock
@pytest.mark.deploy
def test_deploy_works(PipenvInstance):

    with PipenvInstance(chdir=True) as p:
        with open(p.pipfile_path, 'w') as f:
            contents = """
[packages]

            

Reported by Pylint.

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

Line: 29 Column: 40

              @pytest.mark.deploy
def test_deploy_works(PipenvInstance):

    with PipenvInstance(chdir=True) as p:
        with open(p.pipfile_path, 'w') as f:
            contents = """
[packages]
requests = "==2.19.1"
flask = "==1.1.2"

            

Reported by Pylint.

pipenv/vendor/importlib_resources/tests/util.py
48 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              import types
from pathlib import Path, PurePath

from . import data01
from . import zipdata01
from ..abc import ResourceReader
from ._compat import import_helper



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from pathlib import Path, PurePath

from . import data01
from . import zipdata01
from ..abc import ResourceReader
from ._compat import import_helper


from importlib.machinery import ModuleSpec

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from . import data01
from . import zipdata01
from ..abc import ResourceReader
from ._compat import import_helper


from importlib.machinery import ModuleSpec


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from . import data01
from . import zipdata01
from ..abc import ResourceReader
from ._compat import import_helper


from importlib.machinery import ModuleSpec



            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertRaises' member
Error

Line: 104 Column: 14

                      # An absolute path is a ValueError.
        path = Path(__file__)
        full_path = path.parent / 'utf-8.file'
        with self.assertRaises(ValueError):
            self.execute(data01, full_path)

    def test_relative_path(self):
        # A reative path is a ValueError.
        with self.assertRaises(ValueError):

            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertRaises' member
Error

Line: 109 Column: 14

              
    def test_relative_path(self):
        # A reative path is a ValueError.
        with self.assertRaises(ValueError):
            self.execute(data01, '../data01/utf-8.file')

    def test_importing_module_as_side_effect(self):
        # The anchor package can already be imported.
        del sys.modules[data01.__name__]

            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertRaises' member
Error

Line: 119 Column: 14

              
    def test_non_package_by_name(self):
        # The anchor package cannot be a module.
        with self.assertRaises(TypeError):
            self.execute(__name__, 'utf-8.file')

    def test_non_package_by_package(self):
        # The anchor package cannot be a module.
        with self.assertRaises(TypeError):

            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertRaises' member
Error

Line: 124 Column: 14

              
    def test_non_package_by_package(self):
        # The anchor package cannot be a module.
        with self.assertRaises(TypeError):
            module = sys.modules['importlib_resources.tests.util']
            self.execute(module, 'utf-8.file')

    def test_missing_path(self):
        # Attempting to open or read or request the path for a

            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertEqual' member
Error

Line: 135 Column: 9

                      bytes_data = io.BytesIO(b'Hello, world!')
        package = create_package(file=bytes_data, path=FileNotFoundError())
        self.execute(package, 'utf-8.file')
        self.assertEqual(package.__loader__._path, 'utf-8.file')

    def test_extant_path(self):
        # Attempting to open or read or request the path when the
        # path does exist should still succeed. Does not assert
        # anything about the result.

            

Reported by Pylint.

Instance of 'CommonTests' has no 'assertEqual' member
Error

Line: 146 Column: 9

                      path = __file__
        package = create_package(file=bytes_data, path=path)
        self.execute(package, 'utf-8.file')
        self.assertEqual(package.__loader__._path, 'utf-8.file')

    def test_useless_loader(self):
        package = create_package(file=FileNotFoundError(), path=FileNotFoundError())
        with self.assertRaises(FileNotFoundError):
            self.execute(package, 'utf-8.file')

            

Reported by Pylint.

pipenv/vendor/tomli/_parser.py
48 issues
Unable to import 'tomli._re'
Error

Line: 15 Column: 1

                  Tuple,
)

from tomli._re import (
    RE_DATETIME,
    RE_LOCALTIME,
    RE_NUMBER,
    match_to_datetime,
    match_to_localtime,

            

Reported by Pylint.

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

Line: 259 Column: 13

                  except ValueError:
        new_pos = len(src)
        if error_on_eof:
            raise suffixed_err(src, new_pos, f'Expected "{expect!r}"')

    if not error_on.isdisjoint(src[pos:new_pos]):
        while src[pos] not in error_on:
            pos += 1
        raise suffixed_err(src, pos, f'Found invalid character "{src[pos]!r}"')

            

Reported by Pylint.

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

Line: 300 Column: 9

                  try:
        out.data.get_or_create_nest(key)
    except KeyError:
        raise suffixed_err(src, pos, "Can not overwrite a value")

    if not src.startswith("]", pos):
        raise suffixed_err(src, pos, 'Expected "]" at the end of a table declaration')
    return pos + 1, key


            

Reported by Pylint.

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

Line: 321 Column: 9

                  try:
        out.data.append_nest_to_list(key)
    except KeyError:
        raise suffixed_err(src, pos, "Can not overwrite a value")

    if not src.startswith("]]", pos):
        raise suffixed_err(src, pos, 'Expected "]]" at the end of an array declaration')
    return pos + 2, key


            

Reported by Pylint.

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

Line: 344 Column: 9

                  try:
        nest = out.data.get_or_create_nest(abs_key_parent)
    except KeyError:
        raise suffixed_err(src, pos, "Can not overwrite a value")
    if key_stem in nest:
        raise suffixed_err(src, pos, "Can not overwrite a value")
    # Mark inline table and array namespaces recursively immutable
    if isinstance(value, (dict, list)):
        out.flags.set(header + key, Flags.FROZEN, recursive=True)

            

Reported by Pylint.

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

Line: 449 Column: 13

                      try:
            nest = nested_dict.get_or_create_nest(key_parent, access_lists=False)
        except KeyError:
            raise suffixed_err(src, pos, "Can not overwrite a value")
        if key_stem in nest:
            raise suffixed_err(src, pos, f'Duplicate inline table key "{key_stem}"')
        nest[key_stem] = value
        pos = skip_chars(src, pos, TOML_WS)
        c = src[pos : pos + 1]

            

Reported by Pylint.

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

Line: 492 Column: 13

                      return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]
    except KeyError:
        if len(escape_id) != 2:
            raise suffixed_err(src, pos, "Unterminated string")
        raise suffixed_err(src, pos, 'Unescaped "\\" in a string')


def parse_basic_str_escape_multiline(src: str, pos: Pos) -> Tuple[Pos, str]:
    return parse_basic_str_escape(src, pos, multiline=True)

            

Reported by Pylint.

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

Line: 493 Column: 9

                  except KeyError:
        if len(escape_id) != 2:
            raise suffixed_err(src, pos, "Unterminated string")
        raise suffixed_err(src, pos, 'Unescaped "\\" in a string')


def parse_basic_str_escape_multiline(src: str, pos: Pos) -> Tuple[Pos, str]:
    return parse_basic_str_escape(src, pos, multiline=True)


            

Reported by Pylint.

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

Line: 564 Column: 13

                      try:
            char = src[pos]
        except IndexError:
            raise suffixed_err(src, pos, "Unterminated string")
        if char == '"':
            if not multiline:
                return pos + 1, result + src[start_pos:pos]
            if src.startswith('"""', pos):
                return pos + 3, result + src[start_pos:pos]

            

Reported by Pylint.

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

Line: 617 Column: 13

                      try:
            datetime_obj = match_to_datetime(datetime_match)
        except ValueError:
            raise suffixed_err(src, pos, "Invalid date or datetime")
        return datetime_match.end(), datetime_obj
    localtime_match = RE_LOCALTIME.match(src, pos)
    if localtime_match:
        return localtime_match.end(), match_to_localtime(localtime_match)


            

Reported by Pylint.

pipenv/vendor/distlib/resources.py
48 issues
Attempted relative import beyond top-level package
Error

Line: 18 Column: 1

              import types
import zipimport

from . import DistlibException
from .util import cached_property, get_cache_base, Cache

logger = logging.getLogger(__name__)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              import zipimport

from . import DistlibException
from .util import cached_property, get_cache_base, Cache

logger = logging.getLogger(__name__)


cache = None    # created when needed

            

Reported by Pylint.

Module 'zipimport' has no '_zip_directory_cache' member
Error

Line: 220 Column: 27

                      if hasattr(self.loader, '_files'):
            self._files = self.loader._files
        else:
            self._files = zipimport._zip_directory_cache[archive]
        self.index = sorted(self._files)

    def _adjust_path(self, path):
        return path


            

Reported by Pylint.

Module 'zipimport' has no 'zipimporter' member
Error

Line: 288 Column: 5

              
_finder_registry = {
    type(None): ResourceFinder,
    zipimport.zipimporter: ZipResourceFinder
}

try:
    # In Python 3.6, _frozen_importlib -> _frozen_importlib_external
    try:

            

Reported by Pylint.

Unused argument 'path'
Error

Line: 34 Column: 34

                          base = os.path.join(get_cache_base(), str('resource-cache'))
        super(ResourceCache, self).__init__(base)

    def is_stale(self, resource, path):
        """
        Is the cache stale for the given resource?

        :param resource: The :class:`Resource` being cached.
        :param path: The path of the resource in the cache.

            

Reported by Pylint.

Unused argument 'resource'
Error

Line: 34 Column: 24

                          base = os.path.join(get_cache_base(), str('resource-cache'))
        super(ResourceCache, self).__init__(base)

    def is_stale(self, resource, path):
        """
        Is the cache stale for the given resource?

        :param resource: The :class:`Resource` being cached.
        :param path: The path of the resource in the cache.

            

Reported by Pylint.

Redefining name 'finder' from outer scope (line 313)
Error

Line: 72 Column: 24

              

class ResourceBase(object):
    def __init__(self, finder, name):
        self.finder = finder
        self.name = name


class Resource(ResourceBase):

            

Reported by Pylint.

Using the global statement
Error

Line: 96 Column: 9

              
    @cached_property
    def file_path(self):
        global cache
        if cache is None:
            cache = ResourceCache()
        return cache.get(self)

    @cached_property

            

Reported by Pylint.

Attribute 'path' defined outside __init__
Error

Line: 163 Column: 13

                              result = ResourceContainer(self, resource_name)
            else:
                result = Resource(self, resource_name)
            result.path = path
        return result

    def get_stream(self, resource):
        return open(resource.path, 'rb')


            

Reported by Pylint.

Attribute 'path' defined outside __init__
Error

Line: 163 Column: 13

                              result = ResourceContainer(self, resource_name)
            else:
                result = Resource(self, resource_name)
            result.path = path
        return result

    def get_stream(self, resource):
        return open(resource.path, 'rb')


            

Reported by Pylint.

pipenv/patched/piptools/utils.py
48 issues
Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
import six
from click.utils import LazyFile
from ._compat import install_req_from_line
from six.moves import shlex_quote
from pipenv.vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier
from pipenv.vendor.packaging.version import Version, InvalidVersion, parse as parse_version
from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 18 Column: 1

              from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


from ._compat import PIP_VERSION
from .click import style

UNSAFE_PACKAGES = {"setuptools", "distribute", "pip"}
COMPILE_EXCLUDE_OPTIONS = {
    "--dry-run",

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              

from ._compat import PIP_VERSION
from .click import style

UNSAFE_PACKAGES = {"setuptools", "distribute", "pip"}
COMPILE_EXCLUDE_OPTIONS = {
    "--dry-run",
    "--quiet",

            

Reported by Pylint.

function already defined line 263
Error

Line: 313 Column: 13

                  if keyval is None:
        if key is None:

            def keyval(v):
                return v

        else:

            def keyval(v):

            

Reported by Pylint.

function already defined line 263
Error

Line: 318 Column: 13

              
        else:

            def keyval(v):
                return (key(v), v)

    if unique:
        return dict(keyval(v) for v in values)


            

Reported by Pylint.

Unable to import 'piptools.scripts.compile'
Error

Line: 420 Column: 5

                      - removing one-off arguments like '--upgrade'
        - removing arguments that don't change build behaviour like '--verbose'
    """
    from piptools.scripts.compile import cli

    # Map of the compile cli options (option name -> click.Option)
    compile_options = {option.name: option for option in cli.params}

    left_args = []

            

Reported by Pylint.

Unused InvalidVersion imported from pipenv.vendor.packaging.version
Error

Line: 14 Column: 1

              from ._compat import install_req_from_line
from six.moves import shlex_quote
from pipenv.vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier
from pipenv.vendor.packaging.version import Version, InvalidVersion, parse as parse_version
from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


from ._compat import PIP_VERSION
from .click import style

            

Reported by Pylint.

Unused Version imported from pipenv.vendor.packaging.version
Error

Line: 14 Column: 1

              from ._compat import install_req_from_line
from six.moves import shlex_quote
from pipenv.vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier
from pipenv.vendor.packaging.version import Version, InvalidVersion, parse as parse_version
from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


from ._compat import PIP_VERSION
from .click import style

            

Reported by Pylint.

Unused Value imported from pipenv.vendor.packaging.markers
Error

Line: 15 Column: 1

              from six.moves import shlex_quote
from pipenv.vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier
from pipenv.vendor.packaging.version import Version, InvalidVersion, parse as parse_version
from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


from ._compat import PIP_VERSION
from .click import style


            

Reported by Pylint.

Unused Variable imported from pipenv.vendor.packaging.markers
Error

Line: 15 Column: 1

              from six.moves import shlex_quote
from pipenv.vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier
from pipenv.vendor.packaging.version import Version, InvalidVersion, parse as parse_version
from pipenv.vendor.packaging.markers import Marker, Op, Value, Variable


from ._compat import PIP_VERSION
from .click import style


            

Reported by Pylint.