Update to 20.0.23 (#1742034)
This commit is contained in:
parent
3607f30fe3
commit
9aaabea1a7
@ -1,40 +1,48 @@
|
||||
Name: python-virtualenv
|
||||
Version: 16.7.10
|
||||
Release: 2%{?dist}
|
||||
Version: 20.0.23
|
||||
Release: 1%{?dist}
|
||||
Summary: Tool to create isolated Python environments
|
||||
|
||||
License: MIT
|
||||
URL: http://pypi.python.org/pypi/virtualenv
|
||||
Source0: %{pypi_source virtualenv}
|
||||
|
||||
# Add /usr/share/python-wheels to file_search_dirs
|
||||
# Add /usr/share/python-wheels to extra_search_dir
|
||||
Patch1: rpm-wheels.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: git-core
|
||||
|
||||
BuildRequires: python3-appdirs
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-distlib
|
||||
BuildRequires: python3-filelock
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-setuptools_scm
|
||||
BuildRequires: python3-six
|
||||
|
||||
# docs need sphinx >= 3
|
||||
# docs need towncrier and that is not yet available when bootstrapping Python
|
||||
%bcond_without docs
|
||||
%bcond_with docs
|
||||
%if %{with docs}
|
||||
BuildRequires: python3-sphinx
|
||||
BuildRequires: python3-sphinx_rtd_theme
|
||||
BuildRequires: python3-towncrier
|
||||
%endif
|
||||
|
||||
# we don't have all the dependencies
|
||||
# some tests also need internet connection
|
||||
%bcond_with tests
|
||||
%bcond_without tests
|
||||
%if %{with tests}
|
||||
BuildRequires: fish
|
||||
BuildRequires: gcc
|
||||
BuildRequires: python3-coverage
|
||||
BuildRequires: python3-flaky
|
||||
BuildRequires: python3-packaging
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: python3-pytest-xdist
|
||||
BuildRequires: csh
|
||||
BuildRequires: fish
|
||||
#BuildRequires: xonsh -- the xonsh tests are failing :(
|
||||
#BuildRequires: python3-pypiserver -- not available yet
|
||||
#BuildRequires: python3-pytest-localserver -- not available yet
|
||||
BuildRequires: python3-pytest-mock
|
||||
BuildRequires: python3-pytest-randomly
|
||||
BuildRequires: python3-pytest-timeout
|
||||
# FTBFS with Py 3.9: https://bugzilla.redhat.com/show_bug.cgi?id=1817770
|
||||
# BuildRequires: xonsh
|
||||
%endif
|
||||
|
||||
# RPM installed wheels
|
||||
@ -52,7 +60,11 @@ licensed under an MIT-style permissive license.
|
||||
%package -n python3-virtualenv
|
||||
Summary: Tool to create isolated Python environments
|
||||
|
||||
Requires: python3-appdirs
|
||||
Requires: python3-distlib
|
||||
Requires: python3-filelock
|
||||
Requires: python3-setuptools
|
||||
Requires: python3-six
|
||||
Obsoletes: python3-virtualenv-python26 < 16.6
|
||||
%{?python_provide:%python_provide python3-virtualenv}
|
||||
|
||||
@ -81,16 +93,15 @@ Documentation for python virtualenv.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -S git -n virtualenv-%{version}
|
||||
%{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py
|
||||
%autosetup -p1 -n virtualenv-%{version}
|
||||
%{__sed} -i -e "1s|#!/usr/bin/env python||" tasks/update_embedded.py
|
||||
|
||||
# Remove the wheels provided by RPM packages
|
||||
# Those are the "recent" version shipped with virtualenv 16.6.1
|
||||
rm virtualenv_support/pip-*
|
||||
rm virtualenv_support/setuptools-*
|
||||
rm virtualenv_support/wheel-*
|
||||
rm src/virtualenv/seed/embed/wheels/pip-*
|
||||
rm src/virtualenv/seed/embed/wheels/setuptools-*
|
||||
rm src/virtualenv/seed/embed/wheels/wheel-*
|
||||
|
||||
test ! -f virtualenv_support/*.whl
|
||||
test ! -f src/virtualenv/seed/embed/wheels/*.whl
|
||||
|
||||
%build
|
||||
# Build code
|
||||
@ -98,7 +109,7 @@ test ! -f virtualenv_support/*.whl
|
||||
|
||||
# Build docs
|
||||
%if %{with docs}
|
||||
%{__python3} setup.py build_sphinx
|
||||
PYTHONPATH=src %{python3} setup.py build_sphinx
|
||||
rm -f build/sphinx/html/.buildinfo
|
||||
%endif
|
||||
|
||||
@ -110,28 +121,31 @@ rm -f build/sphinx/html/.buildinfo
|
||||
mkdir tmp_path
|
||||
ln -s $(realpath %{__python3}) tmp_path/python
|
||||
export PATH="$(pwd)/tmp_path:$PATH"
|
||||
export PYTHONPATH="$(pwd)"
|
||||
unset SOURCE_DATE_EPOCH
|
||||
cp -p /usr/share/python-wheels/*.whl virtualenv_support
|
||||
|
||||
# test_missing_certifi_pem patches bundled pip wheel, but ours is patched already
|
||||
# test_always_copy_option https://github.com/pypa/virtualenv/issues/1332
|
||||
python -m pytest -vv -n auto -k "not test_missing_certifi_pem and not test_always_copy_option"
|
||||
# Skip tests which requires internet or some extra dependencies
|
||||
# Requires internet:
|
||||
# - test_base_bootstrap_via_pip_invoke
|
||||
# - test_seed_link_via_app_data
|
||||
# Detects system Python even it should not (problem with mock?):
|
||||
# - test_py_info_to_system_raises
|
||||
# Uses disabled functionalities around bundled wheels:
|
||||
# - test_wheel_support_no_python_requires
|
||||
# Requires xonsh (FTBFS with Py 3.9)
|
||||
# - test_xonsh
|
||||
# Does not work with beta release of Python:
|
||||
# - test_version_satisfies_nok
|
||||
%pytest -vv -k "not test_base_bootstrap_via_pip_invoke and not test_seed_link_via_app_data and not test_py_info_to_system_raises and not test_wheel_support_no_python_requires and not test_xonsh and not test_version_satisfies_nok"
|
||||
|
||||
rm virtualenv_support/*.whl
|
||||
rm -r tmp_path
|
||||
%endif
|
||||
|
||||
%files -n python3-virtualenv
|
||||
%license LICENSE.txt
|
||||
%doc docs/*rst PKG-INFO AUTHORS.txt
|
||||
%license LICENSE
|
||||
%doc docs/*rst README.md
|
||||
%{_bindir}/virtualenv
|
||||
%{python3_sitelib}/virtualenv.py
|
||||
%dir %{python3_sitelib}/virtualenv_support/
|
||||
%{python3_sitelib}/virtualenv_support/__init__.py
|
||||
%{python3_sitelib}/virtualenv_support/__pycache__/
|
||||
%{python3_sitelib}/virtualenv/
|
||||
%{python3_sitelib}/virtualenv-*.egg-info/
|
||||
%{python3_sitelib}/__pycache__/*
|
||||
|
||||
%if %{with docs}
|
||||
%files -n python-virtualenv-doc
|
||||
@ -140,6 +154,9 @@ rm -r tmp_path
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jun 15 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.23-1
|
||||
- Update to 20.0.23 (#1742034)
|
||||
|
||||
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 16.7.10-2
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
|
231
rpm-wheels.patch
231
rpm-wheels.patch
@ -1,50 +1,187 @@
|
||||
diff --git a/virtualenv.py b/virtualenv.py
|
||||
index c7f71e6..3740014 100755
|
||||
--- a/virtualenv.py
|
||||
+++ b/virtualenv.py
|
||||
@@ -475,7 +475,18 @@ def virtualenv_support_dirs():
|
||||
From fd3e105dde6f4c14b4d85a325cd70c79d7b452cc Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
Date: Fri, 22 May 2020 14:25:48 +0200
|
||||
Subject: [PATCH] rpm wheels
|
||||
|
||||
# normal filesystem installation
|
||||
if os.path.isdir(join(HERE, "virtualenv_support")):
|
||||
- yield [join(HERE, "virtualenv_support")]
|
||||
+ dirs = [join(HERE, "virtualenv_support")]
|
||||
+ if os.path.isdir("/usr/share/python-wheels"):
|
||||
+ dirs.insert(0, "/usr/share/python-wheels")
|
||||
+ try:
|
||||
+ import ensurepip
|
||||
+ ensurepip_path = os.path.join(ensurepip.__path__[0], "_bundled")
|
||||
+ except (ImportError, AttributeError, IndexError):
|
||||
+ pass
|
||||
+ else:
|
||||
+ if os.path.isdir(ensurepip_path):
|
||||
+ dirs.insert(0, ensurepip_path)
|
||||
+ yield dirs
|
||||
elif IS_ZIPAPP:
|
||||
tmpdir = tempfile.mkdtemp()
|
||||
try:
|
||||
@@ -998,6 +998,8 @@ def find_wheels(projects, search_dirs):
|
||||
)
|
||||
if project == "pip" and sys.version_info[0:2] == (3, 4):
|
||||
wheel = next(p for v, p in versions if v <= (19, 1, 1))
|
||||
+ elif project == "setuptools" and sys.version_info[0:2] == (3, 4):
|
||||
+ wheel = next(p for v, p in versions if v < (44,))
|
||||
else:
|
||||
wheel = versions[0][1]
|
||||
wheels.append(wheel)
|
||||
@@ -1091,9 +1093,13 @@ def _install_wheel_with_search_dir(download, project_names, py_executable, searc
|
||||
)
|
||||
).encode("utf8")
|
||||
---
|
||||
src/virtualenv/seed/embed/base_embed.py | 5 ++++
|
||||
src/virtualenv/seed/embed/pip_invoke.py | 5 ++--
|
||||
src/virtualenv/seed/embed/wheels/__init__.py | 3 +++
|
||||
src/virtualenv/seed/embed/wheels/acquire.py | 24 ++++++++++++-------
|
||||
.../seed/via_app_data/via_app_data.py | 1 +
|
||||
src/virtualenv/util/path/_system_wheels.py | 22 +++++++++++++++++
|
||||
6 files changed, 49 insertions(+), 11 deletions(-)
|
||||
create mode 100644 src/virtualenv/util/path/_system_wheels.py
|
||||
|
||||
- if sys.version_info[0:2] == (3, 4) and "pip" in project_names:
|
||||
- at = project_names.index("pip")
|
||||
- project_names[at] = "pip<19.2"
|
||||
+ if sys.version_info[0:2] == (3, 4):
|
||||
+ if "pip" in project_names:
|
||||
+ at = project_names.index("pip")
|
||||
+ project_names[at] = "pip<19.2"
|
||||
+ if "setuptools" in project_names:
|
||||
+ at = project_names.index("setuptools")
|
||||
+ project_names[at] = "setuptools<44"
|
||||
diff --git a/src/virtualenv/seed/embed/base_embed.py b/src/virtualenv/seed/embed/base_embed.py
|
||||
index bffd494..349e5ff 100644
|
||||
--- a/src/virtualenv/seed/embed/base_embed.py
|
||||
+++ b/src/virtualenv/seed/embed/base_embed.py
|
||||
@@ -6,6 +6,7 @@ from six import add_metaclass
|
||||
|
||||
from virtualenv.util.path import Path
|
||||
from virtualenv.util.six import ensure_str, ensure_text
|
||||
+from virtualenv.util.path._system_wheels import get_system_wheels_paths
|
||||
|
||||
from ..seeder import Seeder
|
||||
|
||||
@@ -101,3 +102,7 @@ class BaseEmbed(Seeder):
|
||||
|
||||
def __repr__(self):
|
||||
return ensure_str(self.__unicode__())
|
||||
+
|
||||
+ def insert_system_wheels_paths(self, creator):
|
||||
+ system_wheels_paths = get_system_wheels_paths(creator.interpreter.executable)
|
||||
+ self.extra_search_dir = list(system_wheels_paths) + self.extra_search_dir
|
||||
diff --git a/src/virtualenv/seed/embed/pip_invoke.py b/src/virtualenv/seed/embed/pip_invoke.py
|
||||
index 25be493..f49a420 100644
|
||||
--- a/src/virtualenv/seed/embed/pip_invoke.py
|
||||
+++ b/src/virtualenv/seed/embed/pip_invoke.py
|
||||
@@ -23,8 +23,9 @@ class PipInvoke(BaseEmbed):
|
||||
def run(self, creator):
|
||||
if not self.enabled:
|
||||
return
|
||||
+ self.insert_system_wheels_paths(creator)
|
||||
with self.get_pip_install_cmd(creator.exe, creator.interpreter.version_release_str) as cmd:
|
||||
- with pip_wheel_env_run(creator.interpreter.version_release_str, self.app_data) as env:
|
||||
+ with pip_wheel_env_run(creator.interpreter.version_release_str, creator.interpreter.executable, self.app_data) as env:
|
||||
self._execute(cmd, env)
|
||||
|
||||
@staticmethod
|
||||
@@ -46,8 +47,6 @@ class PipInvoke(BaseEmbed):
|
||||
cmd.append("{}{}".format(key, "=={}".format(ver) if ver is not None else ""))
|
||||
with ExitStack() as stack:
|
||||
folders = set()
|
||||
- for context in (ensure_file_on_disk(get_bundled_wheel(p, version), self.app_data) for p in pkg_versions):
|
||||
- folders.add(stack.enter_context(context).parent)
|
||||
folders.update(set(self.extra_search_dir))
|
||||
for folder in folders:
|
||||
cmd.extend(["--find-links", str(folder)])
|
||||
diff --git a/src/virtualenv/seed/embed/wheels/__init__.py b/src/virtualenv/seed/embed/wheels/__init__.py
|
||||
index 90fea02..99cc251 100644
|
||||
--- a/src/virtualenv/seed/embed/wheels/__init__.py
|
||||
+++ b/src/virtualenv/seed/embed/wheels/__init__.py
|
||||
@@ -38,3 +38,6 @@ BUNDLE_SUPPORT = {
|
||||
},
|
||||
}
|
||||
MAX = "3.9"
|
||||
+
|
||||
+# Redefined here because bundled wheels are removed in RPM build
|
||||
+BUNDLE_SUPPORT = None
|
||||
diff --git a/src/virtualenv/seed/embed/wheels/acquire.py b/src/virtualenv/seed/embed/wheels/acquire.py
|
||||
index 91b630d..4067f0e 100644
|
||||
--- a/src/virtualenv/seed/embed/wheels/acquire.py
|
||||
+++ b/src/virtualenv/seed/embed/wheels/acquire.py
|
||||
@@ -12,6 +12,7 @@ from zipfile import ZipFile
|
||||
|
||||
from virtualenv.info import IS_ZIPAPP
|
||||
from virtualenv.util.path import Path
|
||||
+from virtualenv.util.path._system_wheels import get_system_wheels_paths
|
||||
from virtualenv.util.six import ensure_str, ensure_text
|
||||
from virtualenv.util.subprocess import Popen, subprocess
|
||||
from virtualenv.util.zipapp import ensure_file_on_disk
|
||||
@@ -33,8 +34,9 @@ class WheelDownloadFail(ValueError):
|
||||
def get_wheels(for_py_version, wheel_cache_dir, extra_search_dir, packages, app_data, download):
|
||||
# not all wheels are compatible with all python versions, so we need to py version qualify it
|
||||
processed = copy(packages)
|
||||
- # 1. acquire from bundle
|
||||
- acquire_from_bundle(processed, for_py_version, wheel_cache_dir)
|
||||
+ # Do not use bundled wheels, they are removed in rpmbuild anyway
|
||||
+ # acquire_from_bundle(processed, for_py_version, wheel_cache_dir)
|
||||
+
|
||||
# 2. acquire from extra search dir
|
||||
acquire_from_dir(processed, for_py_version, wheel_cache_dir, extra_search_dir)
|
||||
# 3. download from the internet
|
||||
@@ -47,6 +49,7 @@ def get_wheels(for_py_version, wheel_cache_dir, extra_search_dir, packages, app_
|
||||
|
||||
|
||||
def acquire_from_bundle(packages, for_py_version, to_folder):
|
||||
+ raise NotImplementedError("Bundled wheels are not available")
|
||||
for pkg, version in list(packages.items()):
|
||||
bundle = get_bundled_wheel(pkg, for_py_version)
|
||||
if bundle is not None:
|
||||
@@ -67,6 +70,7 @@ def acquire_from_bundle(packages, for_py_version, to_folder):
|
||||
|
||||
|
||||
def get_bundled_wheel(package, version_release):
|
||||
+ raise NotImplementedError("Bundled wheels are not available") # and BUNDLE_SUPPORT == None anyway
|
||||
return BUNDLE_FOLDER / (BUNDLE_SUPPORT.get(version_release, {}) or BUNDLE_SUPPORT[MAX]).get(package)
|
||||
|
||||
|
||||
@@ -156,7 +160,7 @@ def download_wheel(packages, for_py_version, to_folder, app_data):
|
||||
cmd.extend(to_download)
|
||||
# pip has no interface in python - must be a new sub-process
|
||||
|
||||
- with pip_wheel_env_run("{}.{}".format(*sys.version_info[0:2]), app_data) as env:
|
||||
+ with pip_wheel_env_run("{}.{}".format(*sys.version_info[0:2]), sys.executable, app_data) as env:
|
||||
process = Popen(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
||||
out, err = process.communicate()
|
||||
if process.returncode != 0:
|
||||
@@ -164,7 +168,7 @@ def download_wheel(packages, for_py_version, to_folder, app_data):
|
||||
|
||||
|
||||
@contextmanager
|
||||
-def pip_wheel_env_run(version, app_data):
|
||||
+def pip_wheel_env_run(version, executable, app_data):
|
||||
env = os.environ.copy()
|
||||
env.update(
|
||||
{
|
||||
@@ -172,7 +176,11 @@ def pip_wheel_env_run(version, app_data):
|
||||
for k, v in {"PIP_USE_WHEEL": "1", "PIP_USER": "0", "PIP_NO_INPUT": "1"}.items()
|
||||
},
|
||||
)
|
||||
- with ensure_file_on_disk(get_bundled_wheel("pip", version), app_data) as pip_wheel_path:
|
||||
- # put the bundled wheel onto the path, and use it to do the bootstrap operation
|
||||
- env[str("PYTHONPATH")] = str(pip_wheel_path)
|
||||
- yield env
|
||||
+
|
||||
+ paths = list(get_system_wheels_paths(executable))
|
||||
+ pip_wheels = []
|
||||
+ for path in paths:
|
||||
+ pip_wheels.extend([str(wheel) for wheel in path.glob("pip-*")])
|
||||
+ env[str("PYTHONPATH")] = pip_wheels[0] # Use first pip in the list (ensurepip, if exists)
|
||||
+
|
||||
+ yield env
|
||||
diff --git a/src/virtualenv/seed/via_app_data/via_app_data.py b/src/virtualenv/seed/via_app_data/via_app_data.py
|
||||
index de3757d..db7c6d9 100644
|
||||
--- a/src/virtualenv/seed/via_app_data/via_app_data.py
|
||||
+++ b/src/virtualenv/seed/via_app_data/via_app_data.py
|
||||
@@ -38,6 +38,7 @@ class FromAppData(BaseEmbed):
|
||||
def run(self, creator):
|
||||
if not self.enabled:
|
||||
return
|
||||
+ self.insert_system_wheels_paths(creator)
|
||||
base_cache = self.base_cache / creator.interpreter.version_release_str
|
||||
with self._get_seed_wheels(creator, base_cache) as name_to_whl:
|
||||
pip_version = name_to_whl["pip"].stem.split("-")[1] if "pip" in name_to_whl else None
|
||||
diff --git a/src/virtualenv/util/path/_system_wheels.py b/src/virtualenv/util/path/_system_wheels.py
|
||||
new file mode 100644
|
||||
index 0000000..a968dee
|
||||
--- /dev/null
|
||||
+++ b/src/virtualenv/util/path/_system_wheels.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from subprocess import check_output, CalledProcessError
|
||||
+
|
||||
+from virtualenv.util.path import Path
|
||||
+
|
||||
+
|
||||
+def get_system_wheels_paths(executable):
|
||||
+ # ensurepip wheels
|
||||
+ # We need subprocess here to check ensurepip with the Python we are creating
|
||||
+ # a new virtual environment for
|
||||
+ try:
|
||||
+ ensurepip_path = check_output((executable, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])'), universal_newlines=True)
|
||||
+ ensurepip_path = Path(ensurepip_path.strip()) / "_bundled"
|
||||
+ except CalledProcessError:
|
||||
+ pass
|
||||
+ else:
|
||||
+ if ensurepip_path.is_dir():
|
||||
+ yield ensurepip_path
|
||||
+
|
||||
+ # Standard wheels path
|
||||
+ wheels_dir = Path("/usr/share/python-wheels")
|
||||
+ if wheels_dir.exists():
|
||||
+ yield wheels_dir
|
||||
--
|
||||
2.26.2
|
||||
|
||||
cmd = [py_executable, "-"] + project_names
|
||||
logger.start_progress("Installing {}...".format(", ".join(project_names)))
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (virtualenv-16.7.10.tar.gz) = 28bd2f81d0df629cc69ad06401ba25f2fa5c3e9678255ae151e6f2ef7c7a2b0dc89671355dbb6fb1da3a562180ae3769abca160d9933f3aafba43a6fba08793c
|
||||
SHA512 (virtualenv-20.0.23.tar.gz) = 747ae0031ae587dc2bdc0743dcab7b1673273a5c79fc4bcb539eacd899ddc064b622e567b654fc40bdfdaa90e311d2621856085417b8fd344878546b19cdce84
|
||||
|
Loading…
Reference in New Issue
Block a user