15
0

Accepting request 1116235 from home:mschreiner:branches:devel:languages:python

- Update to 0.3.0:
  * Drop Python 2 support, remove six.
  * Uses PromptSession() class from prompt_toolkit instead of prompt()
    function.
  * Added filter for hidden commands and options.
  * Added click's autocompletion support.
  * Added tab-completion for Path and BOOL type arguments.
  * Added 'expand environmental variables in path' feature.
  * Delegate command dispatching to the actual group command.
  * Updated completer class and tests based on new fix.
  * Python 3.11 support.
- Remove python-click-repl-remove-six.patch, as it is now obsolete.
- Remove dendency on python-six.
- Add build-time dependency on pytest-cov.

OBS-URL: https://build.opensuse.org/request/show/1116235
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click-repl?expand=0&rev=9
This commit is contained in:
2023-10-07 20:10:09 +00:00
committed by Git OBS Bridge
parent 534c1dfbce
commit 3a16b8ac8b
5 changed files with 25 additions and 104 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b0cac32a625c24cd1414cc323e314a79278e2310e41596a6e27997e1c9f99e72
size 7014

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7dd66878c5b7b41ac790775d82b8fccdfdb1deb80d6c95306e90ad3e8c3538ed
size 14306

View File

@@ -1,94 +0,0 @@
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,21 @@
-------------------------------------------------------------------
Sat Oct 7 18:03:57 UTC 2023 - Martin Schreiner <martin.schreiner@suse.com>
- Update to 0.3.0:
* Drop Python 2 support, remove six.
* Uses PromptSession() class from prompt_toolkit instead of prompt()
function.
* Added filter for hidden commands and options.
* Added click's autocompletion support.
* Added tab-completion for Path and BOOL type arguments.
* Added 'expand environmental variables in path' feature.
* Delegate command dispatching to the actual group command.
* Updated completer class and tests based on new fix.
* Python 3.11 support.
- Remove python-click-repl-remove-six.patch, as it is now obsolete.
- Remove dendency on python-six.
- Add build-time dependency on pytest-cov.
-------------------------------------------------------------------
Sun Jun 11 13:46:17 UTC 2023 - ecsos <ecsos@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-click-repl
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,25 +18,22 @@
%{?sle15_python_module_pythons}
Name: python-click-repl
Version: 0.2.0
Version: 0.3.0
Release: 0
Summary: REPL plugin for Click
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-cov}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-click
Requires: python-prompt_toolkit
Requires: python-six
BuildArch: noarch
%python_subpackages
@@ -57,7 +54,7 @@ REPL plugin for Click
%pytest
%files %{python_files}
%doc README.rst
%doc README.md
%license LICENSE
%{python_sitelib}/click_repl
%{python_sitelib}/click_repl-%{version}*info