#2 Reintroduce support for Python 2.6 (#1602347)
Merged 5 years ago by churchyard. Opened 5 years ago by churchyard.
rpms/ churchyard/python-virtualenv py26  into  master

file modified
+32 -3
@@ -8,7 +8,7 @@ 

  

  Name:           python-virtualenv

  Version:        16.0.0

- Release:        3%{?dist}

+ Release:        4%{?dist}

  Summary:        Tool to create isolated Python environments

  

  Group:          Development/Languages
@@ -21,7 +21,15 @@ 

  # listing it's content.

  Patch0: check-exec_dir.patch

  

+ # virtualenv 16.x dropped support for Python 2.6 yet we still advertise that

+ # so we bring it back

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1602347

+ # once an virtualenv update has to be made that will make this impossible,

+ # the change needs to be properly communicated with Python SIG!

+ Patch1: python26.patch

+ 

  BuildArch:      noarch

+ BuildRequires:  git-core

  BuildRequires:  python2-devel

  

  %if 0%{?with_python3}
@@ -44,6 +52,15 @@ 

  Requires:       python2-devel

  %{?python_provide:%python_provide python2-virtualenv}

  

+ # bundled wheels

+ Provides:       bundled(python2dist(argparse)) = 1.4.0

+ Provides:       bundled(python2dist(pip)) = 9.0.3

+ Provides:       bundled(python2dist(pip)) = 10.0.1

+ Provides:       bundled(python2dist(setuptools)) = 36.8.0

+ Provides:       bundled(python2dist(setuptools)) = 39.1.0

+ Provides:       bundled(python2dist(wheel)) = 0.29.0

+ Provides:       bundled(python2dist(wheel)) = 0.31.1

+ 

  %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
@@ -65,6 +82,15 @@ 

  Requires:       python3-devel

  %{?python_provide:%python_provide python3-virtualenv}

  

+ # bundled wheels

+ Provides:       bundled(python3dist(argparse)) = 1.4.0

+ Provides:       bundled(python3dist(pip)) = 9.0.3

+ Provides:       bundled(python3dist(pip)) = 10.0.1

+ Provides:       bundled(python3dist(setuptools)) = 36.8.0

+ Provides:       bundled(python3dist(setuptools)) = 39.1.0

+ Provides:       bundled(python3dist(wheel)) = 0.29.0

+ Provides:       bundled(python3dist(wheel)) = 0.31.1

+ 

  %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
@@ -74,10 +100,9 @@ 

  

  

  %prep

- %setup -q -n virtualenv-%{version}

+ %autosetup -p1 -S git -n virtualenv-%{version}

  %{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py 

  

- %patch0 -p1

  

  %build

  # Build code
@@ -139,6 +164,10 @@ 

  

  

  %changelog

+ * 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

  

file added
+37474
The added file is too large to be shown here, see it at: python26.patch

Add missing bundled provides

rebased onto bd0a83c5b79353c850a16c6e100199192a866d17

5 years ago

Thank you! There seems to be a list comprehension that breaks it here (using the PoC from the bug report):

ERROR: invocation failed (exit code 1), logfile: /home/till/tox-tes/.tox/py26/log/py26-0.log
ERROR: actionid: py26
msg: getenv
cmdargs: ['/usr/bin/python3', '-m', 'virtualenv', '--python', '/usr/bin/python2.6', 'py26']

New python executable in /home/till/tox-tes/.tox/py26/bin/python2.6
Also creating executable in /home/till/tox-tes/.tox/py26/bin/python
Installing setuptools<37, pip<10, wheel<0.30...
  Complete output from command /home/till/tox-tes/.tox/py26/bin/python2.6 - setuptools<37 pip<10 wheel<0.30:
  Traceback (most recent call last):
  File "<stdin>", line 8, in <module>
  File "/usr/lib/python3.6/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
  File "/usr/lib/python3.6/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/usr/lib/python3.6/site-packages/virtualenv_support/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 526
    {str(c.version) for c in all_candidates},
                      ^
SyntaxError: invalid syntax
----------------------------------------

Even after the amended changes? I added code to install pip 9 on python 2.6.

Open /usr/lib/python3.X/site-packages/virtualenv.py, do you see this code:

                # Hack for Python 2.6 and pip 9
                if sys.version_info[:2] == (2, 6) and project == 'pip':
                    wheels.append(os.path.abspath(files[-1]))
                else:
                    wheels.append(os.path.abspath(files[0]))

?

If not, you have an old version.

If you see it, could you try to sort files before the if?

adding sorted() around the glob helps

rebased onto cd49f2a00852a0e8797e3cb1be62fdcd561e739e

5 years ago

rebased onto d384e0f

5 years ago

I'm gonna merge this tomorrow.

Pull-Request has been merged by churchyard

5 years ago