The following issues were found
pipenv/vendor/pep517/check.py
23 issues
Line: 15
Column: 1
from tempfile import mkdtemp
import zipfile
from .colorlog import enable_colourful_output
from .compat import TOMLDecodeError, toml_load
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 16
Column: 1
import zipfile
from .colorlog import enable_colourful_output
from .compat import TOMLDecodeError, toml_load
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 17
Column: 1
from .colorlog import enable_colourful_output
from .compat import TOMLDecodeError, toml_load
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
log = logging.getLogger(__name__)
Reported by Pylint.
Line: 18
Column: 1
from .colorlog import enable_colourful_output
from .compat import TOMLDecodeError, toml_load
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
log = logging.getLogger(__name__)
def check_build_sdist(hooks, build_sys_requires):
Reported by Pylint.
Line: 35
Column: 16
try:
reqs = hooks.get_requires_for_build_sdist({})
log.info('Got build requires: %s', reqs)
except Exception:
log.error('Failure in get_requires_for_build_sdist', exc_info=True)
return False
try:
env.pip_install(reqs)
Reported by Pylint.
Line: 52
Column: 20
try:
filename = hooks.build_sdist(td, {})
log.info('build_sdist returned %r', filename)
except Exception:
log.info('Failure in build_sdist', exc_info=True)
return False
if not filename.endswith('.tar.gz'):
log.error(
Reported by Pylint.
Line: 92
Column: 16
try:
reqs = hooks.get_requires_for_build_wheel({})
log.info('Got build requires: %s', reqs)
except Exception:
log.error('Failure in get_requires_for_build_sdist', exc_info=True)
return False
try:
env.pip_install(reqs)
Reported by Pylint.
Line: 109
Column: 20
try:
filename = hooks.build_wheel(td, {})
log.info('build_wheel returned %r', filename)
except Exception:
log.info('Failure in build_wheel', exc_info=True)
return False
if not filename.endswith('.whl'):
log.error("Filename %s doesn't have .whl extension", filename)
Reported by Pylint.
Line: 9
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
import os
from os.path import isfile, join as pjoin
import shutil
from subprocess import CalledProcessError
import sys
import tarfile
from tempfile import mkdtemp
import zipfile
Reported by Bandit.
Line: 23
Column: 1
log = logging.getLogger(__name__)
def check_build_sdist(hooks, build_sys_requires):
with BuildEnvironment() as env:
try:
env.pip_install(build_sys_requires)
log.info('Installed static build dependencies')
except CalledProcessError:
Reported by Pylint.
pipenv/vendor/dotenv/parser.py
23 issues
Line: 3
Column: 1
import codecs
import re
from typing import (IO, Iterator, Match, NamedTuple, Optional, # noqa:F401
Pattern, Sequence, Tuple)
def make_regex(string: str, extra_flags: int = 0) -> Pattern[str]:
return re.compile(string, re.UNICODE | extra_flags)
Reported by Pylint.
Line: 1
Column: 1
import codecs
import re
from typing import (IO, Iterator, Match, NamedTuple, Optional, # noqa:F401
Pattern, Sequence, Tuple)
def make_regex(string: str, extra_flags: int = 0) -> Pattern[str]:
return re.compile(string, re.UNICODE | extra_flags)
Reported by Pylint.
Line: 7
Column: 1
Pattern, Sequence, Tuple)
def make_regex(string: str, extra_flags: int = 0) -> Pattern[str]:
return re.compile(string, re.UNICODE | extra_flags)
_newline = make_regex(r"(\r\n|\n|\r)")
_multiline_whitespace = make_regex(r"\s*", extra_flags=re.MULTILINE)
Reported by Pylint.
Line: 47
Column: 1
)
class Position:
def __init__(self, chars: int, line: int) -> None:
self.chars = chars
self.line = line
@classmethod
Reported by Pylint.
Line: 53
Column: 5
self.line = line
@classmethod
def start(cls) -> "Position":
return cls(chars=0, line=1)
def set(self, other: "Position") -> None:
self.chars = other.chars
self.line = other.line
Reported by Pylint.
Line: 56
Column: 5
def start(cls) -> "Position":
return cls(chars=0, line=1)
def set(self, other: "Position") -> None:
self.chars = other.chars
self.line = other.line
def advance(self, string: str) -> None:
self.chars += len(string)
Reported by Pylint.
Line: 60
Column: 5
self.chars = other.chars
self.line = other.line
def advance(self, string: str) -> None:
self.chars += len(string)
self.line += len(re.findall(_newline, string))
class Error(Exception):
Reported by Pylint.
Line: 65
Column: 1
self.line += len(re.findall(_newline, string))
class Error(Exception):
pass
class Reader:
def __init__(self, stream: IO[str]) -> None:
Reported by Pylint.
Line: 69
Column: 1
pass
class Reader:
def __init__(self, stream: IO[str]) -> None:
self.string = stream.read()
self.position = Position.start()
self.mark = Position.start()
Reported by Pylint.
Line: 75
Column: 5
self.position = Position.start()
self.mark = Position.start()
def has_next(self) -> bool:
return self.position.chars < len(self.string)
def set_mark(self) -> None:
self.mark.set(self.position)
Reported by Pylint.
pipenv/vendor/plette/models/sections.py
23 issues
Line: 1
Column: 1
from .base import DataView, DataViewMapping, DataViewSequence
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 2
Column: 1
from .base import DataView, DataViewMapping, DataViewSequence
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 3
Column: 1
from .base import DataView, DataViewMapping, DataViewSequence
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 4
Column: 1
from .base import DataView, DataViewMapping, DataViewSequence
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 5
Column: 1
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 39
Column: 13
try:
return self._data["python_version"]
except KeyError:
raise AttributeError("python_version")
@property
def python_full_version(self):
try:
return self._data["python_full_version"]
Reported by Pylint.
Line: 46
Column: 13
try:
return self._data["python_full_version"]
except KeyError:
raise AttributeError("python_full_version")
META_SECTIONS = {
"hash": Hash,
"requires": Requires,
Reported by Pylint.
Line: 1
Column: 1
from .base import DataView, DataViewMapping, DataViewSequence
from .hashes import Hash
from .packages import Package
from .scripts import Script
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
Reported by Pylint.
Line: 8
Column: 1
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
class ScriptCollection(DataViewMapping):
item_class = Script
Reported by Pylint.
Line: 8
Column: 1
from .sources import Source
class PackageCollection(DataViewMapping):
item_class = Package
class ScriptCollection(DataViewMapping):
item_class = Script
Reported by Pylint.
pipenv/patched/notpip/_vendor/pytoml/utils.py
23 issues
Line: 1
Column: 1
import datetime
import re
rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
def parse_rfc3339(v):
m = rfc3339_re.match(v)
if not m or m.group(0) != v:
return None
Reported by Pylint.
Line: 4
Column: 1
import datetime
import re
rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
def parse_rfc3339(v):
m = rfc3339_re.match(v)
if not m or m.group(0) != v:
return None
Reported by Pylint.
Line: 6
Column: 1
rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
def parse_rfc3339(v):
m = rfc3339_re.match(v)
if not m or m.group(0) != v:
return None
return parse_rfc3339_re(m)
Reported by Pylint.
Line: 6
Column: 1
rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
def parse_rfc3339(v):
m = rfc3339_re.match(v)
if not m or m.group(0) != v:
return None
return parse_rfc3339_re(m)
Reported by Pylint.
Line: 7
Column: 5
rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))')
def parse_rfc3339(v):
m = rfc3339_re.match(v)
if not m or m.group(0) != v:
return None
return parse_rfc3339_re(m)
def parse_rfc3339_re(m):
Reported by Pylint.
Line: 12
Column: 1
return None
return parse_rfc3339_re(m)
def parse_rfc3339_re(m):
r = map(int, m.groups()[:6])
if m.group(7):
micro = float(m.group(7))
else:
micro = 0
Reported by Pylint.
Line: 12
Column: 1
return None
return parse_rfc3339_re(m)
def parse_rfc3339_re(m):
r = map(int, m.groups()[:6])
if m.group(7):
micro = float(m.group(7))
else:
micro = 0
Reported by Pylint.
Line: 13
Column: 5
return parse_rfc3339_re(m)
def parse_rfc3339_re(m):
r = map(int, m.groups()[:6])
if m.group(7):
micro = float(m.group(7))
else:
micro = 0
Reported by Pylint.
Line: 20
Column: 9
micro = 0
if m.group(8):
g = int(m.group(8), 10) * 60 + int(m.group(9), 10)
tz = _TimeZone(datetime.timedelta(0, g * 60))
else:
tz = _TimeZone(datetime.timedelta(0, 0))
y, m, d, H, M, S = r
Reported by Pylint.
Line: 21
Column: 9
if m.group(8):
g = int(m.group(8), 10) * 60 + int(m.group(9), 10)
tz = _TimeZone(datetime.timedelta(0, g * 60))
else:
tz = _TimeZone(datetime.timedelta(0, 0))
y, m, d, H, M, S = r
return datetime.datetime(y, m, d, H, M, S, int(micro * 1000000), tz)
Reported by Pylint.
pipenv/vendor/colorama/ansitowin32.py
23 issues
Line: 6
Column: 1
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
Reported by Pylint.
Line: 7
Column: 1
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
Reported by Pylint.
Line: 8
Column: 1
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
Reported by Pylint.
Line: 1
Column: 1
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
Reported by Pylint.
Line: 11
Column: 1
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
class StreamWrapper(object):
Reported by Pylint.
Line: 16
Column: 1
winterm = WinTerm()
class StreamWrapper(object):
'''
Wraps a stream (such as stdout), acting as a transparent proxy for all
attribute access apart from method 'write()', which is delegated to our
Converter instance.
'''
Reported by Pylint.
Line: 40
Column: 5
def __exit__(self, *args, **kwargs):
return self.__wrapped.__exit__(*args, **kwargs)
def write(self, text):
self.__convertor.write(text)
def isatty(self):
stream = self.__wrapped
if 'PYCHARM_HOSTED' in os.environ:
Reported by Pylint.
Line: 43
Column: 5
def write(self, text):
self.__convertor.write(text)
def isatty(self):
stream = self.__wrapped
if 'PYCHARM_HOSTED' in os.environ:
if stream is not None and (stream is sys.__stdout__ or stream is sys.__stderr__):
return True
try:
Reported by Pylint.
Line: 56
Column: 5
return stream_isatty()
@property
def closed(self):
stream = self.__wrapped
try:
return stream.closed
except AttributeError:
return True
Reported by Pylint.
Line: 64
Column: 1
return True
class AnsiToWin32(object):
'''
Implements a 'write()' method which, on Windows, will strip ANSI character
sequences from the text, and if outputting to a tty, will convert them into
win32 function calls.
'''
Reported by Pylint.
pipenv/vendor/tomlkit/exceptions.py
23 issues
Line: 210
Column: 41
class InvalidControlChar(ParseError):
def __init__(self, line, col, char, type): # type: (int, int, int, str) -> None
display_code = "\\u00"
if char < 16:
display_code += "0"
Reported by Pylint.
Line: 1
Column: 1
from __future__ import unicode_literals
from typing import Optional
class TOMLKitError(Exception):
pass
Reported by Pylint.
Line: 6
Column: 1
from typing import Optional
class TOMLKitError(Exception):
pass
class ParseError(ValueError, TOMLKitError):
Reported by Pylint.
Line: 27
Column: 9
if message is None:
message = "TOML parse error"
super(ParseError, self).__init__(
"{} at line {} col {}".format(message, self._line, self._col)
)
@property
def line(self):
Reported by Pylint.
Line: 32
Column: 5
)
@property
def line(self):
return self._line
@property
def col(self):
return self._col
Reported by Pylint.
Line: 36
Column: 5
return self._line
@property
def col(self):
return self._col
class MixedArrayTypesError(ParseError):
"""
Reported by Pylint.
Line: 48
Column: 9
def __init__(self, line, col): # type: (int, int) -> None
message = "Mixed types found in array"
super(MixedArrayTypesError, self).__init__(line, col, message=message)
class InvalidNumberError(ParseError):
"""
A numeric field was improperly specified.
Reported by Pylint.
Line: 59
Column: 9
def __init__(self, line, col): # type: (int, int) -> None
message = "Invalid number"
super(InvalidNumberError, self).__init__(line, col, message=message)
class InvalidDateTimeError(ParseError):
"""
A datetime field was improperly specified.
Reported by Pylint.
Line: 70
Column: 9
def __init__(self, line, col): # type: (int, int) -> None
message = "Invalid datetime"
super(InvalidDateTimeError, self).__init__(line, col, message=message)
class InvalidDateError(ParseError):
"""
A date field was improperly specified.
Reported by Pylint.
Line: 81
Column: 9
def __init__(self, line, col): # type: (int, int) -> None
message = "Invalid date"
super(InvalidDateError, self).__init__(line, col, message=message)
class InvalidTimeError(ParseError):
"""
A date field was improperly specified.
Reported by Pylint.
docs/conf.py
22 issues
Line: 25
Column: 5
about = {}
with open(os.path.join(here, "..", "pipenv", "__version__.py")) as f:
exec(f.read(), about)
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
Reported by Pylint.
Line: 25
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
about = {}
with open(os.path.join(here, "..", "pipenv", "__version__.py")) as f:
exec(f.read(), about)
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
Reported by Bandit.
Line: 59
Column: 1
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Reported by Pylint.
Line: 1
Column: 1
#
# pipenv documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 30 13:28:36 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
Reported by Pylint.
Line: 52
Column: 1
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
Reported by Pylint.
Line: 55
Column: 1
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
Reported by Pylint.
Line: 58
Column: 1
master_doc = 'index'
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Reported by Pylint.
Line: 59
Column: 1
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Reported by Pylint.
Line: 59
Column: 1
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Reported by Pylint.
Line: 60
Column: 1
# General information about the project.
project = 'pipenv'
copyright = '2020. A project founded by <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a>'
author = 'Python Packaging Authority'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
Reported by Pylint.
pipenv/vendor/pythonfinder/_vendor/pep514tools/_registry.py
22 issues
Line: 74
Column: 13
except KeyError:
pass
except Exception:
raise AttributeError(attr)
raise AttributeError(attr)
def __setattr__(self, attr, value):
if attr.startswith('_'):
return object.__setattr__(self, attr, value)
Reported by Pylint.
Line: 157
Column: 50
with winreg.CreateKeyEx(rootkey, name, 0, winreg.KEY_WRITE | self._flags) as key:
for k, v in info:
if isinstance(v, PythonWrappedDict):
self._set_all_values(key, k, v._items(), errors)
elif isinstance(v, dict):
self._set_all_values(key, k, v.items(), errors)
elif v is None:
winreg.DeleteValue(key, k)
elif isinstance(v, str):
Reported by Pylint.
Line: 170
Column: 21
def set_all_values(self, info):
errors = []
if isinstance(info, PythonWrappedDict):
items = info._items()
elif isinstance(info, dict):
items = info.items()
else:
raise TypeError('info must be a dictionary')
Reported by Pylint.
Line: 1
Column: 1
#-------------------------------------------------------------------------
# Copyright (c) Steve Dower
# All rights reserved.
#
# Distributed under the terms of the MIT License
#-------------------------------------------------------------------------
__all__ = ['open_source', 'REGISTRY_SOURCE_LM', 'REGISTRY_SOURCE_LM_WOW6432', 'REGISTRY_SOURCE_CU']
Reported by Pylint.
Line: 23
Column: 1
_REG_KEY_INFO = {
REGISTRY_SOURCE_LM: (winreg.HKEY_LOCAL_MACHINE, r'Software\Python', winreg.KEY_WOW64_64KEY),
REGISTRY_SOURCE_LM_WOW6432: (winreg.HKEY_LOCAL_MACHINE, r'Software\Python', winreg.KEY_WOW64_32KEY),
REGISTRY_SOURCE_CU: (winreg.HKEY_CURRENT_USER, r'Software\Python', 0),
}
def get_value_from_tuple(value, vtype):
if vtype == winreg.REG_SZ:
Reported by Pylint.
Line: 27
Column: 1
REGISTRY_SOURCE_CU: (winreg.HKEY_CURRENT_USER, r'Software\Python', 0),
}
def get_value_from_tuple(value, vtype):
if vtype == winreg.REG_SZ:
if '\0' in value:
return value[:value.index('\0')]
return value
return None
Reported by Pylint.
Line: 34
Column: 1
return value
return None
def join(x, y):
return x + '\\' + y
_VALID_ATTR = re.compile('^[a-z_]+$')
_VALID_KEY = re.compile('^[A-Za-z]+$')
_KEY_TO_ATTR = re.compile('([A-Z]+[a-z]+)')
Reported by Pylint.
Line: 34
Column: 1
return value
return None
def join(x, y):
return x + '\\' + y
_VALID_ATTR = re.compile('^[a-z_]+$')
_VALID_KEY = re.compile('^[A-Za-z]+$')
_KEY_TO_ATTR = re.compile('([A-Z]+[a-z]+)')
Reported by Pylint.
Line: 34
Column: 1
return value
return None
def join(x, y):
return x + '\\' + y
_VALID_ATTR = re.compile('^[a-z_]+$')
_VALID_KEY = re.compile('^[A-Za-z]+$')
_KEY_TO_ATTR = re.compile('([A-Z]+[a-z]+)')
Reported by Pylint.
Line: 41
Column: 1
_VALID_KEY = re.compile('^[A-Za-z]+$')
_KEY_TO_ATTR = re.compile('([A-Z]+[a-z]+)')
class PythonWrappedDict(object):
@staticmethod
def _attr_to_key(attr):
if not attr:
return ''
if not _VALID_ATTR.match(attr):
Reported by Pylint.
pipenv/patched/notpip/_internal/req/constructors.py
22 issues
Line: 48
Column: 13
]
logger = logging.getLogger(__name__)
operators = Specifier._operators.keys()
def is_archive_file(name):
# type: (str) -> bool
"""Return True if `name` is a considered as an archive file."""
Reported by Pylint.
Line: 175
Column: 13
" case, use the '-r' flag to install" + \
" the packages specified within it."
except RequirementParseError:
logger.debug("Cannot parse '%s' as requirements \
file" % (req), exc_info=True)
else:
msg += " File '%s' does not exist." % (req)
return msg
Reported by Pylint.
Line: 204
Column: 13
try:
req = Requirement(name)
except InvalidRequirement:
raise InstallationError("Invalid requirement: '%s'" % name)
else:
req = None
link = Link(url)
Reported by Pylint.
Line: 371
Column: 13
)
if add_msg:
msg += '\nHint: {}'.format(add_msg)
raise InstallationError(msg)
else:
req = None
return RequirementParts(req, link, markers, extras)
Reported by Pylint.
Line: 418
Column: 9
try:
req = Requirement(req_string)
except InvalidRequirement:
raise InstallationError("Invalid requirement: '%s'" % req_string)
domains_not_allowed = [
PyPI.file_storage_domain,
TestPyPI.file_storage_domain,
]
Reported by Pylint.
Line: 62
Column: 5
def _strip_extras(path):
# type: (str) -> Tuple[str, Optional[str]]
m = re.match(r'^(.+)(\[[^\]]+\])$', path)
extras = None
if m:
path_no_extras = m.group(1)
extras = m.group(2)
else:
Reported by Pylint.
Line: 73
Column: 1
return path_no_extras, extras
def convert_extras(extras):
# type: (Optional[str]) -> Set[str]
if not extras:
return set()
return Requirement("placeholder" + extras.lower()).extras
Reported by Pylint.
Line: 116
Column: 9
if url_no_extras.lower().startswith('file:'):
package_name = Link(url_no_extras).egg_fragment
if extras:
return (
package_name,
url_no_extras,
Requirement("placeholder" + extras.lower()).extras,
)
Reported by Pylint.
Line: 166
Column: 36
msg = " It does exist."
# Try to parse and check if it is a requirements file.
try:
with open(req, 'r') as fp:
# parse first line only
next(parse_requirements(fp.read()))
msg += " The argument you provided " + \
"(%s) appears to be a" % (req) + \
" requirements file. If that is the" + \
Reported by Pylint.
Line: 182
Column: 1
return msg
class RequirementParts(object):
def __init__(
self,
requirement, # type: Optional[Requirement]
link, # type: Optional[Link]
markers, # type: Optional[Marker]
Reported by Pylint.
pipenv/patched/notpip/_vendor/cachecontrol/serialize.py
22 issues
Line: 9
Column: 1
from pipenv.patched.notpip._vendor import msgpack
from pipenv.patched.notpip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_decode_bytes(b):
return base64.b64decode(b.encode("ascii"))
Reported by Pylint.
Line: 38
Column: 13
# result being a `body` argument is *always* passed
# into cache_response, and in turn,
# `Serializer.dump`.
response._fp = io.BytesIO(body)
# NOTE: This is all a bit weird, but it's really important that on
# Python 2.x these objects are unicode and not str, even when
# they contain only ascii. The problem here is that msgpack
# understands the difference between unicode and bytes and we
Reported by Pylint.
Line: 142
Column: 34
return HTTPResponse(body=body, preload_content=False, **cached["response"])
def _loads_v0(self, request, data):
# The original legacy cache data. This doesn't contain enough
# information to construct everything we need, so we'll treat this as
# a miss.
return
Reported by Pylint.
Line: 142
Column: 25
return HTTPResponse(body=body, preload_content=False, **cached["response"])
def _loads_v0(self, request, data):
# The original legacy cache data. This doesn't contain enough
# information to construct everything we need, so we'll treat this as
# a miss.
return
Reported by Pylint.
Line: 176
Column: 25
return self.prepare_response(request, cached)
def _loads_v3(self, request, data):
# Due to Python 2 encoding issues, it's impossible to know for sure
# exactly how to load v3 entries, thus we'll treat these as a miss so
# that they get rewritten out as v4 entries.
return
Reported by Pylint.
Line: 176
Column: 34
return self.prepare_response(request, cached)
def _loads_v3(self, request, data):
# Due to Python 2 encoding issues, it's impossible to know for sure
# exactly how to load v3 entries, thus we'll treat these as a miss so
# that they get rewritten out as v4 entries.
return
Reported by Pylint.
Line: 1
Column: 1
import base64
import io
import json
import zlib
from pipenv.patched.notpip._vendor import msgpack
from pipenv.patched.notpip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
Reported by Pylint.
Line: 12
Column: 1
from .compat import HTTPResponse, pickle, text_type
def _b64_decode_bytes(b):
return base64.b64decode(b.encode("ascii"))
def _b64_decode_str(s):
return _b64_decode_bytes(s).decode("utf8")
Reported by Pylint.
Line: 16
Column: 1
return base64.b64decode(b.encode("ascii"))
def _b64_decode_str(s):
return _b64_decode_bytes(s).decode("utf8")
class Serializer(object):
Reported by Pylint.
Line: 20
Column: 1
return _b64_decode_bytes(s).decode("utf8")
class Serializer(object):
def dumps(self, request, response, body=None):
response_headers = CaseInsensitiveDict(response.headers)
if body is None:
Reported by Pylint.