diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 0694a7008bd542dd6bb794d8f36501aaf69f772d..807b9220d75750e4ee898985fa4395976c1f505c 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -1,10 +1,9 @@ -%bcond_with doc %bcond_with tests Summary: Tool to create isolated Python environments Name: python-virtualenv -Version: 20.13.3 -Release: 5%{?dist} +Version: 20.21.1 +Release: 1%{?dist} License: MIT URL: http://pypi.python.org/pypi/virtualenv @@ -14,19 +13,9 @@ Patch3000: rpm-wheels.patch BuildArch: noarch -BuildRequires: python3-devel -BuildRequires: python3-distlib -BuildRequires: python3-filelock -BuildRequires: python3-platformdirs -BuildRequires: python3-setuptools -BuildRequires: python3-setuptools_scm -BuildRequires: python3-six - -%if %{with docs} -BuildRequires: python3-sphinx -BuildRequires: python3-sphinx_rtd_theme -BuildRequires: python3-towncrier -%endif +BuildRequires: python3-devel python3-hatchling + +BuildRequires: python-pip-wheel python-setuptools-wheel python-wheel-wheel %if %{with tests} BuildRequires: fish @@ -39,10 +28,6 @@ BuildRequires: python3-pytest-randomly BuildRequires: python3-pytest-timeout %endif -BuildRequires: python-pip-wheel -BuildRequires: python-setuptools-wheel -BuildRequires: python-wheel-wheel - %description virtualenv is a tool to create isolated Python environments. virtualenv is a successor to workingenv, and an extension of virtual-python. It is @@ -64,42 +49,28 @@ written by Ian Bicking, and sponsored by the Open Planning Project. It is licensed under an MIT-style permissive license -%if %{with docs} -%package -n python-virtualenv-doc -Summary: Documentation for python virtualenv - -%description -n python-virtualenv-doc -Documentation for python virtualenv. -%endif - - %prep %autosetup -p1 -n virtualenv-%{version} -sed -i -e "1s|#!/usr/bin/env python||" tasks/update_embedded.py rm src/virtualenv/seed/wheels/embed/pip-* rm src/virtualenv/seed/wheels/embed/setuptools-* rm src/virtualenv/seed/wheels/embed/wheel-* +test ! -f src/virtualenv/seed/embed/wheels/*.whl sed -i "s|/usr/share/python-wheels|%{python_wheel_dir}|" src/virtualenv/util/path/_system_wheels.py -%build -%{py3_build} +%generate_buildrequires +%pyproject_buildrequires -%if %{with docs} -PYTHONPATH=src %{python3} setup.py build_sphinx -rm -f build/sphinx/html/.buildinfo -%endif +%build +%pyproject_wheel %install -%{py3_install} +%pyproject_install +%pyproject_save_files virtualenv %if %{with tests} %check -mkdir tmp_path -ln -s $(realpath %{__python3}) tmp_path/python -export PATH="$(pwd)/tmp_path:$PATH" -unset SOURCE_DATE_EPOCH PIP_CERT=/etc/pki/tls/certs/ca-bundle.crt \ %pytest -vv -k "not test_bundle and not test_acquire 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" @@ -107,20 +78,16 @@ PIP_CERT=/etc/pki/tls/certs/ca-bundle.crt \ rm -r tmp_path %endif -%files -n python3-virtualenv -%license LICENSE -%doc docs/*rst README.md +%files -n python3-virtualenv -f %{pyproject_files} +%license %{python3_sitelib}/virtualenv-%{version}.dist-info/licenses/LICENSE +%doc README.md %{_bindir}/virtualenv -%{python3_sitelib}/virtualenv/ -%{python3_sitelib}/virtualenv-*.egg-info/ - -%if %{with docs} -%files -n python-virtualenv-doc -%doc build/sphinx/* -%endif %changelog +* Mon Sep 25 2023 Wang Guodong - 20.21.1-1 +- Upgrade to version 20.21.1 + * Tue Sep 19 2023 OpenCloudOS Release Engineering - 20.13.3-5 - Rebuilt for python 3.11 diff --git a/rpm-wheels.patch b/rpm-wheels.patch index 58603e9e4ad92f0d339f1a93927d458dd251c7b4..e9d7cc8a2e4d0a600f7a63c00cfd54bc8a9eb7d1 100644 --- a/rpm-wheels.patch +++ b/rpm-wheels.patch @@ -1,6 +1,6 @@ -From e32327e4e06eef42a631e3f21674b4577b40ce77 Mon Sep 17 00:00:00 2001 +From 0558dbfcd0d89f52aa251481ba41ab4cfa2cb6da Mon Sep 17 00:00:00 2001 From: Lumir Balhar -Date: Tue, 15 Mar 2022 08:07:24 +0100 +Date: Thu, 9 Feb 2023 15:13:36 +0100 Subject: [PATCH] RPM wheels --- @@ -8,16 +8,16 @@ Subject: [PATCH] RPM wheels src/virtualenv/seed/embed/base_embed.py | 16 +++++++++++++- 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/seed/wheels/embed/__init__.py | 4 ++++ src/virtualenv/util/path/_system_wheels.py | 22 +++++++++++++++++++ - 6 files changed, 45 insertions(+), 3 deletions(-) + 6 files changed, 46 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 +index 6d22b71..19d1791 100644 --- a/src/virtualenv/run/__init__.py +++ b/src/virtualenv/run/__init__.py -@@ -89,8 +89,9 @@ def build_parser_only(args=None): +@@ -87,8 +87,9 @@ def build_parser_only(args=None): def handle_extra_commands(options): if options.upgrade_embed_wheels: @@ -30,24 +30,21 @@ index e8e7ab1..617cf67 100644 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..43c636d 100644 +index f29110b..07649c2 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 +@@ -3,8 +3,9 @@ from pathlib import Path from ..seeder import Seeder from ..wheels import Version ++from virtualenv.util.path._system_wheels import get_system_wheels_paths -PERIODIC_UPDATE_ON_BY_DEFAULT = True +PERIODIC_UPDATE_ON_BY_DEFAULT = False - @add_metaclass(ABCMeta) -@@ -34,6 +35,15 @@ class BaseEmbed(Seeder): + class BaseEmbed(Seeder, metaclass=ABCMeta): +@@ -27,6 +28,15 @@ class BaseEmbed(Seeder, metaclass=ABCMeta): if not self.distribution_to_versions(): self.enabled = False @@ -63,19 +60,22 @@ index c794e83..43c636d 100644 @classmethod def distributions(cls): return { -@@ -116,3 +126,7 @@ class BaseEmbed(Seeder): +@@ -105,6 +115,10 @@ class BaseEmbed(Seeder, metaclass=ABCMeta): + result += f" {distribution}{ver}," + return result[:-1] + ")" - 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) ++ system_wheels_paths = get_system_wheels_paths(creator.interpreter) + self.extra_search_dir = list(system_wheels_paths) + self.extra_search_dir ++ + + __all__ = [ + "BaseEmbed", diff --git a/src/virtualenv/seed/embed/pip_invoke.py b/src/virtualenv/seed/embed/pip_invoke.py -index c935c02..2d9d80d 100644 +index 2ca9438..339295f 100644 --- a/src/virtualenv/seed/embed/pip_invoke.py +++ b/src/virtualenv/seed/embed/pip_invoke.py -@@ -17,6 +17,7 @@ class PipInvoke(BaseEmbed): +@@ -15,6 +15,7 @@ class PipInvoke(BaseEmbed): def run(self, creator): if not self.enabled: return @@ -84,10 +84,10 @@ index c935c02..2d9d80d 100644 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 +index f31ecf6..d7a0f5a 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): +@@ -37,6 +37,7 @@ class FromAppData(BaseEmbed): def run(self, creator): if not self.enabled: return @@ -96,16 +96,16 @@ index 9a98a70..a0ecadf 100644 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 ba15be9..3b488cf 100644 +index f779e07..db141ae 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.11" +@@ -53,7 +53,11 @@ BUNDLE_SUPPORT = { + MAX = "3.12" + +# 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) @@ -113,19 +113,19 @@ index ba15be9..3b488cf 100644 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 +index 0000000..f3fd9b1 --- /dev/null +++ b/src/virtualenv/util/path/_system_wheels.py @@ -0,0 +1,22 @@ ++from pathlib import Path +from subprocess import check_output, CalledProcessError + -+from virtualenv.util.path import Path -+ + -+def get_system_wheels_paths(executable): ++def get_system_wheels_paths(interpreter): + # ensurepip wheels + # We need subprocess here to check ensurepip with the Python we are creating + # a new virtual environment for ++ executable = interpreter.executable + try: + ensurepip_path = check_output((executable, "-u", "-c", 'import ensurepip; print(ensurepip.__path__[0])'), universal_newlines=True) + ensurepip_path = Path(ensurepip_path.strip()) / "_bundled" @@ -140,5 +140,5 @@ index 0000000..a968dee + if wheels_dir.exists(): + yield wheels_dir -- -2.35.1 +2.39.1 diff --git a/sources b/sources index 980678d46ff088aad57143f32424a0b86a345d3c..debf5e0d5cdf08e12d6cf48262e564165fc1b13c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (virtualenv-20.13.3.tar.gz) = e9e05e6e6aba10bb6c0813484f508aede9fe2a78401272bb12ea68b80e8f4059f4292de51e37c2487efb92d27f6eeda6e108dd12f45623984966d8fe821352c0 +SHA512 (virtualenv-20.21.1.tar.gz) = 5f5c4ce677feffe24b87ff4b3837e6f7cda6a5017eea122ac089be2066b74c7eaf452dbc0ab7723e9433716aeca13e6f85ea23d02fb28a83d76df5db0068572a