forked from pool/python-click-repl
- added patches
fix 1ad52b2ba6
+ python-click-repl-remove-six.patch
OBS-URL: https://build.opensuse.org/request/show/1004949
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click-repl?expand=0&rev=5
95 lines
2.9 KiB
Diff
95 lines
2.9 KiB
Diff
From 1ad52b2ba601d5107b5457ffa8a885eff95ea031 Mon Sep 17 00:00:00 2001
|
|
From: Stian Jensen <me@stianj.com>
|
|
Date: Sun, 23 Jan 2022 15:10:03 +0100
|
|
Subject: [PATCH] Drop Python 2 support, remove six
|
|
|
|
---
|
|
.travis.yml | 1 -
|
|
click_repl/__init__.py | 9 ++++-----
|
|
setup.py | 2 +-
|
|
tox.ini | 2 +-
|
|
4 files changed, 6 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/.travis.yml b/.travis.yml
|
|
index 40c6ad4..6089e52 100644
|
|
--- a/.travis.yml
|
|
+++ b/.travis.yml
|
|
@@ -1,6 +1,5 @@
|
|
language: python
|
|
python:
|
|
- - "2.7"
|
|
- "pypy"
|
|
- "3.4"
|
|
- "3.5"
|
|
diff --git a/click_repl/__init__.py b/click_repl/__init__.py
|
|
index c1b950e..6fb656c 100644
|
|
--- a/click_repl/__init__.py
|
|
+++ b/click_repl/__init__.py
|
|
@@ -7,7 +7,6 @@
|
|
import os
|
|
import shlex
|
|
import sys
|
|
-import six
|
|
from .exceptions import InternalCommandException, ExitReplException # noqa
|
|
|
|
# Handle backwards compatibility between Click 7.0 and 8.0
|
|
@@ -42,7 +41,7 @@ def _register_internal_command(names, target, description=None):
|
|
if not hasattr(target, "__call__"):
|
|
raise ValueError("Internal command must be a callable")
|
|
|
|
- if isinstance(names, six.string_types):
|
|
+ if isinstance(names, str):
|
|
names = [names]
|
|
elif not isinstance(names, (list, tuple)):
|
|
raise ValueError('"names" must be a string or a list / tuple')
|
|
@@ -71,14 +70,14 @@ def _help_internal():
|
|
with formatter.section("Internal Commands"):
|
|
formatter.write_text('prefix internal commands with ":"')
|
|
info_table = defaultdict(list)
|
|
- for mnemonic, target_info in six.iteritems(_internal_commands):
|
|
+ for mnemonic, target_info in _internal_commands.items():
|
|
info_table[target_info[1]].append(mnemonic)
|
|
formatter.write_dl(
|
|
(
|
|
", ".join((":{0}".format(mnemonic) for mnemonic in sorted(mnemonics))),
|
|
description,
|
|
)
|
|
- for description, mnemonics in six.iteritems(info_table)
|
|
+ for description, mnemonics in info_table.items()
|
|
)
|
|
return formatter.getvalue()
|
|
|
|
@@ -242,7 +241,7 @@ def get_command():
|
|
if allow_internal_commands:
|
|
try:
|
|
result = handle_internal_commands(command)
|
|
- if isinstance(result, six.string_types):
|
|
+ if isinstance(result, str):
|
|
click.echo(result)
|
|
continue
|
|
except ExitReplException:
|
|
diff --git a/setup.py b/setup.py
|
|
index dbb23e1..9634c3a 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -23,5 +23,5 @@
|
|
url="https://github.com/untitaker/click-repl",
|
|
license="MIT",
|
|
packages=["click_repl"],
|
|
- install_requires=["click", "prompt_toolkit", "six"],
|
|
+ install_requires=["click", "prompt_toolkit"],
|
|
)
|
|
diff --git a/tox.ini b/tox.ini
|
|
index 49513a5..3d2a0e2 100644
|
|
--- a/tox.ini
|
|
+++ b/tox.ini
|
|
@@ -1,6 +1,6 @@
|
|
[tox]
|
|
envlist =
|
|
- py{27,py,34,35,36,37}
|
|
+ py{py,34,35,36,37}
|
|
linters
|
|
|
|
[testenv]
|
|
|