Compare commits

...

No commits in common. "c8s-stream-2.7" and "c9s" have entirely different histories.

12 changed files with 420 additions and 474 deletions

5
.gitignore vendored
View File

@ -1 +1,4 @@
SOURCES/virtualenv-15.1.0.tar.gz
/virtualenv-*.tar.gz
/virtualenv-*/
/results_python-virtualenv/
*.rpm

View File

@ -1 +1 @@
995ce0fa007210ac2f10258999d06813ecdd6eeb SOURCES/virtualenv-15.1.0.tar.gz
c157b25cbb87c1183cbb940bce6a2fd4c709c88d virtualenv-20.4.0.tar.gz

View File

@ -1,16 +0,0 @@
diff --git a/virtualenv.py b/virtualenv.py
index c4e3bd5..89b8863 100755
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -1181,8 +1181,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
exec_dir = join(sys.exec_prefix, 'Lib')
else:
exec_dir = join(sys.exec_prefix, 'lib', py_version)
- for fn in os.listdir(exec_dir):
- copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink)
+ if os.path.isdir(exec_dir):
+ for fn in os.listdir(exec_dir):
+ copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink)
if is_jython:
# Jython has either jython-dev.jar and javalib/ dir, or just

View File

@ -1,102 +0,0 @@
diff --git a/tests/test_virtualenv.py b/tests/test_virtualenv.py
index ce45ede..7946a16 100644
--- a/tests/test_virtualenv.py
+++ b/tests/test_virtualenv.py
@@ -4,11 +4,16 @@ import os
import shutil
import sys
import tempfile
+import zipfile
import pytest
import platform # noqa
from mock import patch, Mock
+try:
+ from pathlib import Path
+except ImportError:
+ from pathlib2 import Path
def test_version():
"""Should have a version string"""
@@ -139,3 +144,44 @@ def test_always_copy_option():
" symlink (to %s)" % (full_name, os.readlink(full_name))
finally:
shutil.rmtree(tmp_virtualenv)
+
+
+def test_missing_certifi_pem(tmp_path):
+ """Make sure that we can still create virtual environment if pip is
+ patched to not use certifi's cacert.pem and the file is removed.
+ This can happen if pip is packaged by Linux distributions."""
+ proj_dir = Path(__file__).parent.parent
+ support_original = proj_dir / "virtualenv_support"
+ pip_wheel = sorted(support_original.glob("pip*whl"))[0]
+ whl_name = pip_wheel.name
+
+ wheeldir = tmp_path / "wheels"
+ wheeldir.mkdir()
+ tmpcert = tmp_path / "tmpcert.pem"
+ cacert = "pip/_vendor/requests/cacert.pem"
+ certifi = "pip/_vendor/requests/certs.py"
+ oldpath = b"os.path.join(os.path.dirname(__file__), 'cacert.pem')"
+ newpath = "r'{}'".format(tmpcert).encode()
+ removed = False
+ replaced = False
+
+ with zipfile.ZipFile(str(pip_wheel), "r") as whlin:
+ with zipfile.ZipFile(str(wheeldir / whl_name), "w") as whlout:
+ for item in whlin.infolist():
+ buff = whlin.read(item.filename)
+ if item.filename == cacert:
+ tmpcert.write_bytes(buff)
+ removed = True
+ continue
+ if item.filename == certifi:
+ nbuff = buff.replace(oldpath, newpath)
+ assert nbuff != buff
+ buff = nbuff
+ replaced = True
+ whlout.writestr(item, buff)
+
+ assert removed and replaced
+
+ venvdir = tmp_path / "venv"
+ search_dirs = [str(wheeldir), str(support_original)]
+ virtualenv.create_environment(str(venvdir), search_dirs=search_dirs)
diff --git a/virtualenv.egg-info/PKG-INFO b/virtualenv.egg-info/PKG-INFO
index 11f5c75..501e81a 100644
--- a/virtualenv.egg-info/PKG-INFO
+++ b/virtualenv.egg-info/PKG-INFO
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: virtualenv
Version: 15.1.0
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
-Author: Jannis Leidel, Carl Meyer and Brian Rosner
-Author-email: python-virtualenv@groups.google.com
+Author: Ian Bicking
+Author-email: ianb@colorstudy.com
+Maintainer: Jannis Leidel, Carl Meyer and Brian Rosner
+Maintainer-email: python-virtualenv@groups.google.com
License: MIT
Description: Virtualenv
==========
diff --git a/virtualenv.py b/virtualenv.py
index a174b8a..5699998 100755
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -861,7 +861,10 @@ def install_wheel(project_names, py_executable, search_dirs=None,
import pip
- cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
+ try:
+ cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
+ except IOError:
+ cert_data = None
if cert_data is not None:
cert_file = tempfile.NamedTemporaryFile(delete=False)
cert_file.write(cert_data)

View File

@ -1,125 +0,0 @@
From b7b8a713d9f1ebac6430fd0fc10175ed37b834ee Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Thu, 18 Mar 2021 13:08:52 +0100
Subject: [PATCH] rpm
---
virtualenv.py | 66 ++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 55 insertions(+), 11 deletions(-)
diff --git a/virtualenv.py b/virtualenv.py
index 5699998..9854324 100755
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -39,9 +39,9 @@ except ImportError:
__version__ = "15.1.0"
virtualenv_version = __version__ # legacy
-if sys.version_info < (2, 6):
+if sys.version_info < (2, 7):
print('ERROR: %s' % sys.exc_info()[1])
- print('ERROR: this script requires Python 2.6 or greater.')
+ print('ERROR: this script requires Python 2.7 or greater.')
sys.exit(101)
try:
@@ -399,6 +399,8 @@ def _find_file(filename, dirs):
def file_search_dirs():
here = os.path.dirname(os.path.abspath(__file__))
dirs = [here, join(here, 'virtualenv_support')]
+ dirs.insert(1, '/usr/share/python{}-wheels'.format(sys.version_info[0]))
+ dirs.insert(1, '/usr/share/python{}{}-wheels'.format(*sys.version_info[:2]))
if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv':
# Probably some boot script; just in case virtualenv is installed...
try:
@@ -859,7 +861,12 @@ def install_wheel(project_names, py_executable, search_dirs=None,
import tempfile
import os
- import pip
+ try:
+ from pip._internal import main as _main
+ if type(_main) is type(sys): # <type 'module'>
+ _main = _main.main # nested starting in Pip 19.3
+ except ImportError:
+ from pip import main as _main
try:
cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
@@ -878,7 +885,7 @@ def install_wheel(project_names, py_executable, search_dirs=None,
args += ["--cert", cert_file.name]
args += sys.argv[1:]
- sys.exit(pip.main(args))
+ sys.exit(_main(args))
finally:
if cert_file is not None:
os.remove(cert_file.name)
@@ -1038,20 +1045,57 @@ def change_prefix(filename, dst_prefix):
assert False, "Filename %s does not start with any of these prefixes: %s" % \
(filename, prefixes)
-def copy_required_modules(dst_prefix, symlink):
- import imp
+def find_module_filename(modname):
+ if sys.version_info < (3, 4):
+ # noinspection PyDeprecation
+ import imp
+
+ try:
+ file_handler, filepath, _ = imp.find_module(modname)
+ except ImportError:
+ return None
+ else:
+ if file_handler is not None:
+ file_handler.close()
+ return filepath
+ else:
+ import importlib.util
+ if sys.version_info < (3, 5):
+
+ def find_spec(modname):
+ # noinspection PyDeprecation
+ loader = importlib.find_loader(modname)
+ if loader is None:
+ return None
+ else:
+ return importlib.util.spec_from_loader(modname, loader)
+
+ else:
+ find_spec = importlib.util.find_spec
+
+ spec = find_spec(modname)
+ if spec is None:
+ return None
+ if not os.path.exists(spec.origin):
+ # https://bitbucket.org/pypy/pypy/issues/2944/origin-for-several-builtin-modules
+ # on pypy3, some builtin modules have a bogus build-time file path, ignore them
+ return None
+ filepath = spec.origin
+ # https://www.python.org/dev/peps/pep-3147/#file guarantee to be non-cached
+ if os.path.basename(filepath) == "__init__.py":
+ filepath = os.path.dirname(filepath)
+ return filepath
+
+def copy_required_modules(dst_prefix, symlink):
for modname in REQUIRED_MODULES:
if modname in sys.builtin_module_names:
logger.info("Ignoring built-in bootstrap module: %s" % modname)
continue
- try:
- f, filename, _ = imp.find_module(modname)
- except ImportError:
+ filename = find_module_filename(modname)
+ if filename is None:
logger.info("Cannot import bootstrap module: %s" % modname)
else:
- if f is not None:
- f.close()
# special-case custom readline.so on OS X, but not for pypy:
if modname == 'readline' and sys.platform == 'darwin' and not (
is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))):
--
2.30.2

1
dead.package Normal file
View File

@ -0,0 +1 @@
python-virtualenv package is retired on c9s for CS-569

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

View File

@ -1,65 +1,56 @@
# python2X and python3X are built form the same module, so we need a conditional
# for python[23] bits the state of the conditional is not important in the spec,
# it is set in modulemd
%bcond_without python2
%bcond_without python3
%bcond_with python36_module
Name: python-virtualenv
Version: 15.1.0
Release: 21%{?dist}
Version: 20.4.0
Release: 3%{?dist}
Summary: Tool to create isolated Python environments
Group: Development/Languages
License: MIT
URL: http://pypi.python.org/pypi/virtualenv
Source0: http://pypi.python.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz
Source0: %{pypi_source virtualenv}
# virtualenv -p "/usr/bin/python3" venv fails if there are not packages installed
# under /usr/local/lib/pythonX.Y/site-packages. Check if exec_dir exists before
# listing it's content.
Patch0: check-exec_dir.patch
# Don't fail on missing certifi's cert
# https://github.com/pypa/virtualenv/pull/1252
Patch1: dont-fail-on-missing-certifi-cert.patch
# Changes related to RPM wheels:
# 1. Drop support for Python 2.6 because we don't have it in RHEL 8 and we don't want to
# bundle prehistoric wheels
# 2. Use wheels from /usr/share/python{2,3,38,39,...}-wheels
# 3. Add support for pip 19.3-ish by importing pip.main() from different locations
# 4. Use the importlib module rather than deprecated imp on Python 3
Patch2: rpm-wheels.patch
# Add /usr/share/python-wheels to extra_search_dir
Patch1: rpm-wheels.patch
# A pytest autouse fixture introduced to workaround a pip issue breaks when PIP_CERT is set.
# We don't need the workaround, so we remove the fixture entirely until this is fixed.
# https://github.com/pypa/virtualenv/issues/2048
# https://github.com/pypa/pip/issues/8984
Patch2: remove-pip_cert-fixture.patch
BuildArch: noarch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
# RPM installed wheels
BuildRequires: python2-pip-wheel
BuildRequires: python2-setuptools-wheel
BuildRequires: python2-wheel-wheel
%endif # with python2
%if %{with python3}
BuildRequires: python3-sphinx
BuildRequires: python3-setuptools
# RPM installed wheels
BuildRequires: python3-pip-wheel
BuildRequires: python3-setuptools-wheel
BuildRequires: python3-wheel-wheel
%if %{with python36_module}
BuildRequires: python36-devel
BuildRequires: python36-rpm-macros
%else
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_with docs
%if %{with docs}
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: python3-towncrier
%endif
%endif # with python3
%bcond_without tests
%if %{with tests}
BuildRequires: fish
BuildRequires: gcc
BuildRequires: python3-flaky
BuildRequires: python3-packaging
BuildRequires: python3-pytest
BuildRequires: python3-pytest-mock
BuildRequires: python3-pytest-randomly
BuildRequires: python3-pytest-timeout
BuildRequires: xonsh
%endif
# RPM installed wheels
BuildRequires: python-pip-wheel
BuildRequires: python-setuptools-wheel
BuildRequires: python-wheel-wheel
%description
virtualenv is a tool to create isolated Python environments. virtualenv
@ -68,234 +59,196 @@ written by Ian Bicking, and sponsored by the Open Planning Project. It is
licensed under an MIT-style permissive license.
%if %{with python2}
%package -n python2-virtualenv
Summary: Tool to create isolated Python environments
Requires: python2-setuptools
Requires: python2-devel
# RPM installed wheels
Requires: python2-pip-wheel
Requires: python2-setuptools-wheel
Requires: python2-wheel-wheel
Requires: (python3-wheel-wheel if python36)
Requires: (python38-wheel-wheel if python38)
Requires: (python39-wheel-wheel if python39)
%{?python_provide:%python_provide python2-virtualenv}
%description -n python2-virtualenv
virtualenv is a tool to create isolated Python environments. virtualenv
is a successor to workingenv, and an extension of virtual-python. It is
written by Ian Bicking, and sponsored by the Open Planning Project. It is
licensed under an MIT-style permissive license
%endif
%if %{with python3}
%package -n python-virtualenv-doc
Summary: Documentation for python virtualenv
%description -n python-virtualenv-doc
Documentation for python virtualenv.
%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}
# Provide "virtualenv" for convenience
Provides: virtualenv = %{version}-%{release}
# RPM installed wheels
Requires: python3-pip-wheel
Requires: python3-setuptools-wheel
Requires: python3-wheel-wheel
Requires: (python2-wheel-wheel if python2)
Requires: (python38-wheel-wheel if python38)
Requires: (python39-wheel-wheel if python39)
# Require alternatives version that implements the --keep-foreign flag
Requires(postun): alternatives >= 1.19.1-1
# For alternatives
Requires: python36
Requires(post): python36
Requires(postun): python36
%if %{with python36_module}
Requires: python36-devel
%else
Requires: python3-devel
%endif
%{?python_provide:%python_provide python3-virtualenv}
Provides: virtualenv = %{version}-%{release}
Requires: python-pip-wheel
Requires: python-setuptools-wheel
Requires: python-wheel-wheel
%description -n python3-virtualenv
virtualenv is a tool to create isolated Python environments. virtualenv
is a successor to workingenv, and an extension of virtual-python. It is
written by Ian Bicking, and sponsored by the Open Planning Project. It is
licensed under an MIT-style permissive license
%endif # with python3
%if %{with docs}
%package -n python-virtualenv-doc
Summary: Documentation for python virtualenv
%description -n python-virtualenv-doc
Documentation for python virtualenv.
%endif
%prep
%setup -q -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
%patch0 -p1
%patch1 -p1
%patch2 -p1
# Remove the wheels provided by RPM packages
rm src/virtualenv/seed/wheels/embed/pip-*
rm src/virtualenv/seed/wheels/embed/setuptools-*
rm src/virtualenv/seed/wheels/embed/wheel-*
# Remove the wheels provided by RPM packages and argparse as it's only required for python 2.6
rm virtualenv_support/pip-*
rm virtualenv_support/setuptools-*
rm virtualenv_support/wheel-*
rm virtualenv_support/argparse-*
test ! -f src/virtualenv/seed/embed/wheels/*.whl
%build
# Build code
%{?with_python2:%{py2_build}}
# Build docs on Fedora
%if %{with python3}
%{__python3} setup.py build_sphinx
rm -f build/sphinx/html/.buildinfo
%{py3_build}
# Build docs on Fedora
%{__python3} setup.py build_sphinx
# Build docs
%if %{with docs}
PYTHONPATH=src %{python3} setup.py build_sphinx
rm -f build/sphinx/html/.buildinfo
%endif # with python3
%endif
%install
%if %{with python3}
%{py3_install}
# rename binaries to use python3
mv %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/py3-virtualenv
# The versioned 3.x script was removed from upstream. Add it back.
cp %{buildroot}/%{_bindir}/py3-virtualenv %{buildroot}/%{_bindir}/virtualenv-%{python3_version}
# For alternatives
touch %{buildroot}/%{_bindir}/virtualenv-3
touch %{buildroot}/%{_bindir}/virtualenv
%endif # with python3
%if %{with python2}
%{py2_install}
# The versioned 2.x script was removed from upstream. Add it back.
cp %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/virtualenv-%{python2_version}
mv %{buildroot}/%{_bindir}/virtualenv %{buildroot}/%{_bindir}/virtualenv-2
%if %{with tests}
%check
mkdir tmp_path
ln -s $(realpath %{__python3}) tmp_path/python
export PATH="$(pwd)/tmp_path:$PATH"
unset SOURCE_DATE_EPOCH
# Skip tests which requires internet or some extra dependencies
# Requires internet:
# - test_download_*
# Uses disabled functionalities around bundled wheels:
# - test_wheel_*
# - test_seed_link_via_app_data
# - test_base_bootstrap_via_pip_invoke
# - test_acquire_find_wheel.py (whole file)
# Uses disabled functionalities around automatic updates:
# - test_periodic_update.py (whole file)
%pytest -vv -k "not test_acquire_find_wheel and not test_periodic_update and not test_wheel_ and not test_download_ and not test_base_bootstrap_via_pip_invoke and not test_seed_link_via_app_data"
rm -r tmp_path
%endif
%if %{with python3}
%post -n python3-virtualenv
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_bindir}/virtualenv-3 \
virtualenv-3 \
%{_bindir}/virtualenv-%{python3_version}
alternatives --add-slave python3 %{_bindir}/python%{python3_version} \
%{_bindir}/virtualenv \
virtualenv \
%{_bindir}/virtualenv-3
%postun -n python3-virtualenv
# Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
virtualenv-3
alternatives --keep-foreign --remove-slave python3 %{_bindir}/python%{python3_version} \
virtualenv
fi
%endif
%if %{with python2}
%files -n python2-virtualenv
%license LICENSE.txt
%doc docs/*rst PKG-INFO AUTHORS.txt
%{python2_sitelib}/*
%{_bindir}/virtualenv-2
%{_bindir}/virtualenv-%{python2_version}
%endif
%if %{with python3}
# Include sphinx docs on Fedora
%files -n python-virtualenv-doc
%doc build/sphinx/*
%files -n python3-virtualenv
%license LICENSE.txt
%doc docs/*rst PKG-INFO AUTHORS.txt
%{_bindir}/py3-virtualenv
%ghost %{_bindir}/virtualenv
%ghost %{_bindir}/virtualenv-3
%{_bindir}/virtualenv-%{python3_version}
%{python3_sitelib}/virtualenv.py
%{python3_sitelib}/virtualenv_support/
%license LICENSE
%doc docs/*rst README.md
%{_bindir}/virtualenv
%{python3_sitelib}/virtualenv/
%{python3_sitelib}/virtualenv-*.egg-info/
%{python3_sitelib}/__pycache__/*
%endif # with python3
%if %{with docs}
%files -n python-virtualenv-doc
%doc build/sphinx/*
%endif
%changelog
* Wed Jul 28 2021 Tomas Orsava <torsava@redhat.com> - 15.1.0-21
- Adjusted the postun scriptlets to enable upgrading to RHEL 9
- Resolves: rhbz#1933055
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 20.4.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Mar 18 2021 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-20
- Use python-version-specific wheels from Python modules
Resolves: rhbz#1917971
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Jun 21 2019 Miro Hrončok <mhroncok@redhat.com> - 15.1.0-19
- Use wheels from RPM packages (rhbz#1659550) (rhbz#1659551)
- Fail with a warning on Python versions < 2.7
* Tue Jan 19 2021 Lumír Balhar <lbalhar@redhat.com> - 20.4.0-1
- Update to 20.4.0 (#1915682)
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 15.1.0-18
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Tue Jan 12 2021 Lumír Balhar <lbalhar@redhat.com> - 20.3.0-1
- Update to 20.3.0 (#1914641)
* Fri Dec 14 2018 Miro Hrončok <mhroncok@redhat.com> - 15.1.0-17
- Don't fail on missing certifi's cert bundle
- Resolves: rhbz#1659440
* Mon Nov 23 2020 Lumír Balhar <lbalhar@redhat.com> - 20.2.1-1
- Update to 20.2.1 (#1900253)
* Wed Nov 28 2018 Tomas Orsava <torsava@redhat.com> - 15.1.0-16
- Provide the package name `virtualenv` and the /usr/bin/virtualenv binary
- Resolves: rhbz#1649958
* Wed Nov 18 2020 Lumír Balhar <lbalhar@redhat.com> - 20.1.0-1
- Update to 20.1.0 (#1891297)
* Thu Oct 04 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-15
- Fix alternatives - post and postun sections only with python3
- Resolves: rhbz#1633534
* Fri Oct 02 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.32-1
- Update to 20.0.32 (#1884449)
* Mon Oct 01 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-14
- Add alternatives for virtualenv-3
- Resolves: rhbz#1633534
* Thu Sep 03 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.31-1
- Update to 20.0.31 (#1869352)
* Wed Aug 15 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-13
- Remove virtualenv-3 executable. This will be provided by python3 module.
- Resolves: rhbz#1615727
* Thu Aug 06 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.30-1
- Update to 20.0.30 (#1862562)
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-12
- Remove unversioned binaries from python2 subpackage
- Resolves: rhbz#1613343
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20.0.28-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sat Aug 04 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-11
- Fixed conditions
* Fri Jul 24 2020 Miro Hrončok <mhroncok@redhat.com> - 20.0.28-1
- Update to 20.0.28
- Fixes rhbz#1860272
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 15.1.0-10
- Switch python3 coditions to bcond
* Thu Jul 23 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.27-1
- Update to 20.0.27 (#1854551)
* Tue Jul 17 2018 Tomas Orsava <torsava@redhat.com> - 15.1.0-9
- BuildRequire also python36-rpm-macros as part of the python36 module build
* Tue Jun 23 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.25-1
- Update to 20.0.25
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 15.1.0-8
- Add a bcond for python2
* Mon Jun 15 2020 Lumír Balhar <lbalhar@redhat.com> - 20.0.23-1
- Update to 20.0.23 (#1742034)
* Thu Jun 14 2018 Tomas Orsava <torsava@redhat.com> - 15.1.0-7
- Switch to using Python 3 version of sphinx
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 16.7.10-2
- Rebuilt for Python 3.9
* Mon Apr 30 2018 Tomas Orsava <torsava@redhat.com> - 15.1.0-6
- Require the python36-devel package when building for the python36 module
* Tue Feb 25 2020 Miro Hrončok <mhroncok@redhat.com> - 16.7.10-1
- Update to 16.7.10
- Explicitly require setuptools < 44 with Python 3.4
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 16.7.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Sep 03 2019 Miro Hrončok <mhroncok@redhat.com> - 16.7.3-2
- Prefer wheels bundled in Python's ensurepip module over the RPM built ones
- This allows continuing support for Python 3.4 in Fedora 32+
* Wed Aug 21 2019 Charalampos Stratakis <cstratak@redhat.com> - 16.7.3-1
- Update to 16.7.3 (#1742034)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 16.6.1-3
- Rebuilt for Python 3.8
* Mon Jul 29 2019 Miro Hrončok <mhroncok@redhat.com> - 16.6.1-2
- Drop python2-virtualenv
* Thu Jul 11 2019 Miro Hrončok <mhroncok@redhat.com> - 16.6.1-1
- Update to 16.6.1 (#1699031)
- No more Python 2.6 or Jython support
- Drop runtime dependency on pythonX-devel
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Dec 13 2018 Miro Hrončok <mhroncok@redhat.com> - 16.0.0-6
- Don't fail on missing certifi's cert bundle (#1655253)
* Wed Aug 15 2018 Miro Hrončok <mhroncok@redhat.com> - 16.0.0-5
- Use wheels from RPM packages
- Put wheels needed for Python 2.6 into a subpackage
- Only have one /usr/bin/virtualenv (#1599422)
- Provide "virtualenv" (#1502670)
* Wed Jul 18 2018 Miro Hrončok <mhroncok@redhat.com> - 16.0.0-4
- Reintroduce support for Python 2.6 (#1602347)
- Add missing bundled provides
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 16.0.0-2
- Rebuilt for Python 3.7
* Thu May 17 2018 Steve Milner <smilner@redhat.com> - 16.0.0-1
- Updated for upstream release.
* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 15.1.0-5
- Update Python 2 dependency declarations to new packaging standards

View File

@ -0,0 +1,38 @@
From bd1bf597199a209b70bddec3cdaa64a9e4902cfa Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Tue, 12 Jan 2021 08:09:38 +0100
Subject: [PATCH] Remove pip_cert fixture
---
tests/conftest.py | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/tests/conftest.py b/tests/conftest.py
index 4b91773..7b9628c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -148,21 +148,6 @@ def ignore_global_config(tmp_path_factory):
yield
-@pytest.fixture(autouse=True, scope="session")
-def pip_cert(tmp_path_factory):
- # workaround for https://github.com/pypa/pip/issues/8984 - if the certificate is explicitly set no error can happen
- key = ensure_str("PIP_CERT")
- if key in os.environ:
- return
- cert = tmp_path_factory.mktemp("folder") / "cert"
- import pkgutil
-
- cert_data = pkgutil.get_data("pip._vendor.certifi", "cacert.pem")
- cert.write_bytes(cert_data)
- with change_os_environ(key, str(cert)):
- yield
-
-
@pytest.fixture(autouse=True)
def check_os_environ_stable():
old = os.environ.copy()
--
2.29.2

128
rpm-wheels.patch Normal file
View File

@ -0,0 +1,128 @@
From a5a31b5d5c4969c8148fd44d45379140b1273f87 Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
Date: Tue, 19 Jan 2021 13:51:49 +0100
Subject: [PATCH] rpm wheels
---
src/virtualenv/run/__init__.py | 5 +++--
src/virtualenv/seed/embed/base_embed.py | 7 +++++-
src/virtualenv/seed/embed/pip_invoke.py | 1 +
.../seed/embed/via_app_data/via_app_data.py | 1 +
src/virtualenv/seed/wheels/embed/__init__.py | 3 +++
src/virtualenv/util/path/_system_wheels.py | 22 +++++++++++++++++++
6 files changed, 36 insertions(+), 3 deletions(-)
create mode 100644 src/virtualenv/util/path/_system_wheels.py
diff --git a/src/virtualenv/run/__init__.py b/src/virtualenv/run/__init__.py
index e8e7ab1..617cf67 100644
--- a/src/virtualenv/run/__init__.py
+++ b/src/virtualenv/run/__init__.py
@@ -89,8 +89,9 @@ def build_parser_only(args=None):
def handle_extra_commands(options):
if options.upgrade_embed_wheels:
- result = manual_upgrade(options.app_data, options.env)
- raise SystemExit(result)
+ # result = manual_upgrade(options.app_data, options.env)
+ logging.warning("virtualenv installed from the RPM package uses wheels from RPM packages as well. Updating them via virtualenv is not possible. The RPM packaged wheels are updated together with other RPM packages of the system.")
+ raise SystemExit(1)
def load_app_data(args, parser, options):
diff --git a/src/virtualenv/seed/embed/base_embed.py b/src/virtualenv/seed/embed/base_embed.py
index c794e83..0867e9c 100644
--- a/src/virtualenv/seed/embed/base_embed.py
+++ b/src/virtualenv/seed/embed/base_embed.py
@@ -6,11 +6,12 @@ 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
from ..wheels import Version
-PERIODIC_UPDATE_ON_BY_DEFAULT = True
+PERIODIC_UPDATE_ON_BY_DEFAULT = False
@add_metaclass(ABCMeta)
@@ -116,3 +117,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 c935c02..2d9d80d 100644
--- a/src/virtualenv/seed/embed/pip_invoke.py
+++ b/src/virtualenv/seed/embed/pip_invoke.py
@@ -17,6 +17,7 @@ class PipInvoke(BaseEmbed):
def run(self, creator):
if not self.enabled:
return
+ self.insert_system_wheels_paths(creator)
for_py_version = creator.interpreter.version_release_str
with self.get_pip_install_cmd(creator.exe, for_py_version) as cmd:
env = pip_wheel_env_run(self.extra_search_dir, self.app_data, self.env)
diff --git a/src/virtualenv/seed/embed/via_app_data/via_app_data.py b/src/virtualenv/seed/embed/via_app_data/via_app_data.py
index 9a98a70..a0ecadf 100644
--- a/src/virtualenv/seed/embed/via_app_data/via_app_data.py
+++ b/src/virtualenv/seed/embed/via_app_data/via_app_data.py
@@ -39,6 +39,7 @@ class FromAppData(BaseEmbed):
def run(self, creator):
if not self.enabled:
return
+ self.insert_system_wheels_paths(creator)
with self._get_seed_wheels(creator) as name_to_whl:
pip_version = name_to_whl["pip"].version_tuple if "pip" in name_to_whl else None
installer_class = self.installer_class(pip_version)
diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py
index 672d67b..bdd8864 100644
--- a/src/virtualenv/seed/wheels/embed/__init__.py
+++ b/src/virtualenv/seed/wheels/embed/__init__.py
@@ -48,8 +48,11 @@ BUNDLE_SUPPORT = {
}
MAX = "3.10"
+# Redefined here because bundled wheels are removed in RPM build
+BUNDLE_SUPPORT = None
def get_embed_wheel(distribution, for_py_version):
+ return None # BUNDLE_SUPPORT == None anyway
path = BUNDLE_FOLDER / (BUNDLE_SUPPORT.get(for_py_version, {}) or BUNDLE_SUPPORT[MAX]).get(distribution)
return Wheel.from_path(path)
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.29.2

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (virtualenv-20.4.0.tar.gz) = 4dcc141441626ca2a565c1b51453ef0b7a05016037c44ae1017269e5b2ea98fb7fb29fb9cf3f8909a377824b5e52c5b40d2592e40931d8ad63ad850b8e5f23ac

58
tests/tests.yml Normal file
View File

@ -0,0 +1,58 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
repositories:
- repo: "https://src.fedoraproject.org/tests/python.git"
dest: "python"
tests:
- smoke27:
dir: python/smoke
run: VERSION=2.7 METHOD=virtualenv ./venv.sh
- smoke34_optional:
dir: python/smoke
run: VERSION=3.4 METHOD=virtualenv INSTALL_OR_SKIP=true ./venv.sh
- smoke34nd_optional:
dir: python/smoke
run: VERSION=3.4 METHOD=virtualenv-no-download INSTALL_OR_SKIP=true ./venv.sh
- smoke34sp_optional:
dir: python/smoke
run: VERSION=3.4 METHOD=virtualenv-seeder-pip INSTALL_OR_SKIP=true ./venv.sh
- smoke35:
dir: python/smoke
run: VERSION=3.5 METHOD=virtualenv ./venv.sh
- smoke36:
dir: python/smoke
run: VERSION=3.6 METHOD=virtualenv ./venv.sh
- smoke37:
dir: python/smoke
run: VERSION=3.7 METHOD=virtualenv ./venv.sh
- smoke38:
dir: python/smoke
run: VERSION=3.8 METHOD=virtualenv ./venv.sh
- smoke39:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv ./venv.sh
- smoke39nd:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv-no-download ./venv.sh
- smoke39sp:
dir: python/smoke
run: VERSION=3.9 METHOD=virtualenv-seeder-pip ./venv.sh
- smoke310:
dir: python/smoke
run: VERSION=3.10 METHOD=virtualenv ./venv.sh
required_packages:
- gcc
- virtualenv
- python2.7
- python3.5
- python3.6
- python3.7
- python3.8
- python3.9
- python3.10
- python3-devel
- python3-tox