1
0

4 Commits

Author SHA256 Message Date
a090f9f1ce Accepting request 1270879 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1270879
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-configshell-fb?expand=0&rev=20
2025-04-20 07:35:14 +00:00
378178c1df - Removed requirement for python-urwid in SPEC file, as the
code stopped using it.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-configshell-fb?expand=0&rev=42
2025-04-18 17:44:18 +00:00
6b6802d7fb Accepting request 1255727 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1255727
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-configshell-fb?expand=0&rev=19
2025-03-25 21:10:59 +00:00
e024a12334 - Upgrade to current latest upstream, which is a few
commits past v2.0.0:
  * Update pre-commit hooks, ruff rules
  * Improve backwards configshell-fb compatibility
  * Fix: log truncated
  * v2.0.0
  * Add pypi publish and pre-commit workflows
  * Add backwards compatibility with _fb module name
  * Explicitly declare wheel build target dir
  * Adding -fb suffix to module name
  * Remove urwid dependency
  * Adding pre-commit config
  * Use f-strings
  * Use Pathlib
  * Refactoring to Python>=3.9, adding ruff rules
  * Move to PEP-621; Use configshell module name
  * six is unneeded, get rid of it
  * Fix help messages without a trailing newline
  * Remove usage of six
  Note that the last item means we can do away with the patch:
  * no-six.patch (removed)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-configshell-fb?expand=0&rev=40
2025-03-24 19:46:36 +00:00
6 changed files with 57 additions and 181 deletions

View File

@@ -2,12 +2,14 @@
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/open-iscsi/configshell-fb.git</param>
<param name="subdir"></param>
<param name="package-meta">yes</param>
<param name="filename">python-configshell-fb</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="revision">master</param>
<param name="version">master</param>
<param name="versionformat">2.0.0-@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(\d*\.\d*\.)(\d*)</param>
<param name="versionrewrite-replacement">\1\2</param>
<param name="revision">v1.1.30</param>
<param name="match-tag">v2.0.0*</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*configshell-fb*.tar</param>

View File

@@ -1,160 +0,0 @@
Index: python-configshell-fb-1.1.30/configshell/console.py
===================================================================
--- python-configshell-fb-1.1.30.orig/configshell/console.py
+++ python-configshell-fb-1.1.30/configshell/console.py
@@ -17,7 +17,6 @@ under the License.
from fcntl import ioctl
import re
-import six
import struct
import sys
from termios import TIOCGWINSZ, TCSADRAIN, tcsetattr, tcgetattr
Index: python-configshell-fb-1.1.30/configshell/node.py
===================================================================
--- python-configshell-fb-1.1.30.orig/configshell/node.py
+++ python-configshell-fb-1.1.30/configshell/node.py
@@ -17,7 +17,6 @@ under the License.
import inspect
import re
-import six
class ExecutionError(Exception):
pass
@@ -503,7 +502,7 @@ class ConfigNode(object):
elif group not in self.list_config_groups():
raise ExecutionError("Unknown configuration group: %s" % group)
- for param, value in six.iteritems(parameter):
+ for param, value in parameter.items():
if param not in self.list_group_params(group):
raise ExecutionError("Unknown parameter %s in group '%s'."
% (param, group))
@@ -1256,7 +1255,7 @@ class ConfigNode(object):
bookmarks += "No bookmarks yet.\n"
else:
for (bookmark, path) \
- in six.iteritems(self.shell.prefs['bookmarks']):
+ in self.shell.prefs['bookmarks'].items():
if len(bookmark) == 1:
bookmark += '\0'
underline = ''.ljust(len(bookmark), '-')
@@ -1703,7 +1702,7 @@ class ConfigNode(object):
return []
else:
params = []
- for p_name, p_def in six.iteritems(self._configuration_groups[group]):
+ for p_name, p_def in self._configuration_groups[group].items():
(p_type, p_description, p_writable) = p_def
if writable is not None and p_writable != writable:
continue
Index: python-configshell-fb-1.1.30/configshell/prefs.py
===================================================================
--- python-configshell-fb-1.1.30.orig/configshell/prefs.py
+++ python-configshell-fb-1.1.30/configshell/prefs.py
@@ -16,8 +16,8 @@ under the License.
'''
import os
-import six
import fcntl
+import pickle
class Prefs(object):
'''
@@ -116,7 +116,7 @@ class Prefs(object):
@return: Iterates on the items in preferences.
@rtype: yields items that are (key, value) pairs
'''
- return six.iteritems(self._prefs)
+ return self._prefs.items()
def save(self, filename=None):
'''
@@ -132,7 +132,7 @@ class Prefs(object):
fsock = open(filename, 'wb')
fcntl.lockf(fsock, fcntl.LOCK_UN)
try:
- six.moves.cPickle.dump(self._prefs, fsock, 2)
+ pickle.dump(self._prefs, fsock, 2)
finally:
fsock.close()
@@ -148,6 +148,6 @@ class Prefs(object):
fsock = open(filename, 'rb')
fcntl.lockf(fsock, fcntl.LOCK_SH)
try:
- self._prefs = six.moves.cPickle.load(fsock)
+ self._prefs = pickle.load(fsock)
finally:
fsock.close()
Index: python-configshell-fb-1.1.30/configshell/shell.py
===================================================================
--- python-configshell-fb-1.1.30.orig/configshell/shell.py
+++ python-configshell-fb-1.1.30/configshell/shell.py
@@ -16,7 +16,6 @@ under the License.
'''
import os
-import six
import sys
from pyparsing import (alphanums, Empty, Group, locatedExpr,
OneOrMore, Optional, ParseResults, Regex,
@@ -173,7 +172,7 @@ class ConfigShell(object):
self.log.warning("Could not load preferences file %s."
% self._prefs_file)
- for pref, value in six.iteritems(self.default_prefs):
+ for pref, value in self.default_prefs.items():
if pref not in self.prefs:
self.prefs[pref] = value
@@ -239,7 +238,7 @@ class ConfigShell(object):
else:
nr_cols = 1
- for i in six.moves.range(0, len(matches), nr_cols):
+ for i in range(0, len(matches), nr_cols):
self.con.raw_write(''.join(matches[i:i+nr_cols]))
self.con.raw_write('\n')
@@ -402,7 +401,7 @@ class ConfigShell(object):
for index in range(len(pparams)):
if index < len(cmd_params):
current_parameters[cmd_params[index]] = pparams[index]
- for key, value in six.iteritems(kparams):
+ for key, value in kparams.items():
current_parameters[key] = value
self._completion_help_topic = command
completion_method = target.get_completion_method(command)
@@ -550,7 +549,7 @@ class ConfigShell(object):
current_parameters = {}
for index in range(len(pparams)):
current_parameters[cmd_params[index]] = pparams[index]
- for key, value in six.iteritems(kparams):
+ for key, value in kparams.items():
current_parameters[key] = value
completion_method = target.get_completion_method(command)
if completion_method:
@@ -722,7 +721,7 @@ class ConfigShell(object):
try:
readline.parse_and_bind("tab: complete")
readline.set_completer(self._complete)
- cmdline = six.moves.input(self._get_prompt()).strip()
+ cmdline = input(self._get_prompt()).strip()
except EOFError:
self.con.raw_write('exit\n')
cmdline = "exit"
Index: python-configshell-fb-1.1.30/setup.py
===================================================================
--- python-configshell-fb-1.1.30.orig/setup.py
+++ python-configshell-fb-1.1.30/setup.py
@@ -43,7 +43,6 @@ setup(
packages = ['configshell', 'configshell_fb'],
install_requires = [
'pyparsing >=2.0.2',
- 'six',
'urwid',
],
classifiers = [

View File

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

Binary file not shown.

View File

@@ -1,3 +1,35 @@
-------------------------------------------------------------------
Fri Apr 18 17:39:26 UTC 2025 - Lee Duncan <lduncan@suse.com>
- Removed requirement for python-urwid in SPEC file, as the
code stopped using it.
-------------------------------------------------------------------
Mon Mar 24 15:43:17 UTC 2025 - Lee Duncan <lduncan@suse.com>
- Upgrade to current latest upstream, which is a few
commits past v2.0.0:
* Update pre-commit hooks, ruff rules
* Improve backwards configshell-fb compatibility
* Fix: log truncated
* v2.0.0
* Add pypi publish and pre-commit workflows
* Add backwards compatibility with _fb module name
* Explicitly declare wheel build target dir
* Adding -fb suffix to module name
* Remove urwid dependency
* Adding pre-commit config
* Use f-strings
* Use Pathlib
* Refactoring to Python>=3.9, adding ruff rules
* Move to PEP-621; Use configshell module name
* six is unneeded, get rid of it
* Fix help messages without a trailing newline
* Remove usage of six
Note that the last item means we can do away with the patch:
* no-six.patch (removed)
-------------------------------------------------------------------
Tue Apr 16 12:25:42 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-configshell-fb
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,24 +17,27 @@
%{?sle15_python_module_pythons}
%define configshell_service_tag 5.7088593241b4
Name: python-configshell-fb
Version: 1.1.30
Version: 2.0.0
Release: 0%{?dist}
Summary: A Python library for building configuration shells
License: Apache-2.0
Group: Development/Libraries/Python
URL: https://github.com/open-iscsi/configshell-fb
Source: %{name}-%{version}.tar.xz
#PATCH-FIX-UPSTREAM https://github.com/open-iscsi/configshell-fb/pull/74 six is unneeded
Patch: no-six.patch
Source: %{name}-%{version}-%{configshell_service_tag}.tar.xz
BuildRequires: %{python_module hatch_vcs}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module setuptools}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: %{python_module wheel}
BuildRequires: git
BuildRequires: python-rpm-macros
Requires: %{_bindir}/env
Requires: python-pyparsing
Requires: python-urwid
Provides: python-configshell = %{version}-%{release}
Obsoletes: python-configshell < %{version}
BuildArch: noarch
@@ -65,19 +68,18 @@ rtslib, and configshell, or stick with all non-fb versions, since they are
no longer strictly compatible.
%prep
%autosetup -p1 -n %{name}-%{version}
%autosetup -p1 -n %{name}-%{version}-%{configshell_service_tag}
%build
%python_build
%pyproject_wheel
%install
%python_install --skip-build
%fdupes %{buildroot}
%pyproject_install
%files %{python_files}
%{python_sitelib}/configshell
%{python_sitelib}/configshell_fb
%{python_sitelib}/configshell_fb-%{version}*info
%license COPYING
%doc README.md
%{python_sitelib}/configshell*
%pycache_only %{python_sitelib}/__pycache__
%changelog