The following issues were found
pipenv/vendor/wheel/__main__.py
3 issues
Line: 8
Column: 1
import sys
def main(): # needed for console script
if __package__ == '':
# To be able to run 'python wheel-0.9.whl/wheel':
import os.path
path = os.path.dirname(os.path.dirname(__file__))
sys.path[0:0] = [path]
Reported by Pylint.
Line: 11
Column: 9
def main(): # needed for console script
if __package__ == '':
# To be able to run 'python wheel-0.9.whl/wheel':
import os.path
path = os.path.dirname(os.path.dirname(__file__))
sys.path[0:0] = [path]
import wheel.cli
sys.exit(wheel.cli.main())
Reported by Pylint.
Line: 14
Column: 5
import os.path
path = os.path.dirname(os.path.dirname(__file__))
sys.path[0:0] = [path]
import wheel.cli
sys.exit(wheel.cli.main())
if __name__ == "__main__":
sys.exit(main())
Reported by Pylint.
pipenv/patched/notpip/_vendor/requests/packages.py
3 issues
Line: 1
Column: 1
import sys
# This code exists for backwards compatibility reasons.
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
vendored_package = "pipenv.patched.notpip._vendor." + package
locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such that the identities are
Reported by Pylint.
Line: 7
Column: 5
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
vendored_package = "pipenv.patched.notpip._vendor." + package
locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for mod in list(sys.modules):
if mod == vendored_package or mod.startswith(vendored_package + '.'):
Reported by Pylint.
Line: 14
Column: 1
for mod in list(sys.modules):
if mod == vendored_package or mod.startswith(vendored_package + '.'):
unprefixed_mod = mod[len("pipenv.patched.notpip._vendor."):]
sys.modules['pipenv.patched.notpip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
# Kinda cool, though, right?
Reported by Pylint.
pipenv/patched/notpip/_internal/operations/build/metadata_legacy.py
3 issues
Line: 37
Column: 25
def locate_editable_egg_info(base):
# type: (str) -> List[str]
candidates = [] # type: List[str]
for root, dirs, files in os.walk(base):
for dir_ in vcs.dirnames:
if dir_ in dirs:
dirs.remove(dir_)
# Iterate over a copy of ``dirs``, since mutating
# a list while iterating over it can cause trouble.
Reported by Pylint.
Line: 48
Column: 22
if looks_like_virtual_env(os.path.join(root, dir_)):
dirs.remove(dir_)
# Also don't search through tests
elif dir_ == 'test' or dir_ == 'tests':
dirs.remove(dir_)
candidates.extend(os.path.join(root, dir_) for dir_ in dirs)
return [f for f in candidates if f.endswith('.egg-info')]
def depth_of_directory(dir_):
Reported by Pylint.
Line: 81
Column: 1
return os.path.join(base, filenames[0])
def generate_metadata(
build_env, # type: BuildEnvironment
setup_py_path, # type: str
source_dir, # type: str
editable, # type: bool
isolated, # type: bool
Reported by Pylint.
pipenv/patched/notpip/_vendor/requests/_internal_utils.py
3 issues
Line: 11
Column: 1
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
Reported by Pylint.
Line: 11
Column: 1
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
Reported by Pylint.
Line: 37
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
and not Python 2 `str`.
:rtype: bool
"""
assert isinstance(u_string, str)
try:
u_string.encode('ascii')
return True
except UnicodeEncodeError:
return False
Reported by Bandit.
pipenv/vendor/idna/uts46data.py
3 issues
Line: 5
Column: 1
from typing import List, Tuple, Union
"""IDNA Mapping Table from UTS46."""
__version__ = '13.0.0'
def _seg_0():
# type: () -> List[Union[Tuple[int, str], Tuple[int, str, str]]]
Reported by Pylint.
Line: 1
Column: 1
# This file is automatically generated by tools/idna-data
from typing import List, Tuple, Union
"""IDNA Mapping Table from UTS46."""
__version__ = '13.0.0'
def _seg_0():
Reported by Pylint.
Line: 1
Column: 1
# This file is automatically generated by tools/idna-data
from typing import List, Tuple, Union
"""IDNA Mapping Table from UTS46."""
__version__ = '13.0.0'
def _seg_0():
Reported by Pylint.
pipenv/__main__.py
3 issues
Line: 5
Column: 5
if __name__ == "__main__":
cli()
Reported by Pylint.
Line: 5
Column: 5
if __name__ == "__main__":
cli()
Reported by Pylint.
Line: 1
Column: 1
from pipenv.cli import cli
if __name__ == "__main__":
cli()
Reported by Pylint.
pipenv/patched/notpip/_vendor/pytoml/core.py
3 issues
Line: 1
Column: 1
class TomlError(RuntimeError):
def __init__(self, message, line, col, filename):
RuntimeError.__init__(self, message, line, col, filename)
self.message = message
self.line = line
self.col = col
self.filename = filename
def __str__(self):
Reported by Pylint.
Line: 1
Column: 1
class TomlError(RuntimeError):
def __init__(self, message, line, col, filename):
RuntimeError.__init__(self, message, line, col, filename)
self.message = message
self.line = line
self.col = col
self.filename = filename
def __str__(self):
Reported by Pylint.
Line: 13
Column: 1
return '{}({}, {}): {}'.format(self.filename, self.line, self.col, self.message)
def __repr__(self):
return 'TomlError({!r}, {!r}, {!r}, {!r})'.format(self.message, self.line, self.col, self.filename)
Reported by Pylint.
pipenv/vendor/dparse/errors.py
3 issues
Line: 8
Column: 5
"""
"""
pass
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
class UnknownDependencyFileError(Exception):
"""
"""
pass
Reported by Pylint.
Line: 4
Column: 1
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
class UnknownDependencyFileError(Exception):
"""
"""
pass
Reported by Pylint.
pipenv/patched/notpip/_vendor/pep517/colorlog.py
3 issues
Line: 35
Column: 16
curses.setupterm()
if curses.tigetnum("colors") > 0:
color = True
except Exception:
pass
return color
class LogFormatter(logging.Formatter):
Reported by Pylint.
Line: 35
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b110_try_except_pass.html
curses.setupterm()
if curses.tigetnum("colors") > 0:
color = True
except Exception:
pass
return color
class LogFormatter(logging.Formatter):
Reported by Bandit.
Line: 111
Column: 1
return record.message + space + start_color + right_text + end_color
def enable_colourful_output(level=logging.INFO):
handler = logging.StreamHandler()
handler.setFormatter(LogFormatter())
logging.root.addHandler(handler)
logging.root.setLevel(level)
Reported by Pylint.
pipenv/patched/notpip/_internal/commands/check.py
3 issues
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import logging
from pipenv.patched.notpip._internal.cli.base_command import Command
from pipenv.patched.notpip._internal.operations.check import (
check_package_set,
create_package_set_from_installed,
Reported by Pylint.
Line: 22
Column: 5
usage = """
%prog [options]"""
def run(self, options, args):
package_set, parsing_probs = create_package_set_from_installed()
missing, conflicting = check_package_set(package_set)
for project_name in missing:
version = package_set[project_name].version
Reported by Pylint.
Line: 42
Column: 9
project_name, version, req, dep_name, dep_version,
)
if missing or conflicting or parsing_probs:
return 1
else:
write_output("No broken requirements found.")
Reported by Pylint.