From d53bb37da93197969b84daef46d34c1a5396f779 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Sun, 26 Jun 2022 08:36:19 +0200 Subject: [PATCH] Update to 20.15.0 --- 2351.patch | 189 ----------------------------------------- python-virtualenv.spec | 11 +-- sources | 2 +- 3 files changed, 7 insertions(+), 195 deletions(-) delete mode 100644 2351.patch diff --git a/2351.patch b/2351.patch deleted file mode 100644 index b2f52ff..0000000 --- a/2351.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 2ebeb2016653914f0fac02dfec52fb20113e523f Mon Sep 17 00:00:00 2001 -From: Lumir Balhar -Date: Mon, 6 Jun 2022 07:12:56 +0200 -Subject: [PATCH] Use shlex.quote instead of deprecated pipes.quote - -pipes module is deprecated in Py 3.11 and will be removed in 3.13. -https://docs.python.org/3.11/whatsnew/3.11.html ---- - docs/changelog/2351.bugfix.rst | 1 + - src/virtualenv/discovery/cached_py_info.py | 8 ++++++-- - tasks/make_zipapp.py | 8 ++++++-- - tests/unit/activation/conftest.py | 10 +++++++--- - tests/unit/activation/test_batch.py | 10 +++++++--- - tests/unit/activation/test_powershell.py | 9 +++++++-- - 6 files changed, 34 insertions(+), 12 deletions(-) - create mode 100644 docs/changelog/2351.bugfix.rst - -diff --git a/docs/changelog/2351.bugfix.rst b/docs/changelog/2351.bugfix.rst -new file mode 100644 -index 000000000..273c3332a ---- /dev/null -+++ b/docs/changelog/2351.bugfix.rst -@@ -0,0 +1 @@ -+Use ``shlex.quote`` instead of deprecated ``pipes.quote`` in Python 3. - by :user:`frenzymadness`. -diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py -index 31beff52f..4e1d976ff 100644 ---- a/src/virtualenv/discovery/cached_py_info.py -+++ b/src/virtualenv/discovery/cached_py_info.py -@@ -8,7 +8,6 @@ - - import logging - import os --import pipes - import sys - from collections import OrderedDict - -@@ -19,6 +18,11 @@ - from virtualenv.util.six import ensure_text - from virtualenv.util.subprocess import Popen, subprocess - -+if PY2: -+ from pipes import quote -+else: -+ from shlex import quote -+ - _CACHE = OrderedDict() - _CACHE[Path(sys.executable)] = PythonInfo() - -@@ -126,7 +130,7 @@ def __repr__(self): - def e(v): - return v.decode("utf-8") if isinstance(v, bytes) else v - -- cmd_repr = e(" ").join(pipes.quote(e(c)) for c in self.cmd) -+ cmd_repr = e(" ").join(quote(e(c)) for c in self.cmd) - if self.env is not None: - cmd_repr += e(" env of {!r}").format(self.env) - if PY2: -diff --git a/tasks/make_zipapp.py b/tasks/make_zipapp.py -index aa6f62509..8ff2998aa 100644 ---- a/tasks/make_zipapp.py -+++ b/tasks/make_zipapp.py -@@ -3,7 +3,6 @@ - import io - import json - import os --import pipes - import shutil - import subprocess - import sys -@@ -18,6 +17,11 @@ - from packaging.markers import Marker - from packaging.requirements import Requirement - -+if sys.version_info[0] == 2: -+ from pipes import quote -+else: -+ from shlex import quote -+ - HERE = Path(__file__).parent.absolute() - - VERSIONS = ["3.{}".format(i) for i in range(10, 4, -1)] + ["2.7"] -@@ -227,7 +231,7 @@ def run_suppress_output(cmd, stop_print_on_fail=False): - process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) - out, err = process.communicate() - if stop_print_on_fail and process.returncode != 0: -- print("exit with {} of {}".format(process.returncode, " ".join(pipes.quote(i) for i in cmd)), file=sys.stdout) -+ print("exit with {} of {}".format(process.returncode, " ".join(quote(i) for i in cmd)), file=sys.stdout) - if out: - print(out, file=sys.stdout) - if err: -diff --git a/tests/unit/activation/conftest.py b/tests/unit/activation/conftest.py -index 6f2dd431c..5c4ae567a 100644 ---- a/tests/unit/activation/conftest.py -+++ b/tests/unit/activation/conftest.py -@@ -1,7 +1,6 @@ - from __future__ import absolute_import, unicode_literals - - import os --import pipes - import re - import shutil - import subprocess -@@ -11,12 +10,17 @@ - import pytest - import six - --from virtualenv.info import IS_PYPY, WIN_CPYTHON_2 -+from virtualenv.info import IS_PYPY, PY2, WIN_CPYTHON_2 - from virtualenv.run import cli_run - from virtualenv.util.path import Path - from virtualenv.util.six import ensure_str, ensure_text - from virtualenv.util.subprocess import Popen - -+if PY2: -+ from pipes import quote -+else: -+ from shlex import quote -+ - - class ActivationTester(object): - def __init__(self, of_class, session, cmd, activate_script, extension): -@@ -157,7 +161,7 @@ def assert_output(self, out, raw, tmp_path): - assert out[-1] == "None", raw - - def quote(self, s): -- return pipes.quote(s) -+ return quote(s) - - def python_cmd(self, cmd): - return "{} -c {}".format(os.path.basename(sys.executable), self.quote(cmd)) -diff --git a/tests/unit/activation/test_batch.py b/tests/unit/activation/test_batch.py -index 973f0bad8..985d9ff55 100644 ---- a/tests/unit/activation/test_batch.py -+++ b/tests/unit/activation/test_batch.py -@@ -1,8 +1,12 @@ - from __future__ import absolute_import, unicode_literals - --import pipes -- - from virtualenv.activation import BatchActivator -+from virtualenv.info import PY2 -+ -+if PY2: -+ from pipes import quote -+else: -+ from shlex import quote - - - def test_batch(activation_tester_class, activation_tester, tmp_path, activation_python): -@@ -25,7 +29,7 @@ def _get_test_lines(self, activate_script): - - def quote(self, s): - """double quotes needs to be single, and single need to be double""" -- return "".join(("'" if c == '"' else ('"' if c == "'" else c)) for c in pipes.quote(s)) -+ return "".join(("'" if c == '"' else ('"' if c == "'" else c)) for c in quote(s)) - - def print_prompt(self): - return "echo %PROMPT%" -diff --git a/tests/unit/activation/test_powershell.py b/tests/unit/activation/test_powershell.py -index f3705cda1..72ac1bd7d 100644 ---- a/tests/unit/activation/test_powershell.py -+++ b/tests/unit/activation/test_powershell.py -@@ -1,11 +1,16 @@ - from __future__ import absolute_import, unicode_literals - --import pipes - import sys - - import pytest - - from virtualenv.activation import PowerShellActivator -+from virtualenv.info import PY2 -+ -+if PY2: -+ from pipes import quote -+else: -+ from shlex import quote - - - @pytest.mark.slow -@@ -23,7 +28,7 @@ def __init__(self, session): - - def quote(self, s): - """powershell double double quote needed for quotes within single quotes""" -- return pipes.quote(s).replace('"', '""') -+ return quote(s).replace('"', '""') - - def _get_test_lines(self, activate_script): - # for BATCH utf-8 support need change the character code page to 650001 diff --git a/python-virtualenv.spec b/python-virtualenv.spec index c161541..e68216a 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -1,6 +1,6 @@ Name: python-virtualenv -Version: 20.13.4 -Release: 4%{?dist} +Version: 20.15.0 +Release: 1%{?dist} Summary: Tool to create isolated Python environments License: MIT @@ -9,9 +9,6 @@ Source0: %{pypi_source virtualenv} # Add /usr/share/python-wheels to extra_search_dir Patch1: rpm-wheels.patch -# Use shlex.quote instead of deprecated pipes.quote -# https://github.com/pypa/virtualenv/pull/2351 -Patch2: https://github.com/pypa/virtualenv/pull/2351.patch BuildArch: noarch @@ -161,6 +158,10 @@ rm -r tmp_path %changelog +* Sun Jun 26 2022 Lumír Balhar - 20.15.0-1 +- Update to 20.15.0 +Resolves: rhbz#2101126 + * Tue Jun 14 2022 Python Maint - 20.13.4-4 - Rebuilt for Python 3.11 diff --git a/sources b/sources index 03476f5..329fc57 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (virtualenv-20.13.4.tar.gz) = d2800ce3830ac154e9c0f03fe96535286a4322b89ef94c01638065ec353ee1dc439f7dbdbd9647836e514e828781c5a48fce3723f80c32bfa9ce96243610a396 +SHA512 (virtualenv-20.15.0.tar.gz) = 2e3cddae926f89ef986a85ddf592b38d53401212e974b65243b9f47290b653798ab2405920c28d3a7961aeb726f25ed6401e19661f1e9ce7afd195e87a0524ab