The following issues were found
tests/conftest.py
4 issues
Line: 1
Column: 1
import pytest
@pytest.fixture()
def project():
from pipenv.project import Project
return Project()
Reported by Pylint.
Line: 1
Column: 1
import pytest
@pytest.fixture()
def project():
from pipenv.project import Project
return Project()
Reported by Pylint.
Line: 5
Column: 1
@pytest.fixture()
def project():
from pipenv.project import Project
return Project()
Reported by Pylint.
Line: 6
Column: 5
@pytest.fixture()
def project():
from pipenv.project import Project
return Project()
Reported by Pylint.
pipenv/vendor/pep517/dirtools.py
4 issues
Line: 1
Column: 1
import os
import io
import contextlib
import tempfile
import shutil
import errno
import zipfile
Reported by Pylint.
Line: 13
Column: 5
@contextlib.contextmanager
def tempdir():
"""Create a temporary directory in a context manager."""
td = tempfile.mkdtemp()
try:
yield td
finally:
shutil.rmtree(td)
Reported by Pylint.
Line: 20
Column: 1
shutil.rmtree(td)
def mkdir_p(*args, **kwargs):
"""Like `mkdir`, but does not raise an exception if the
directory already exists.
"""
try:
return os.mkdir(*args, **kwargs)
Reported by Pylint.
Line: 35
Column: 9
"""Construct an in-memory zip file for a directory."""
buffer = io.BytesIO()
zip_file = zipfile.ZipFile(buffer, 'w')
for root, dirs, files in os.walk(root):
for path in dirs:
fs_path = os.path.join(root, path)
rel_path = os.path.relpath(fs_path, root)
zip_file.writestr(rel_path + '/', '')
for path in files:
Reported by Pylint.
pipenv/vendor/yaspin/api.py
4 issues
Line: 13
Column: 1
import signal
from .core import Yaspin
from .signal_handlers import default_handler
def yaspin(*args, **kwargs):
"""Display spinner in stdout.
Reported by Pylint.
Line: 14
Column: 1
import signal
from .core import Yaspin
from .signal_handlers import default_handler
def yaspin(*args, **kwargs):
"""Display spinner in stdout.
Reported by Pylint.
Line: 81
Column: 1
return Yaspin(*args, **kwargs)
def kbi_safe_yaspin(*args, **kwargs):
kwargs["sigmap"] = {signal.SIGINT: default_handler}
return Yaspin(*args, **kwargs)
# Handle PYTHONOPTIMIZE=2 case, when docstrings are set to None.
Reported by Pylint.
Line: 88
Column: 5
# Handle PYTHONOPTIMIZE=2 case, when docstrings are set to None.
if yaspin.__doc__:
_kbi_safe_doc = yaspin.__doc__.replace("yaspin", "kbi_safe_yaspin")
kbi_safe_yaspin.__doc__ = _kbi_safe_doc
Reported by Pylint.
pipenv/patched/notpip/_internal/pep425tags.py
4 issues
Line: 80
Column: 28
def _get_custom_platforms(arch):
# type: (str) -> List[str]
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
if arch.startswith('macosx'):
arches = _mac_platforms(arch)
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
arches = _custom_manylinux_platforms(arch)
else:
Reported by Pylint.
Line: 80
Column: 18
def _get_custom_platforms(arch):
# type: (str) -> List[str]
arch_prefix, arch_sep, arch_suffix = arch.partition('_')
if arch.startswith('macosx'):
arches = _mac_platforms(arch)
elif arch_prefix in ['manylinux2014', 'manylinux2010']:
arches = _custom_manylinux_platforms(arch)
else:
Reported by Pylint.
Line: 29
Column: 1
_osx_arch_pat = re.compile(r'(.+)_(\d+)_(\d+)_(.+)')
def version_info_to_nodot(version_info):
# type: (Tuple[int, ...]) -> str
# Only use up to the first two numbers.
return ''.join(map(str, version_info[:2]))
Reported by Pylint.
Line: 92
Column: 5
def _get_python_version(version):
# type: (str) -> PythonVersion
if len(version) > 1:
return int(version[0]), int(version[1:])
else:
return (int(version[0]),)
Reported by Pylint.
pipenv/vendor/orderedmultidict/__init__.py
4 issues
Line: 15
Column: 1
from os.path import dirname, join as pjoin
from .orderedmultidict import * # noqa
# Import all variables in __version__.py without explicit imports.
meta = {}
with open(pjoin(dirname(__file__), '__version__.py')) as f:
exec(f.read(), meta)
Reported by Pylint.
Line: 20
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
# Import all variables in __version__.py without explicit imports.
meta = {}
with open(pjoin(dirname(__file__), '__version__.py')) as f:
exec(f.read(), meta)
globals().update(dict((k, v) for k, v in meta.items() if k not in globals()))
Reported by Bandit.
Line: 20
Column: 5
# Import all variables in __version__.py without explicit imports.
meta = {}
with open(pjoin(dirname(__file__), '__version__.py')) as f:
exec(f.read(), meta)
globals().update(dict((k, v) for k, v in meta.items() if k not in globals()))
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
#
# omdict - Ordered Multivalue Dictionary.
#
# Ansgar Grunseid
# grunseid.com
# grunseid@gmail.com
#
Reported by Pylint.
pipenv/patched/notpip/_vendor/urllib3/filepost.py
4 issues
Line: 8
Column: 1
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup("utf-8")[3]
Reported by Pylint.
Line: 9
Column: 1
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup("utf-8")[3]
Reported by Pylint.
Line: 10
Column: 1
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup("utf-8")[3]
def choose_boundary():
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import binascii
import codecs
import os
from io import BytesIO
from .packages import six
from .packages.six import b
Reported by Pylint.
pipenv/vendor/urllib3/fields.py
4 issues
Line: 7
Column: 1
import mimetypes
import re
from .packages import six
def guess_content_type(filename, default="application/octet-stream"):
"""
Guess the "Content-Type" of a file.
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import email.utils
import mimetypes
import re
from .packages import six
Reported by Pylint.
Line: 126
Column: 1
format_header_param = format_header_param_html5
class RequestField(object):
"""
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
Reported by Pylint.
Line: 143
Column: 5
default, this is :func:`format_header_param_html5`.
"""
def __init__(
self,
name,
data,
filename=None,
headers=None,
Reported by Pylint.
pipenv/patched/notpip/_internal/commands/hash.py
4 issues
Line: 55
Column: 9
def _hash_of_file(path, algorithm):
"""Return the hash digest of a file."""
with open(path, 'rb') as archive:
hash = hashlib.new(algorithm)
for chunk in read_chunks(archive):
hash.update(chunk)
return hash.hexdigest()
Reported by Pylint.
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 hashlib
import logging
import sys
Reported by Pylint.
Line: 30
Column: 9
ignore_require_venv = True
def __init__(self, *args, **kw):
super(HashCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-a', '--algorithm',
dest='algorithm',
choices=STRONG_HASHES,
action='store',
Reported by Pylint.
Line: 41
Column: 5
', '.join(STRONG_HASHES))
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
if not args:
self.parser.print_usage(sys.stderr)
return ERROR
algorithm = options.algorithm
Reported by Pylint.
pipenv/patched/notpip/_vendor/chardet/compat.py
4 issues
Line: 28
Column: 22
if sys.version_info < (3, 0):
PY2 = True
PY3 = False
base_str = (str, unicode)
text_type = unicode
else:
PY2 = False
PY3 = True
base_str = (bytes, str)
Reported by Pylint.
Line: 29
Column: 17
PY2 = True
PY3 = False
base_str = (str, unicode)
text_type = unicode
else:
PY2 = False
PY3 = True
base_str = (bytes, str)
text_type = str
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Dan Blanchard
# Ian Cordasco
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
Reported by Pylint.
Line: 34
Column: 5
PY2 = False
PY3 = True
base_str = (bytes, str)
text_type = str
Reported by Pylint.
pipenv/vendor/yarg/__init__.py
4 issues
Line: 49
Column: 1
"""
from .client import get
from .exceptions import HTTPError
from .package import json2package
from .parse import (newest_packages, latest_updated_packages)
Reported by Pylint.
Line: 50
Column: 1
from .client import get
from .exceptions import HTTPError
from .package import json2package
from .parse import (newest_packages, latest_updated_packages)
__all__ = ['get', 'HTTPError', 'json2package', 'newest_packages',
Reported by Pylint.
Line: 51
Column: 1
from .client import get
from .exceptions import HTTPError
from .package import json2package
from .parse import (newest_packages, latest_updated_packages)
__all__ = ['get', 'HTTPError', 'json2package', 'newest_packages',
'latest_updated_packages', ]
Reported by Pylint.
Line: 52
Column: 1
from .client import get
from .exceptions import HTTPError
from .package import json2package
from .parse import (newest_packages, latest_updated_packages)
__all__ = ['get', 'HTTPError', 'json2package', 'newest_packages',
'latest_updated_packages', ]
Reported by Pylint.