Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
python-Paver
remove-six.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File remove-six.patch of Package python-Paver
--- pavement.py | 3 -- paver/doctools.py | 2 - paver/misctasks.py | 5 +--- paver/release.py | 1 paver/setuputils.py | 6 +---- paver/tasks.py | 43 +++++++++++++++-------------------------- paver/tests/test_doctools.py | 7 ++---- paver/tests/test_setuputils.py | 3 -- paver/tests/test_shell.py | 9 +++----- paver/tests/test_tasks.py | 37 ++++++++++++++++------------------- paver/tests/utils.py | 6 ----- requirements.txt | 1 12 files changed, 48 insertions(+), 75 deletions(-) Index: Paver-1.3.4/pavement.py =================================================================== --- Paver-1.3.4.orig/pavement.py +++ Paver-1.3.4/pavement.py @@ -15,14 +15,13 @@ options( minilib=Bunch( extra_files=['doctools', 'virtual'], versioned_name=False, - extra_packages=['six'] ), sphinx=Bunch( builddir="build", sourcedir="source" ), virtualenv=Bunch( - packages_to_install=["Sphinx>=0.6b1", "docutils", "virtualenv", "six"], + packages_to_install=["Sphinx>=0.6b1", "docutils", "virtualenv"], install_paver=False, script_name='bootstrap.py', paver_command_line=None, Index: Paver-1.3.4/paver/doctools.py =================================================================== --- Paver-1.3.4.orig/paver/doctools.py +++ Paver-1.3.4/paver/doctools.py @@ -138,7 +138,7 @@ class SectionedFile(object): self.contents = [] self.sections = {} if from_string is not None: - from six import StringIO + from io import StringIO self._read_file(StringIO(from_string)) else: with open(filename) as f: Index: Paver-1.3.4/paver/misctasks.py =================================================================== --- Paver-1.3.4.orig/paver/misctasks.py +++ Paver-1.3.4/paver/misctasks.py @@ -2,7 +2,7 @@ import importlib import pkgutil import zipfile -import six +import io from os.path import join, dirname, exists, abspath from paver.easy import dry, task, path from paver.tasks import VERSION, cmdopts @@ -48,7 +48,6 @@ def minilib(options): "easy", 'shell', 'deps/__init__', 'deps/path2', 'deps/path3'] filelist.extend(options.get('extra_files', [])) - packagelist = ['six'] packagelist.extend(options.get('extra_packages', [])) packagelist = set(packagelist) @@ -60,7 +59,7 @@ def minilib(options): def generate_zip(): # Write the mini library to a buffer. - buf = six.BytesIO() + buf = io.BytesIO() destfile = zipfile.ZipFile(buf, "w", zipfile.ZIP_DEFLATED) for filename in filelist: destfile.writestr("paver/%s.py" % filename, Index: Paver-1.3.4/paver/release.py =================================================================== --- Paver-1.3.4.orig/paver/release.py +++ Paver-1.3.4/paver/release.py @@ -18,7 +18,6 @@ requirements is also easy.""", maintainer_email='bugs@almad.net', url='https://github.com/paver/paver', packages=['paver', 'paver.deps'], - install_requires=['six'], tests_require=['virtualenv', 'cogapp'], classifiers=[ "Development Status :: 5 - Production/Stable", Index: Paver-1.3.4/paver/setuputils.py =================================================================== --- Paver-1.3.4.orig/paver/setuputils.py +++ Paver-1.3.4/paver/setuputils.py @@ -14,8 +14,6 @@ except ImportError: from distutils.errors import DistutilsModuleError _Distribution = dist.Distribution -from six import print_ - from paver.options import Bunch try: @@ -110,7 +108,7 @@ def find_package_data( or fn.lower() == pattern.lower()): bad_name = True if show_ignored: - print_("Directory %s ignored by pattern %s" + print("Directory %s ignored by pattern %s" % (fn, pattern), file=sys.stderr) break if bad_name: @@ -131,7 +129,7 @@ def find_package_data( or fn.lower() == pattern.lower()): bad_name = True if show_ignored: - print_("File %s ignored by pattern %s" + print("File %s ignored by pattern %s" % (fn, pattern), file=sys.stderr) break if bad_name: Index: Paver-1.3.4/paver/tasks.py =================================================================== --- Paver-1.3.4.orig/paver/tasks.py +++ Paver-1.3.4/paver/tasks.py @@ -9,18 +9,11 @@ import itertools import operator import traceback import platform -import six from os.path import * -from six import print_ from paver.version import VERSION -# using six.moves is complicated because we include it and it's thus not at -# the top level -if six.PY3: - xrange = range - class PavementError(Exception): """Exception that represents a problem in the pavement.py file rather than the process of running a build.""" @@ -78,7 +71,7 @@ class Environment(object): self._print(output) def _print(self, output): - print_(output) + print(output) sys.stdout.flush() def _exit(self, code): @@ -162,7 +155,7 @@ class Environment(object): else: (funcargs, varargs, varkw, defaults, _, _, _) = getfullargspec(func) kw = dict() - for i in xrange(0, len(funcargs)): + for i in range(0, len(funcargs)): arg = funcargs[i] if arg == 'env': kw['env'] = self @@ -470,12 +463,12 @@ class Task(object): environment.error("Option %s added for hiding, but it's not in parser...?" % opt_str) name = self.name - print_("\n%s" % name) - print_("-" * len(name)) + print("\n%s" % name) + print("-" * len(name)) parser.print_help() - print_() - print_(self.__doc__) - print_() + print() + print(self.__doc__) + print() def _set_value_to_task(self, task_name, option_name, dist_option_name, value): import paver.options @@ -576,7 +569,7 @@ def needs(*args): needs_list = func.needs if len(req) == 1: req = req[0] - if isinstance(req, six.string_types): + if isinstance(req, str): needs_list.append(req) elif isinstance(req, (list, tuple)): needs_list.extend(req) @@ -617,7 +610,7 @@ def might_call(*args): might_call = func.might_call if len(req) == 1: req = req[0] - if isinstance(req, six.string_types): + if isinstance(req, str): might_call.append(req) elif isinstance(req, (list, tuple)): might_call.extend(req) @@ -760,7 +753,6 @@ def _cmp_task_names(a, b): # trick taken from python3porting.org return (a > b) - (b < a) -if six.PY3: import functools _task_names_key = functools.cmp_to_key(_cmp_task_names) @@ -782,7 +774,7 @@ def help(args, help_function): task_name = args[0] task = environment.get_task(task_name) if not task: - print_("Task not found: %s" % (task_name)) + print("Task not found: %s" % (task_name)) return task.display_help() @@ -791,17 +783,14 @@ def help(args, help_function): help_function() task_list = environment.get_tasks() - if six.PY3: - task_list = sorted(task_list, key=_task_names_key) - else: - task_list = sorted(task_list, cmp=_cmp_task_names) + task_list = sorted(task_list, key=_task_names_key) maxlen, task_list = _group_by_module(task_list) fmt = " %-" + str(maxlen) + "s - %s" for group_name, group in task_list: - print_("\nTasks from %s:" % (group_name)) + print("\nTasks from %s:" % (group_name)) for task in group: if not getattr(task, "no_help", False): - print_(fmt % (task.shortname, task.description)) + print(fmt % (task.shortname, task.description)) def _process_commands(args, auto_pending=False): first_loop = True @@ -822,7 +811,7 @@ def _process_commands(args, auto_pending first_loop = False def call_pavement(new_pavement, args): - if isinstance(args, six.string_types): + if isinstance(args, str): args = args.split() global environment environment_stack.append(environment) @@ -844,7 +833,7 @@ def _launch_pavement(args): if not exists(environment.pavement_file): environment.pavement_file = None - six.exec_("from paver.easy import *\n", mod.__dict__) + exec("from paver.easy import *\n", mod.__dict__) _process_commands(args) return @@ -875,7 +864,7 @@ def _launch_pavement(args): if getattr(environment.options, "propagate_traceback", False) \ or '--propagate-traceback' in args: raise - print_("\n\n*** Problem with pavement:\n%s\n%s\n\n" % ( + print("\n\n*** Problem with pavement:\n%s\n%s\n\n" % ( abspath(environment.pavement_file), e)) def main(args=None): Index: Paver-1.3.4/paver/tests/test_doctools.py =================================================================== --- Paver-1.3.4.orig/paver/tests/test_doctools.py +++ Paver-1.3.4/paver/tests/test_doctools.py @@ -1,7 +1,6 @@ import sys from unittest import SkipTest -from six import print_ from paver.easy import * from paver import doctools, tasks, options @@ -17,7 +16,7 @@ def test_sections_from_file(): assert f['foo'] == "#Foo!\n", "Foo section contained: '%s'" % f['foo'] def display(msg, *args): - print_(msg % args) + print(msg % args) doctools.debug = display @@ -147,7 +146,7 @@ def test_cogging(): textfile = basedir / "data/textfile.rst" with open(textfile) as f: data = f.read() - print_(data) + print(data) assert "print sys.path" in data doctools.uncog() with open(textfile) as f: @@ -174,7 +173,7 @@ def test_cogging_with_markers_removed(): doctools.cog() with open(textfile) as f: data = f.read() - print_(data) + print(data) assert "[[[cog" not in data finally: with open(textfile, "w") as f: Index: Paver-1.3.4/paver/tests/test_setuputils.py =================================================================== --- Paver-1.3.4.orig/paver/tests/test_setuputils.py +++ Paver-1.3.4/paver/tests/test_setuputils.py @@ -1,5 +1,4 @@ from distutils.core import Command -from six import print_ from paver.setuputils import install_distutils_tasks, \ DistutilsTaskFinder, _get_distribution, \ @@ -92,7 +91,7 @@ def test_task_with_distutils_dep(): assert sdist.called assert _sdist.called cmd = d.get_command_obj('sdist') - print_("Cmd is: %s" % cmd) + print("Cmd is: %s" % cmd) assert cmd.foo assert _sdist.foo_set Index: Paver-1.3.4/paver/tests/test_shell.py =================================================================== --- Paver-1.3.4.orig/paver/tests/test_shell.py +++ Paver-1.3.4/paver/tests/test_shell.py @@ -1,5 +1,4 @@ import sys -from six import b try: from unittest.mock import patch except ImportError: @@ -10,7 +9,7 @@ from subprocess import PIPE, STDOUT @patch('subprocess.Popen') def test_sh_raises_BuildFailure(popen): popen.return_value.returncode = 1 - popen.return_value.communicate.return_value = [b('some stderr')] + popen.return_value.communicate.return_value = ['some stderr'.encode()] try: easy.sh('foo') @@ -30,7 +29,7 @@ def test_sh_raises_BuildFailure(popen): @patch('subprocess.Popen') def test_sh_with_capture_raises_BuildFailure(popen, error): popen.return_value.returncode = 1 - popen.return_value.communicate.return_value = [b('some stderr')] + popen.return_value.communicate.return_value = ['some stderr'.encode()] try: easy.sh('foo', capture=True) except easy.BuildFailure: @@ -51,7 +50,7 @@ def test_sh_with_capture_raises_BuildFai @patch('subprocess.Popen') def test_sh_ignores_error(popen): - popen.return_value.communicate.return_value = [b('some stderr')] + popen.return_value.communicate.return_value = ['some stderr'.encode()] popen.return_value.returncode = 1 easy.sh('foo', ignore_error=True) @@ -63,7 +62,7 @@ def test_sh_ignores_error(popen): @patch('subprocess.Popen') def test_sh_ignores_error_with_capture(popen): popen.return_value.returncode = 1 - popen.return_value.communicate.return_value = [b('some stderr')] + popen.return_value.communicate.return_value = ['some stderr'.encode()] easy.sh('foo', capture=True, ignore_error=True) assert popen.called Index: Paver-1.3.4/paver/tests/test_tasks.py =================================================================== --- Paver-1.3.4.orig/paver/tests/test_tasks.py +++ Paver-1.3.4/paver/tests/test_tasks.py @@ -1,8 +1,6 @@ import os from pprint import pprint -from six import exec_, PY2, print_ - from paver import setuputils, misctasks, tasks, options from paver.tests.utils import _set_environment, FakeExitException @@ -138,7 +136,7 @@ def test_basic_command_line(): _set_environment(t1=t1) try: tr, args = tasks._parse_command_line(['foo']) - print_(tr) + print(tr) assert False, "Expected BuildFailure exception for unknown task" except tasks.BuildFailure: pass @@ -440,7 +438,7 @@ def test_consume_nargs(): env = _set_environment(t21=t21, t12=t12) try: tr, args = tasks._parse_command_line("t21 t12".split()) - print_(tr) + print(tr) assert False, "Expected BuildFailure exception for not enougth args" except tasks.BuildFailure: pass @@ -935,22 +933,21 @@ def test_options_might_be_shared_both_wa assert t2.called -if not PY2: - def test_paver_doesnt_crash_on_task_function_with_annotations(): - local_scope = {} - # exec()ing so that it doesn't crash when this test file is run - # under Python 2 which doesn't support this syntax - exec_( - """ +def test_paver_doesnt_crash_on_task_function_with_annotations(): + local_scope = {} + # exec()ing so that it doesn't crash when this test file is run + # under Python 2 which doesn't support this syntax + exec( + """ @tasks.task def fun() -> None: pass""", - globals(), local_scope, - ) - fun = local_scope['fun'] - environment = _set_environment(fun=fun) - - # This call would fail with: - # ValueError: Function has keyword-only arguments or annotations, - # use getfullargspec() API which can support them - fun() + globals(), local_scope, + ) + fun = local_scope['fun'] + environment = _set_environment(fun=fun) + + # This call would fail with: + # ValueError: Function has keyword-only arguments or annotations, + # use getfullargspec() API which can support them + fun() Index: Paver-1.3.4/paver/tests/utils.py =================================================================== --- Paver-1.3.4.orig/paver/tests/utils.py +++ Paver-1.3.4/paver/tests/utils.py @@ -1,5 +1,4 @@ import types -import six from paver import setuputils, tasks @@ -23,10 +22,7 @@ def _set_environment(patch_print=False, pavement = FakeModule(**kw) env = tasks.Environment(pavement) tasks.environment = env - if six.PY3: - method_args = (env,) - else: - method_args = (env, tasks.Environment) + method_args = (env,) env._exit = types.MethodType(patched_exit, *method_args) if patch_print: env._print = types.MethodType(patched_print, *method_args) Index: Paver-1.3.4/requirements.txt =================================================================== --- Paver-1.3.4.orig/requirements.txt +++ Paver-1.3.4/requirements.txt @@ -1 +0,0 @@ -six
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor