Blame 0001-Remove-Python-version-management-on-Fedora.patch

0d485a0
From 0b5444bf7e59868e2dd79cffa113197870776ef6 Mon Sep 17 00:00:00 2001
2a4b716
From: =?UTF-8?q?Tadej=20Jane=C5=BE?= <tadej.j@nez.si>
2a4b716
Date: Wed, 12 Jun 2019 23:28:13 +0200
0d485a0
Subject: [PATCH 01/15] Remove Python version management on Fedora
2a4b716
2a4b716
This removes the pythonz-bd dependency which is not available in Fedora
2a4b716
anymore.
2a4b716
Furthermore, there is strong support upstream to either remove Pew's
2a4b716
Python version management or replace it with pyenv:
2a4b716
https://github.com/berdario/pew/issues/195.
2a4b716
---
2a4b716
 pew/pew.py                     | 22 +++-------------------
2a4b716
 pew/shell_config/complete.fish |  9 ---------
2a4b716
 pew/shell_config/complete.zsh  |  3 ---
2a4b716
 tests/test_install.py          | 29 -----------------------------
2a4b716
 4 files changed, 3 insertions(+), 60 deletions(-)
2a4b716
 delete mode 100644 tests/test_install.py
2a4b716
2a4b716
diff --git a/pew/pew.py b/pew/pew.py
2a4b716
index c588a2e..2ffea2f 100644
2a4b716
--- a/pew/pew.py
2a4b716
+++ b/pew/pew.py
2a4b716
@@ -19,25 +19,9 @@ windows = sys.platform == 'win32'
2a4b716
 
2a4b716
 from clonevirtualenv import clone_virtualenv
2a4b716
 if not windows:
2a4b716
-    try:
2a4b716
-        # Try importing these packages if avaiable
2a4b716
-        from pythonz.commands.install import InstallCommand
2a4b716
-        from pythonz.commands.uninstall import UninstallCommand
2a4b716
-        from pythonz.installer.pythoninstaller import PythonInstaller, AlreadyInstalledError
2a4b716
-        from pythonz.commands.list import ListCommand
2a4b716
-        from pythonz.define import PATH_PYTHONS
2a4b716
-        from pythonz.commands.locate import LocateCommand as LocatePython
2a4b716
-
2a4b716
-        def ListPythons():
2a4b716
-            try:
2a4b716
-                Path(PATH_PYTHONS).mkdir(parents=True)
2a4b716
-            except OSError:
2a4b716
-                pass
2a4b716
-            return ListCommand()
2a4b716
-    except:
2a4b716
-        # create mock commands
2a4b716
-        InstallCommand = ListPythons = LocatePython = UninstallCommand = \
2a4b716
-            lambda : sys.exit('You need to install the pythonz extra.  pip install pew[pythonz]')
2a4b716
+    # Mock Pythonz commands
2a4b716
+    InstallCommand = ListPythons = LocatePython = UninstallCommand = \
2a4b716
+        lambda : sys.exit('Python version management is not supported on Fedora.')
2a4b716
 else:
2a4b716
     # Pythonz does not support windows
2a4b716
     InstallCommand = ListPythons = LocatePython = UninstallCommand = \
2a4b716
diff --git a/pew/shell_config/complete.fish b/pew/shell_config/complete.fish
2a4b716
index af9f6d2..5dd0195 100644
2a4b716
--- a/pew/shell_config/complete.fish
2a4b716
+++ b/pew/shell_config/complete.fish
2a4b716
@@ -105,12 +105,3 @@ complete -f -c $pew -n '__pew_using_command workon' -a '(__pew_list_envs)' -d 'V
2a4b716
 
2a4b716
 #### rename
2a4b716
 complete -f -c $pew -n '__pew_needs_command' -a rename -d 'Rename a virtualenv'
2a4b716
-
2a4b716
-#### install
2a4b716
-complete -f -c $pew -n '__pew_needs_command' -a install -d 'Use Pythonz to download and build a Python vm'
2a4b716
-
2a4b716
-#### list_pythons
2a4b716
-complete -f -c $pew -n '__pew_needs_command' -a list_pythons -d 'List the pythons installed by Pythonz'
2a4b716
-
2a4b716
-#### locate_python
2a4b716
-complete -f -c $pew -n '__pew_needs_command' -a locate_python -d 'Locate the path for the python version installed by Pythonz'
2a4b716
diff --git a/pew/shell_config/complete.zsh b/pew/shell_config/complete.zsh
2a4b716
index 623fbff..e3a9aa5 100644
2a4b716
--- a/pew/shell_config/complete.zsh
2a4b716
+++ b/pew/shell_config/complete.zsh
2a4b716
@@ -23,9 +23,6 @@ case $state in
2a4b716
             'add:Add directories to python path of active virtualenv'
2a4b716
             'cp:Duplicate the named virtualenv to make a new one'
2a4b716
             'inall:Run a command in each virtualenv:command'
2a4b716
-            'install:Use Pythonz to download and build the specified Python version'
2a4b716
-            'list_pythons:List the pythons installed by Pythonz (or all the installable ones)'
2a4b716
-            'locate_python:Locate the path for the python version installed by Pythonz'
2a4b716
             'ls:List all existing virtual environments'
2a4b716
             'lssitepackages:List currently active site-packages'
2a4b716
             'mkproject:Create environment with an associated project directory'
2a4b716
diff --git a/tests/test_install.py b/tests/test_install.py
2a4b716
deleted file mode 100644
2a4b716
index 478ccbb..0000000
2a4b716
--- a/tests/test_install.py
2a4b716
+++ /dev/null
2a4b716
@@ -1,29 +0,0 @@
2a4b716
-import sys
2a4b716
-import os
2a4b716
-from subprocess import check_call
2a4b716
-from pew._utils import invoke_pew as invoke
2a4b716
-from utils import skip_windows, connection_required
2a4b716
-import pytest
2a4b716
-
2a4b716
-def skip_marker(f):
2a4b716
-    return skip_windows(reason='Pythonz unavailable in Windows')(
2a4b716
-        pytest.mark.skipif(
2a4b716
-            sys.platform == 'cygwin',
2a4b716
-            reason='Pythonz unavailable in Cygwin')(
2a4b716
-                pytest.mark.skipif(os.environ.get('NIX'),
2a4b716
-                                   reason='Pythonz unavailable in Nix')(
2a4b716
-                    connection_required(f))))
2a4b716
-
2a4b716
-@skip_marker
2a4b716
-def test_install():
2a4b716
-    py_version = ['2.6.1', '--type', 'pypy']
2a4b716
-    assert invoke('install', *py_version).returncode == 0
2a4b716
-    py = invoke('locate_python', *py_version).out
2a4b716
-    check_call([py, '-V'])
2a4b716
-
2a4b716
-@skip_marker
2a4b716
-def test_uninstall():
2a4b716
-    py_version = ['2.6.1', '--type', 'pypy']
2a4b716
-    invoke('install', *py_version)
2a4b716
-    assert invoke('uninstall', *py_version).returncode == 0
2a4b716
-    assert invoke('locate_python', *py_version).returncode != 0
2a4b716
-- 
0d485a0
2.31.1
2a4b716