15
0

Accepting request 1004949 from home:pgajdos:python

- 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
This commit is contained in:
2022-09-20 12:07:06 +00:00
committed by Git OBS Bridge
parent 6e907ceab9
commit 688c73afbf
3 changed files with 104 additions and 1 deletions

View File

@@ -0,0 +1,94 @@
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]

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Sep 20 11:27:30 UTC 2022 - pgajdos@suse.com
- added patches
fix https://github.com/click-contrib/click-repl/commit/1ad52b2ba601d5107b5457ffa8a885eff95ea031
+ python-click-repl-remove-six.patch
-------------------------------------------------------------------
Mon Jun 21 08:51:19 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-click-repl
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ License: MIT
URL: https://github.com/untitaker/click-repl
# No tests in PyPI archive
Source: https://github.com/click-contrib/click-repl/archive/%{version}.tar.gz#/click-repl-%{version}-gh.tar.gz
# https://github.com/click-contrib/click-repl/commit/1ad52b2ba601d5107b5457ffa8a885eff95ea031
Patch0: python-click-repl-remove-six.patch
BuildRequires: %{python_module click}
BuildRequires: %{python_module prompt_toolkit}
BuildRequires: %{python_module pytest}