The following issues were found
tests/unit/test_utils.py
82 issues
Line: 3
Column: 1
import os
import pytest
import pipenv.utils
from pipenv.exceptions import PipenvUsageError
# Pipfile format <-> requirements.txt format.
Reported by Pylint.
Line: 83
Column: 9
@pytest.mark.needs_internet
def test_convert_deps_to_pip(monkeypatch, deps, expected):
with monkeypatch.context() as m:
import pip_shims
m.setattr(pip_shims.shims, "unpack_url", mock_unpack)
if expected.startswith("Django"):
expected = expected.lower()
assert pipenv.utils.convert_deps_to_pip(deps, r=False) == [expected]
Reported by Pylint.
Line: 258
Column: 5
assert pipenv.utils.is_python_command(line) == expected
@pytest.mark.utils
def test_new_line_end_of_toml_file(this):
# toml file that needs clean up
toml = """
[dev-packages]
"flake8" = ">=3.3.0,<4"
Reported by Pylint.
Line: 73
Column: 70
]
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
Reported by Pylint.
Line: 73
Column: 49
]
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
Reported by Pylint.
Line: 73
Column: 35
]
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
Reported by Pylint.
Line: 73
Column: 23
]
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
Reported by Pylint.
Line: 73
Column: 17
]
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
Reported by Pylint.
Line: 74
Column: 17
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
@pytest.mark.parametrize("deps, expected", DEP_PIP_PAIRS)
Reported by Pylint.
Line: 74
Column: 30
def mock_unpack(link, source_dir, download_dir, only_download=False, session=None,
hashes=None, progress_bar="off"):
return
@pytest.mark.utils
@pytest.mark.parametrize("deps, expected", DEP_PIP_PAIRS)
Reported by Pylint.
pipenv/environments.py
80 issues
Line: 7
Column: 1
import re
import sys
from appdirs import user_cache_dir
from vistir.path import normalize_drive
from pipenv._compat import fix_utf8
from pipenv.vendor.vistir.misc import _isatty, fs_str
Reported by Pylint.
Line: 8
Column: 1
import sys
from appdirs import user_cache_dir
from vistir.path import normalize_drive
from pipenv._compat import fix_utf8
from pipenv.vendor.vistir.misc import _isatty, fs_str
Reported by Pylint.
Line: 131
Column: 9
def initialize(self):
self.PIPENV_CACHE_DIR = os.environ.get("PIPENV_CACHE_DIR", user_cache_dir("pipenv"))
"""Location for Pipenv to store it's package cache.
Default is to use appdir's user cache directory.
"""
# Tells Pipenv which Python to default to, when none is provided.
Reported by Pylint.
Line: 138
Column: 9
# Tells Pipenv which Python to default to, when none is provided.
self.PIPENV_DEFAULT_PYTHON_VERSION = os.environ.get("PIPENV_DEFAULT_PYTHON_VERSION")
"""Use this Python version when creating new virtual environments by default.
This can be set to a version string, e.g. ``3.6``, or a path. Default is to use
whatever Python Pipenv is installed under (i.e. ``sys.executable``). Command
line flags (e.g. ``--python``, ``--three``, and ``--two``) are prioritized over
this configuration.
Reported by Pylint.
Line: 147
Column: 9
"""
self.PIPENV_DONT_LOAD_ENV = bool(os.environ.get("PIPENV_DONT_LOAD_ENV"))
"""If set, Pipenv does not load the ``.env`` file.
Default is to load ``.env`` for ``run`` and ``shell`` commands.
"""
self.PIPENV_DONT_USE_PYENV = bool(os.environ.get("PIPENV_DONT_USE_PYENV"))
Reported by Pylint.
Line: 153
Column: 9
"""
self.PIPENV_DONT_USE_PYENV = bool(os.environ.get("PIPENV_DONT_USE_PYENV"))
"""If set, Pipenv does not attempt to install Python with pyenv.
Default is to install Python automatically via pyenv when needed, if possible.
"""
self.PIPENV_DONT_USE_ASDF = bool(os.environ.get("PIPENV_DONT_USE_ASDF"))
Reported by Pylint.
Line: 159
Column: 9
"""
self.PIPENV_DONT_USE_ASDF = bool(os.environ.get("PIPENV_DONT_USE_ASDF"))
"""If set, Pipenv does not attempt to install Python with asdf.
Default is to install Python automatically via asdf when needed, if possible.
"""
self.PIPENV_DOTENV_LOCATION = os.environ.get("PIPENV_DOTENV_LOCATION")
Reported by Pylint.
Line: 165
Column: 9
"""
self.PIPENV_DOTENV_LOCATION = os.environ.get("PIPENV_DOTENV_LOCATION")
"""If set, Pipenv loads the ``.env`` file at the specified location.
Default is to load ``.env`` from the project root, if found.
"""
self.PIPENV_EMULATOR = os.environ.get("PIPENV_EMULATOR", "")
Reported by Pylint.
Line: 171
Column: 9
"""
self.PIPENV_EMULATOR = os.environ.get("PIPENV_EMULATOR", "")
"""If set, the terminal emulator's name for ``pipenv shell`` to use.
Default is to detect emulators automatically. This should be set if your
emulator, e.g. Cmder, cannot be detected correctly.
"""
Reported by Pylint.
Line: 178
Column: 9
"""
self.PIPENV_IGNORE_VIRTUALENVS = bool(os.environ.get("PIPENV_IGNORE_VIRTUALENVS"))
"""If set, Pipenv will always assign a virtual environment for this project.
By default, Pipenv tries to detect whether it is run inside a virtual
environment, and reuses it if possible. This is usually the desired behavior,
and enables the user to use any user-built environments with Pipenv.
"""
Reported by Pylint.
pipenv/vendor/jinja2/ext.py
80 issues
Line: 9
Column: 1
from markupsafe import Markup
from . import defaults
from . import nodes
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
Reported by Pylint.
Line: 10
Column: 1
from markupsafe import Markup
from . import defaults
from . import nodes
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
Reported by Pylint.
Line: 11
Column: 1
from . import defaults
from . import nodes
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
Reported by Pylint.
Line: 12
Column: 1
from . import defaults
from . import nodes
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
Reported by Pylint.
Line: 13
Column: 1
from . import nodes
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
Reported by Pylint.
Line: 14
Column: 1
from .environment import Environment
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
Reported by Pylint.
Line: 15
Column: 1
from .exceptions import TemplateAssertionError
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
if t.TYPE_CHECKING:
Reported by Pylint.
Line: 16
Column: 1
from .exceptions import TemplateSyntaxError
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
if t.TYPE_CHECKING:
import typing_extensions as te
Reported by Pylint.
Line: 17
Column: 1
from .runtime import concat # type: ignore
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
if t.TYPE_CHECKING:
import typing_extensions as te
from .lexer import Token
Reported by Pylint.
Line: 18
Column: 1
from .runtime import Context
from .runtime import Undefined
from .utils import import_string
from .utils import pass_context
if t.TYPE_CHECKING:
import typing_extensions as te
from .lexer import Token
from .lexer import TokenStream
Reported by Pylint.
tests/integration/conftest.py
80 issues
Line: 14
Column: 1
from shutil import rmtree as _rmtree
import pytest
import requests
from click.testing import CliRunner
from pytest_pypi.app import prepare_fixtures
from pytest_pypi.app import prepare_packages as prepare_pypi_packages
Reported by Pylint.
Line: 18
Column: 1
import requests
from click.testing import CliRunner
from pytest_pypi.app import prepare_fixtures
from pytest_pypi.app import prepare_packages as prepare_pypi_packages
from pipenv._compat import Path
from pipenv.cli import cli
from pipenv.exceptions import VirtualenvActivationException
Reported by Pylint.
Line: 19
Column: 1
from click.testing import CliRunner
from pytest_pypi.app import prepare_fixtures
from pytest_pypi.app import prepare_packages as prepare_pypi_packages
from pipenv._compat import Path
from pipenv.cli import cli
from pipenv.exceptions import VirtualenvActivationException
from pipenv.utils import subprocess_run
Reported by Pylint.
Line: 26
Column: 1
from pipenv.exceptions import VirtualenvActivationException
from pipenv.utils import subprocess_run
from pipenv.vendor import toml, tomlkit
from pipenv.vendor.vistir.compat import (
FileNotFoundError, PermissionError, ResourceWarning, TemporaryDirectory,
fs_encode, fs_str
)
from pipenv.vendor.vistir.contextmanagers import temp_environ
from pipenv.vendor.vistir.misc import run
Reported by Pylint.
Line: 26
Column: 1
from pipenv.exceptions import VirtualenvActivationException
from pipenv.utils import subprocess_run
from pipenv.vendor import toml, tomlkit
from pipenv.vendor.vistir.compat import (
FileNotFoundError, PermissionError, ResourceWarning, TemporaryDirectory,
fs_encode, fs_str
)
from pipenv.vendor.vistir.contextmanagers import temp_environ
from pipenv.vendor.vistir.misc import run
Reported by Pylint.
Line: 26
Column: 1
from pipenv.exceptions import VirtualenvActivationException
from pipenv.utils import subprocess_run
from pipenv.vendor import toml, tomlkit
from pipenv.vendor.vistir.compat import (
FileNotFoundError, PermissionError, ResourceWarning, TemporaryDirectory,
fs_encode, fs_str
)
from pipenv.vendor.vistir.contextmanagers import temp_environ
from pipenv.vendor.vistir.misc import run
Reported by Pylint.
Line: 59
Column: 16
warnings.warn(
f"Skipped connecting to internet: {url}", RuntimeWarning
)
except Exception:
warnings.warn(
f"Failed connecting to internet: {url}", RuntimeWarning
)
else:
has_internet = True
Reported by Pylint.
Line: 77
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b604_any_other_function_with_shell_equals_true.html
# GitHub does not provide shell access.' if ssh keys are available and
# registered with GitHub. Otherwise, the command will fail with
# return_code=255 and say 'Permission denied (publickey).'
c = subprocess_run('ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -T git@github.com', timeout=30, shell=True)
res = True if c.returncode == 1 else False
except KeyboardInterrupt:
warnings.warn(
"KeyboardInterrupt while checking GitHub ssh access", RuntimeWarning
)
Reported by Bandit.
Line: 83
Column: 12
warnings.warn(
"KeyboardInterrupt while checking GitHub ssh access", RuntimeWarning
)
except Exception:
pass
global HAS_WARNED_GITHUB
if not res and not HAS_WARNED_GITHUB:
warnings.warn(
'Cannot connect to GitHub via SSH', RuntimeWarning
Reported by Pylint.
Line: 85
Column: 5
)
except Exception:
pass
global HAS_WARNED_GITHUB
if not res and not HAS_WARNED_GITHUB:
warnings.warn(
'Cannot connect to GitHub via SSH', RuntimeWarning
)
warnings.warn(
Reported by Pylint.
pipenv/cli/command.py
80 issues
Line: 75
Column: 9
):
# Handle this ASAP to make shell startup fast.
if completion:
from .. import shells
try:
shell = shells.detect_info(state.project)[0]
except shells.ShellDetectionFailure:
echo(
Reported by Pylint.
Line: 89
Column: 5
print(click_completion.get_code(shell=shell, prog_name="pipenv"))
return 0
from ..core import (
cleanup_virtualenv, do_clear, do_py, do_where, ensure_project,
format_help, system_which, warn_in_virtualenv
)
from ..utils import create_spinner
Reported by Pylint.
Line: 93
Column: 5
cleanup_virtualenv, do_clear, do_py, do_where, ensure_project,
format_help, system_which, warn_in_virtualenv
)
from ..utils import create_spinner
if man:
if system_which("man"):
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "pipenv.1")
os.execle(system_which("man"), "man", path, os.environ)
Reported by Pylint.
Line: 127
Column: 13
return 0
# --support was passed...
elif support:
from ..help import get_pipenv_diagnostics
get_pipenv_diagnostics(state.project)
return 0
# --clear was passed...
elif state.clear:
Reported by Pylint.
Line: 218
Column: 5
**kwargs
):
"""Installs provided packages and adds them to Pipfile, or (if no packages are given), installs all packages from Pipfile."""
from ..core import do_install
do_install(
state.project,
dev=state.installstate.dev,
three=state.three,
Reported by Pylint.
Line: 272
Column: 5
**kwargs
):
"""Uninstalls a provided package and removes it from Pipfile."""
from ..core import do_uninstall
retcode = do_uninstall(
state.project,
packages=state.installstate.packages,
editable_packages=state.installstate.editables,
three=state.three,
Reported by Pylint.
Line: 317
Column: 5
**kwargs
):
"""Generates Pipfile.lock."""
from ..core import do_init, do_lock, ensure_project
# Ensure that virtualenv is available.
# Note that we don't pass clear on to ensure_project as it is also
# handled in do_lock
ensure_project(
Reported by Pylint.
Line: 398
Column: 5
anyway=False,
):
"""Spawns a shell within the virtualenv."""
from ..core import do_shell, load_dot_env
# Prevent user from activating nested environments.
if "PIPENV_ACTIVE" in os.environ:
# If PIPENV_ACTIVE is set, VIRTUAL_ENV should always be set too.
venv_name = os.environ.get("VIRTUAL_ENV", "UNKNOWN_VIRTUAL_ENVIRONMENT")
Reported by Pylint.
Line: 439
Column: 5
@pass_state
def run(state, command, args):
"""Spawns a command installed into the virtualenv."""
from ..core import do_run
do_run(
state.project, command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
)
Reported by Pylint.
Line: 504
Column: 5
**kwargs
):
"""Checks for PyUp Safety security vulnerabilities and against PEP 508 markers provided in Pipfile."""
from ..core import do_check
do_check(
state.project,
three=state.three,
python=state.python,
Reported by Pylint.
pipenv/patched/notpip/_vendor/html5lib/treebuilders/dom.py
78 issues
Line: 11
Column: 1
from xml.dom import minidom, Node
import weakref
from . import base
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
Reported by Pylint.
Line: 12
Column: 1
import weakref
from . import base
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Reported by Pylint.
Line: 13
Column: 1
from . import base
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
Reported by Pylint.
Line: 14
Column: 1
from . import base
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
Reported by Pylint.
Line: 89
Column: 13
child = self.element.firstChild
self.element.removeChild(child)
newParent.element.appendChild(child)
self.childNodes = []
def getAttributes(self):
return AttrList(self.element)
def setAttributes(self, attributes):
Reported by Pylint.
Line: 123
Column: 5
nameTuple = property(getNameTuple)
class TreeBuilder(base.TreeBuilder): # pylint:disable=unused-variable
def documentClass(self):
self.dom = Dom.getDOMImplementation().createDocument(None, None, None)
return weakref.proxy(self)
def insertDoctype(self, token):
Reported by Pylint.
Line: 125
Column: 13
class TreeBuilder(base.TreeBuilder): # pylint:disable=unused-variable
def documentClass(self):
self.dom = Dom.getDOMImplementation().createDocument(None, None, None)
return weakref.proxy(self)
def insertDoctype(self, token):
name = token["name"]
publicId = token["publicId"]
Reported by Pylint.
Line: 166
Column: 13
return base.TreeBuilder.getFragment(self).element
def insertText(self, data, parent=None):
data = data
if parent != self:
base.TreeBuilder.insertText(self, data, parent)
else:
# HACK: allow text nodes as children of the document node
if hasattr(self.dom, '_child_node_types'):
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import, division, unicode_literals
try:
from collections.abc import MutableMapping
except ImportError: # Python 2.7
from collections import MutableMapping
from xml.dom import minidom, Node
import weakref
Reported by Pylint.
Line: 8
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b408-import-xml-minidom
from collections.abc import MutableMapping
except ImportError: # Python 2.7
from collections import MutableMapping
from xml.dom import minidom, Node
import weakref
from . import base
from .. import constants
from ..constants import namespaces
Reported by Bandit.
pipenv/vendor/pip_shims/models.py
78 issues
Line: 18
Column: 1
import six
from . import compat
from .environment import BASE_IMPORT_PATH, MYPY_RUNNING, get_pip_version
from .utils import (
add_mixin_to_class,
apply_alias,
ensure_function,
Reported by Pylint.
Line: 19
Column: 1
import six
from . import compat
from .environment import BASE_IMPORT_PATH, MYPY_RUNNING, get_pip_version
from .utils import (
add_mixin_to_class,
apply_alias,
ensure_function,
fallback_is_artifact,
Reported by Pylint.
Line: 20
Column: 1
from . import compat
from .environment import BASE_IMPORT_PATH, MYPY_RUNNING, get_pip_version
from .utils import (
add_mixin_to_class,
apply_alias,
ensure_function,
fallback_is_artifact,
fallback_is_file_url,
Reported by Pylint.
Line: 52
Column: 5
if MYPY_RUNNING:
import packaging.version
Module = types.ModuleType
from typing import ( # noqa:F811
Any,
Callable,
Reported by Pylint.
Line: 420
Column: 24
# type: (Union[Module, Type, None]) -> Any
functions = self._parse_provides_dict(self.provided_functions)
if provided is None:
provided = __module__ # type: ignore # noqa:F821
for funcname, func in functions.items():
func = ensure_function(provided, funcname, func)
setattr(provided, funcname, func)
return provided
Reported by Pylint.
Line: 20
Column: 1
from . import compat
from .environment import BASE_IMPORT_PATH, MYPY_RUNNING, get_pip_version
from .utils import (
add_mixin_to_class,
apply_alias,
ensure_function,
fallback_is_artifact,
fallback_is_file_url,
Reported by Pylint.
Line: 20
Column: 1
from . import compat
from .environment import BASE_IMPORT_PATH, MYPY_RUNNING, get_pip_version
from .utils import (
add_mixin_to_class,
apply_alias,
ensure_function,
fallback_is_artifact,
fallback_is_file_url,
Reported by Pylint.
Line: 52
Column: 5
if MYPY_RUNNING:
import packaging.version
Module = types.ModuleType
from typing import ( # noqa:F811
Any,
Callable,
Reported by Pylint.
Line: 55
Column: 5
import packaging.version
Module = types.ModuleType
from typing import ( # noqa:F811
Any,
Callable,
ContextManager,
Dict,
Iterable,
Reported by Pylint.
Line: 55
Column: 5
import packaging.version
Module = types.ModuleType
from typing import ( # noqa:F811
Any,
Callable,
ContextManager,
Dict,
Iterable,
Reported by Pylint.
pipenv/vendor/jinja2/runtime.py
74 issues
Line: 12
Column: 1
from markupsafe import Markup
from markupsafe import soft_str
from .async_utils import auto_aiter
from .async_utils import auto_await # noqa: F401
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
Reported by Pylint.
Line: 13
Column: 1
from markupsafe import soft_str
from .async_utils import auto_aiter
from .async_utils import auto_await # noqa: F401
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
Reported by Pylint.
Line: 14
Column: 1
from .async_utils import auto_aiter
from .async_utils import auto_await # noqa: F401
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
Reported by Pylint.
Line: 15
Column: 1
from .async_utils import auto_aiter
from .async_utils import auto_await # noqa: F401
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
Reported by Pylint.
Line: 16
Column: 1
from .async_utils import auto_await # noqa: F401
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
Reported by Pylint.
Line: 17
Column: 1
from .exceptions import TemplateNotFound # noqa: F401
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace # noqa: F401
Reported by Pylint.
Line: 18
Column: 1
from .exceptions import TemplateRuntimeError # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace # noqa: F401
from .utils import object_type_repr
Reported by Pylint.
Line: 19
Column: 1
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace # noqa: F401
from .utils import object_type_repr
from .utils import pass_eval_context
Reported by Pylint.
Line: 20
Column: 1
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace # noqa: F401
from .utils import object_type_repr
from .utils import pass_eval_context
Reported by Pylint.
Line: 21
Column: 1
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace # noqa: F401
from .utils import object_type_repr
from .utils import pass_eval_context
V = t.TypeVar("V")
Reported by Pylint.
pipenv/vendor/click/termui.py
74 issues
Line: 10
Column: 1
import typing as t
from gettext import gettext as _
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
Reported by Pylint.
Line: 11
Column: 1
from gettext import gettext as _
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
Reported by Pylint.
Line: 12
Column: 1
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
Reported by Pylint.
Line: 13
Column: 1
from ._compat import isatty
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
Reported by Pylint.
Line: 14
Column: 1
from ._compat import strip_ansi
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
Reported by Pylint.
Line: 15
Column: 1
from ._compat import WIN
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
from .utils import LazyFile
Reported by Pylint.
Line: 16
Column: 1
from .exceptions import Abort
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
from .utils import LazyFile
Reported by Pylint.
Line: 17
Column: 1
from .exceptions import UsageError
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
from .utils import LazyFile
if t.TYPE_CHECKING:
Reported by Pylint.
Line: 18
Column: 1
from .globals import resolve_color_default
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
from .utils import LazyFile
if t.TYPE_CHECKING:
from ._termui_impl import ProgressBar
Reported by Pylint.
Line: 19
Column: 1
from .types import Choice
from .types import convert_type
from .types import ParamType
from .utils import echo
from .utils import LazyFile
if t.TYPE_CHECKING:
from ._termui_impl import ProgressBar
Reported by Pylint.
pipenv/patched/notpip/_vendor/distlib/_backport/sysconfig.py
73 issues
Line: 71
Column: 9
def _ensure_cfg_read():
global _cfg_read
if not _cfg_read:
from ..resources import finder
backport_package = __name__.rsplit('.', 1)[0]
_finder = finder(backport_package)
_cfgfile = _finder.find('sysconfig.cfg')
assert _cfgfile, 'sysconfig.cfg exists'
with _cfgfile.as_stream() as s:
Reported by Pylint.
Line: 188
Column: 35
env_base = os.environ.get("PYTHONUSERBASE", None)
def joinuser(*args):
return os.path.expanduser(os.path.join(*args))
# what about 'os2emx', 'riscos' ?
if os.name == "nt":
base = os.environ.get("APPDATA") or "~"
if env_base:
Reported by Pylint.
Line: 69
Column: 5
_cfg_read = False
def _ensure_cfg_read():
global _cfg_read
if not _cfg_read:
from ..resources import finder
backport_package = __name__.rsplit('.', 1)[0]
_finder = finder(backport_package)
_cfgfile = _finder.find('sysconfig.cfg')
Reported by Pylint.
Line: 77
Column: 13
_cfgfile = _finder.find('sysconfig.cfg')
assert _cfgfile, 'sysconfig.cfg exists'
with _cfgfile.as_stream() as s:
_SCHEMES.readfp(s)
if _PYTHON_BUILD:
for scheme in ('posix_prefix', 'posix_home'):
_SCHEMES.set(scheme, 'include', '{srcdir}/Include')
_SCHEMES.set(scheme, 'platinclude', '{projectbase}/.')
Reported by Pylint.
Line: 92
Column: 9
def _expand_globals(config):
_ensure_cfg_read()
if config.has_section('globals'):
globals = config.items('globals')
else:
globals = tuple()
sections = config.sections()
for section in sections:
Reported by Pylint.
Line: 113
Column: 24
def _replacer(matchobj):
name = matchobj.group(1)
if name in variables:
return variables[name]
return matchobj.group(0)
for option, value in config.items(section):
config.set(section, option, _VAR_REPL.sub(_replacer, value))
Reported by Pylint.
Line: 114
Column: 24
def _replacer(matchobj):
name = matchobj.group(1)
if name in variables:
return variables[name]
return matchobj.group(0)
for option, value in config.items(section):
config.set(section, option, _VAR_REPL.sub(_replacer, value))
Reported by Pylint.
Line: 155
Column: 26
target_dict[key] = value
def _expand_vars(scheme, vars):
res = {}
if vars is None:
vars = {}
_extend_dict(vars, get_config_vars())
Reported by Pylint.
Line: 168
Column: 25
return res
def format_value(value, vars):
def _replacer(matchobj):
name = matchobj.group(1)
if name in vars:
return vars[name]
return matchobj.group(0)
Reported by Pylint.
Line: 213
Column: 31
return joinuser("~", ".local")
def _parse_makefile(filename, vars=None):
"""Parse a Makefile-style file.
A dictionary containing name/value pairs is returned. If an
optional dictionary is passed in as the second argument, it is
used instead of a new dictionary.
Reported by Pylint.