mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Apply vendoring.update script.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
Copyright (C) 2016 Jason R Coombs <jaraco@jaraco.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ __all__ = [
|
||||
"Lockfile", "Pipfile",
|
||||
]
|
||||
|
||||
__version__ = '0.3.1'
|
||||
__version__ = '0.4.0'
|
||||
|
||||
from .lockfiles import Lockfile
|
||||
from .pipfiles import Pipfile
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ from .models.lockfile import Lockfile
|
||||
from .models.pipfile import Pipfile
|
||||
from .models.requirements import Requirement
|
||||
|
||||
__version__ = "2.0.3"
|
||||
__version__ = "2.1.0"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+4
-9
@@ -22,12 +22,7 @@ from pipenv.vendor.vistir.contextmanagers import temp_environ
|
||||
from pipenv.vendor.vistir.path import create_tracked_tempdir
|
||||
|
||||
from ..environment import MYPY_RUNNING
|
||||
from ..utils import (
|
||||
_ensure_dir,
|
||||
get_package_finder,
|
||||
get_pip_command,
|
||||
prepare_pip_source_args,
|
||||
)
|
||||
from ..utils import get_package_finder, get_pip_command, prepare_pip_source_args
|
||||
from .cache import CACHE_DIR, DependencyCache
|
||||
from .setup_info import SetupInfo
|
||||
from .utils import (
|
||||
@@ -564,7 +559,7 @@ def get_pip_options(args=None, sources=None, pip_command=None):
|
||||
pip_command = get_pip_command()
|
||||
if not sources:
|
||||
sources = [{"url": "https://pypi.org/simple", "name": "pypi", "verify_ssl": True}]
|
||||
_ensure_dir(CACHE_DIR)
|
||||
os.makedirs(CACHE_DIR, mode=0o777, exist_ok=True)
|
||||
pip_args = args or []
|
||||
pip_args = prepare_pip_source_args(sources, pip_args)
|
||||
pip_options, _ = pip_command.parser.parse_args(pip_args)
|
||||
@@ -620,7 +615,7 @@ def start_resolver(finder=None, session=None, wheel_cache=None):
|
||||
session = pip_command._build_session(pip_options)
|
||||
|
||||
download_dir = PKGS_DOWNLOAD_DIR
|
||||
_ensure_dir(download_dir)
|
||||
os.makedir(download_dir, mode=0o777)
|
||||
|
||||
_build_dir = create_tracked_tempdir(fs_str("build"))
|
||||
_source_dir = create_tracked_tempdir(fs_str("source"))
|
||||
@@ -629,7 +624,7 @@ def start_resolver(finder=None, session=None, wheel_cache=None):
|
||||
with global_tempdir_manager(), get_build_tracker() as build_tracker:
|
||||
if not wheel_cache:
|
||||
wheel_cache = _get_wheel_cache()
|
||||
_ensure_dir(str(os.path.join(wheel_cache.cache_dir, "wheels")))
|
||||
os.makdirs(os.path.join(wheel_cache.cache_dir, "wheels"))
|
||||
preparer = pip_command.make_requirement_preparer(
|
||||
temp_build_dir=_build_dir,
|
||||
options=pip_options,
|
||||
|
||||
+17
-4
@@ -262,8 +262,8 @@ class Lockfile(object):
|
||||
section.
|
||||
|
||||
:param bool dev: Indicates whether to use dev requirements, defaults to False
|
||||
:return: Requirements from the relevant the relevant pipfile
|
||||
:rtype: :class:`~requirementslib.models.requirements.Requirement`
|
||||
:return: Requirements from the relevant pipfile
|
||||
:rtype: :class:`Iterator[~requirementslib.models.requirements.Requirement]`
|
||||
"""
|
||||
if categories:
|
||||
deps = {}
|
||||
@@ -285,10 +285,23 @@ class Lockfile(object):
|
||||
|
||||
def requirements_list(self, category):
|
||||
if self._lockfile.get(category):
|
||||
return [{name: entry._data} for name, entry in self._lockfile[category].items()]
|
||||
return [
|
||||
{name: entry._data} for name, entry in self._lockfile[category].items()
|
||||
]
|
||||
return []
|
||||
|
||||
def as_requirements(self, category, include_hashes=False):
|
||||
"""Returns a list of requirements in pip-style format."""
|
||||
lines = []
|
||||
section = list(self.get_requirements(categories=[category]))
|
||||
for req in section:
|
||||
kwargs = {"include_hashes": include_hashes}
|
||||
if req.editable:
|
||||
kwargs["include_markers"] = False
|
||||
r = req.as_line(**kwargs)
|
||||
lines.append(r.strip())
|
||||
return lines
|
||||
|
||||
def write(self):
|
||||
self.projectfile.model = copy.deepcopy(self._lockfile)
|
||||
self.projectfile.write()
|
||||
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
import pipenv.vendor.attr as attr
|
||||
from pipenv.vendor.plette import pipfiles
|
||||
import pipenv.vendor.tomlkit as tomlkit
|
||||
from pipenv.vendor.plette import pipfiles
|
||||
|
||||
from ..environment import MYPY_RUNNING
|
||||
from ..exceptions import RequirementError
|
||||
|
||||
+1
-2
@@ -38,7 +38,6 @@ from pipenv.vendor.vistir.path import (
|
||||
get_converted_relative_path,
|
||||
is_file_url,
|
||||
is_valid_url,
|
||||
mkdir_p,
|
||||
normalize_path,
|
||||
)
|
||||
|
||||
@@ -2123,7 +2122,7 @@ class VCSRequirement(FileRequirement):
|
||||
return checkout_dir
|
||||
if src_dir is not None:
|
||||
checkout_dir = os.path.join(os.path.abspath(src_dir), self.name)
|
||||
mkdir_p(src_dir)
|
||||
os.makedirs(src_dir, exist_ok=True)
|
||||
return checkout_dir
|
||||
return os.path.join(create_tracked_tempdir(prefix="requirementslib"), self.name)
|
||||
|
||||
|
||||
+5
-4
@@ -31,7 +31,7 @@ from pipenv.patched.pip._vendor.pkg_resources import (
|
||||
from pipenv.vendor.platformdirs import user_cache_dir
|
||||
from pipenv.vendor.vistir.contextmanagers import cd, temp_path
|
||||
from pipenv.vendor.vistir.misc import run
|
||||
from pipenv.vendor.vistir.path import create_tracked_tempdir, ensure_mkdir_p, mkdir_p, rmtree
|
||||
from pipenv.vendor.vistir.path import create_tracked_tempdir, rmtree
|
||||
|
||||
from ..environment import MYPY_RUNNING
|
||||
from ..exceptions import RequirementError
|
||||
@@ -559,7 +559,6 @@ def build_pep517(source_dir, build_dir, config_settings=None, dist_type="wheel")
|
||||
return build_fn(build_dir, config_settings)
|
||||
|
||||
|
||||
@ensure_mkdir_p(mode=0o775)
|
||||
def _get_src_dir(root):
|
||||
# type: (AnyStr) -> AnyStr
|
||||
src = os.environ.get("PIP_SRC")
|
||||
@@ -573,6 +572,8 @@ def _get_src_dir(root):
|
||||
src_dir = create_tracked_tempdir(prefix="requirementslib-", suffix="-src")
|
||||
else:
|
||||
src_dir = os.path.join(root, "src")
|
||||
|
||||
os.makedirs(src_dir, mode=0o775)
|
||||
return src_dir
|
||||
|
||||
|
||||
@@ -613,10 +614,10 @@ def _prepare_wheel_building_kwargs(
|
||||
):
|
||||
# type: (...) -> Dict[STRING_TYPE, STRING_TYPE]
|
||||
download_dir = os.path.join(CACHE_DIR, "pkgs") # type: STRING_TYPE
|
||||
mkdir_p(download_dir)
|
||||
os.makedirs(download_dir, exist_ok=True)
|
||||
|
||||
wheel_download_dir = os.path.join(CACHE_DIR, "wheels") # type: STRING_TYPE
|
||||
mkdir_p(wheel_download_dir)
|
||||
os.makedirs(wheel_download_dir, exist_ok=True)
|
||||
if src_dir is None:
|
||||
if editable and src_root is not None:
|
||||
src_dir = src_root
|
||||
|
||||
+1
-6
@@ -12,7 +12,7 @@ from pipenv.patched.pip._internal.models.target_python import TargetPython
|
||||
from pipenv.patched.pip._internal.utils.filetypes import is_archive_file
|
||||
from pipenv.patched.pip._internal.utils.misc import is_installable_dir
|
||||
from pipenv.patched.pip._vendor.packaging import specifiers
|
||||
from pipenv.vendor.vistir.path import ensure_mkdir_p, is_valid_url
|
||||
from pipenv.vendor.vistir.path import is_valid_url
|
||||
|
||||
from .environment import MYPY_RUNNING
|
||||
|
||||
@@ -292,11 +292,6 @@ def get_package_finder(
|
||||
)
|
||||
|
||||
|
||||
@ensure_mkdir_p(mode=0o777)
|
||||
def _ensure_dir(path):
|
||||
return path
|
||||
|
||||
|
||||
_UNSET = object()
|
||||
_REMAP_EXIT = object()
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ LIBRARY_RENAMES = {
|
||||
"packaging": "pipenv.patched.pip._vendor.packaging",
|
||||
"pep517": "pipenv.patched.pip._vendor.pep517",
|
||||
"pkg_resources": "pipenv.patched.pip._vendor.pkg_resources",
|
||||
"plette": "pipenv.vendor.plette",
|
||||
"urllib3": "pipenv.patched.pip._vendor.urllib3",
|
||||
"zipp": "pipenv.vendor.zipp",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user