Hello community,

here is the log from the commit of package python-wcwidth for openSUSE:Factory 
checked in at 2020-07-21 15:40:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-wcwidth (Old)
 and      /work/SRC/openSUSE:Factory/.python-wcwidth.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-wcwidth"

Tue Jul 21 15:40:38 2020 rev:11 rq:821443 version:0.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-wcwidth/python-wcwidth.changes    
2020-06-21 19:06:50.481091712 +0200
+++ /work/SRC/openSUSE:Factory/.python-wcwidth.new.3592/python-wcwidth.changes  
2020-07-21 15:41:09.855587789 +0200
@@ -1,0 +2,6 @@
+Fri Jul 17 07:47:05 UTC 2020 - Dirk Mueller <[email protected]>
+
+- update to 0.2.5
+  * Do not depend on pkg_resources module for list_versions() function.
+
+-------------------------------------------------------------------

Old:
----
  wcwidth-0.2.4.tar.gz

New:
----
  wcwidth-0.2.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-wcwidth.spec ++++++
--- /var/tmp/diff_new_pack.tdSCIc/_old  2020-07-21 15:41:14.035593301 +0200
+++ /var/tmp/diff_new_pack.tdSCIc/_new  2020-07-21 15:41:14.035593301 +0200
@@ -27,7 +27,7 @@
 %endif
 %bcond_without python2
 Name:           python-wcwidth%{psuffix}
-Version:        0.2.4
+Version:        0.2.5
 Release:        0
 Summary:        Number of Terminal column cells of wide-character codes
 License:        MIT

++++++ wcwidth-0.2.4.tar.gz -> wcwidth-0.2.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/.pylintrc new/wcwidth-0.2.5/.pylintrc
--- old/wcwidth-0.2.4/.pylintrc 2020-06-08 05:37:40.000000000 +0200
+++ new/wcwidth-0.2.5/.pylintrc 2020-06-23 18:08:54.000000000 +0200
@@ -9,7 +9,7 @@
 persistent = no
 jobs = 0
 unsafe-load-any-extension = yes
-good-names = wc
+good-names = wc,fp
 
 [MESSAGES CONTROL]
 disable=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/bin/new-wide-by-version.py 
new/wcwidth-0.2.5/bin/new-wide-by-version.py
--- old/wcwidth-0.2.4/bin/new-wide-by-version.py        2020-06-08 
05:37:40.000000000 +0200
+++ new/wcwidth-0.2.5/bin/new-wide-by-version.py        2020-06-23 
18:08:54.000000000 +0200
@@ -15,8 +15,8 @@
 previous version (4.1.0).
 """
 # std imports
-import json
 import sys
+import json
 
 
 # List new WIDE characters at each unicode version.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/bin/run_codecov.py 
new/wcwidth-0.2.5/bin/run_codecov.py
--- old/wcwidth-0.2.4/bin/run_codecov.py        2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/bin/run_codecov.py        2020-06-23 18:08:54.000000000 
+0200
@@ -1,12 +1,10 @@
-"""
-Workaround for https://github.com/codecov/codecov-python/issues/158
-"""
+"""Workaround for https://github.com/codecov/codecov-python/issues/158.""";
 
 # std imports
 import sys
 import time
 
-# local
+# 3rd party
 import codecov
 
 RETRIES = 5
@@ -14,10 +12,7 @@
 
 
 def main():
-    """
-    Run codecov up to RETRIES times
-    On the final attempt, let it exit normally
-    """
+    """Run codecov up to RETRIES times On the final attempt, let it exit 
normally."""
 
     # Make a copy of argv and make sure --required is in it
     args = sys.argv[1:]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/bin/update-tables.py 
new/wcwidth-0.2.5/bin/update-tables.py
--- old/wcwidth-0.2.4/bin/update-tables.py      2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/bin/update-tables.py      2020-06-23 18:08:54.000000000 
+0200
@@ -62,7 +62,7 @@
     do_east_asian(versions)
     do_zero_width(versions)
     do_rst_file_update()
-    do_version_json(versions)
+    do_unicode_versions(versions)
 
 
 def get_unicode_versions():
@@ -297,18 +297,37 @@
     print("complete.")
 
 
-def do_version_json(versions):
-    fname = os.path.join(PATH_CODE, 'version.json')
+def do_unicode_versions(versions):
+    """Write unicode_versions.py function list_versions()."""
+    fname = os.path.join(PATH_CODE, 'unicode_versions.py')
     print(f"writing {fname} ... ", end='')
 
-    with open(fname, 'r') as fp:
-        version_data = json.load(fp)
+    utc_now = datetime.datetime.utcnow()
+    version_tuples_str = '\n        '.join(
+        f'"{ver}",' for ver in versions)
+    with open(fname, 'w') as fp:
+        fp.write(f"""\"\"\"
+Exports function list_versions() for unicode version level support.
 
-    version_data['tables'] = versions
+This code generated by {__file__} on {utc_now}.
+\"\"\"
 
-    with open(fname, 'w') as fp:
-        json.dump(version_data, fp)
-    print()
+
+def list_versions():
+    \"\"\"
+    Return Unicode version levels supported by this module release.
+
+    Any of the version strings returned may be used as keyword argument
+    ``unicode_version`` to the ``wcwidth()`` family of functions.
+
+    :returns: Supported Unicode version numbers in ascending sorted order.
+    :rtype: list[str]
+    \"\"\"
+    return (
+        {version_tuples_str}
+    )
+""")
+        print('done.')
 
 
 if __name__ == '__main__':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/bin/wcwidth-browser.py 
new/wcwidth-0.2.5/bin/wcwidth-browser.py
--- old/wcwidth-0.2.4/bin/wcwidth-browser.py    2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/bin/wcwidth-browser.py    2020-06-23 18:08:54.000000000 
+0200
@@ -489,7 +489,7 @@
             # scroll backward 1 line
             offset -= self.screen.num_columns
         elif inp in ('e', 'j') or inp.code in (term.KEY_ENTER,
-                                                 term.KEY_DOWN,):
+                                               term.KEY_DOWN,):
             # scroll forward 1 line
             offset = offset + self.screen.num_columns
         elif inp in ('f', ' ') or inp.code in (term.KEY_PGDOWN,):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/docs/intro.rst 
new/wcwidth-0.2.5/docs/intro.rst
--- old/wcwidth-0.2.4/docs/intro.rst    2020-06-08 05:37:40.000000000 +0200
+++ new/wcwidth-0.2.5/docs/intro.rst    2020-06-23 18:08:54.000000000 +0200
@@ -157,8 +157,13 @@
 - `janlelis/unicode-display_width`_: Ruby
 - `alecrabbit/php-wcwidth`_: PHP
 - `Text::CharWidth`_: Perl
+- `bluebear94/Terminal-WCWidth`: Perl 6
 - `mattn/go-runewidth`_: Go
 - `emugel/wcwidth`_: Haxe
+- `aperezdc/lua-wcwidth`: Lua
+- `joachimschmidt557/zig-wcwidth`: Zig
+- `fumiyas/wcwidth-cjk`: `LD_PRELOAD` override
+- `joshuarubin/wcwidth9`: Unicode version 9 in C
 
 History
 -------
@@ -255,12 +260,15 @@
 .. _`LuminosoInsight/python-ftfy`: 
https://github.com/LuminosoInsight/python-ftfy
 .. _`alecrabbit/php-wcwidth`: https://github.com/alecrabbit/php-wcwidth
 .. _`Text::CharWidth`: https://metacpan.org/pod/Text::CharWidth
+.. _`bluebear94/Terminal-WCWidth`: 
https://github.com/bluebear94/Terminal-WCWidth
 .. _`mattn/go-runewidth`: https://github.com/mattn/go-runewidth
 .. _`emugel/wcwidth`: https://github.com/emugel/wcwidth
 .. _`jquast/ucs-detect`: https://github.com/jquast/ucs-detect
 .. _`Avram Lubkin`: https://github.com/avylove
 .. _`nbedos/termtosvg`: https://github.com/nbedos/termtosvg
 .. _`peterbrittain/asciimatics`: https://github.com/peterbrittain/asciimatics
+.. _`aperezdc/lua-wcwidth`: https://github.com/aperezdc/lua-wcwidth
+.. _`fumiyas/wcwidth-cjk`: https://github.com/fumiyas/wcwidth-cjk
 .. |pypi_downloads| image:: 
https://img.shields.io/pypi/dm/wcwidth.svg?logo=pypi
     :alt: Downloads
     :target: https://pypi.org/project/wcwidth/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/setup.py new/wcwidth-0.2.5/setup.py
--- old/wcwidth-0.2.4/setup.py  2020-06-08 05:37:40.000000000 +0200
+++ new/wcwidth-0.2.5/setup.py  2020-06-23 18:08:54.000000000 +0200
@@ -16,11 +16,6 @@
     return os.path.join(os.path.dirname(__file__), fname)
 
 
-def _get_version(fname, key='package'):
-    import json
-    return json.load(open(fname, 'r'))[key]
-
-
 class _SetupUpdate(setuptools.Command):
     # This is a compatibility, some downstream distributions might
     # still call "setup.py update".
@@ -49,8 +44,7 @@
     setuptools.setup(
         name='wcwidth',
         # NOTE: manually manage __version__ in wcwidth/__init__.py !
-        version=_get_version(
-            _get_here(os.path.join('wcwidth', 'version.json'))),
+        version='0.2.5',
         description=(
             "Measures the displayed width of unicode strings in a terminal"),
         long_description=codecs.open(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/tests/test_ucslevel.py 
new/wcwidth-0.2.5/tests/test_ucslevel.py
--- old/wcwidth-0.2.4/tests/test_ucslevel.py    2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/tests/test_ucslevel.py    2020-06-23 18:08:54.000000000 
+0200
@@ -12,20 +12,6 @@
 import wcwidth
 
 
-def test_list_versions():
-    """wcwidth.list_versions() returns expected value."""
-    # given,
-    expected = json.loads(
-        pkg_resources.resource_string('wcwidth', 'version.json').decode('utf8')
-    )['tables']
-
-    # exercise,
-    result = wcwidth.list_versions()
-
-    # verify,
-    assert result == expected
-
-
 def test_latest():
     """wcwidth._wcmatch_version('latest') returns tail item."""
     # given,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/__init__.py 
new/wcwidth-0.2.5/wcwidth/__init__.py
--- old/wcwidth-0.2.4/wcwidth/__init__.py       2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/wcwidth/__init__.py       2020-06-23 18:08:54.000000000 
+0200
@@ -30,4 +30,8 @@
 # these always bit me, too, so I can sympathize -- this version is now manually
 # kept in sync with version.json to help them out. Shucks, this variable is 
just
 # for legacy, from the days before 'pip freeze' was a thing.
-__version__ = '0.2.4'
+#
+# We also used pkg_resources to load unicode version tables from version.json,
+# generated by bin/update-tables.py, but some environments are unable to
+# import pkg_resources for one reason or another, yikes!
+__version__ = '0.2.5'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/table_wide.py 
new/wcwidth-0.2.5/wcwidth/table_wide.py
--- old/wcwidth-0.2.4/wcwidth/table_wide.py     2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/wcwidth/table_wide.py     2020-06-23 18:08:54.000000000 
+0200
@@ -1,5 +1,5 @@
 """Wide_Eastasian table, created by bin/update-tables.py."""
-# Generated: 2020-06-01T15:38:29.249643
+# Generated: 2020-06-23T15:58:41.860748
 WIDE_EASTASIAN = {
     '4.1.0': (
         # Source: EastAsianWidth-4.1.0.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/table_zero.py 
new/wcwidth-0.2.5/wcwidth/table_zero.py
--- old/wcwidth-0.2.4/wcwidth/table_zero.py     2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/wcwidth/table_zero.py     2020-06-23 18:08:54.000000000 
+0200
@@ -1,5 +1,5 @@
 """Zero_Width table, created by bin/update-tables.py."""
-# Generated: 2020-06-01T15:38:31.292746
+# Generated: 2020-06-23T15:58:43.900697
 ZERO_WIDTH = {
     '4.1.0': (
         # Source: DerivedGeneralCategory-4.1.0.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/unicode_versions.py 
new/wcwidth-0.2.5/wcwidth/unicode_versions.py
--- old/wcwidth-0.2.4/wcwidth/unicode_versions.py       1970-01-01 
01:00:00.000000000 +0100
+++ new/wcwidth-0.2.5/wcwidth/unicode_versions.py       2020-06-23 
18:08:54.000000000 +0200
@@ -0,0 +1,35 @@
+"""
+Exports function list_versions() for unicode version level support.
+
+This code generated by bin/update-tables.py on 2020-06-23 15:58:44.035540.
+"""
+
+
+def list_versions():
+    """
+    Return Unicode version levels supported by this module release.
+
+    Any of the version strings returned may be used as keyword argument
+    ``unicode_version`` to the ``wcwidth()`` family of functions.
+
+    :returns: Supported Unicode version numbers in ascending sorted order.
+    :rtype: list[str]
+    """
+    return (
+        "4.1.0",
+        "5.0.0",
+        "5.1.0",
+        "5.2.0",
+        "6.0.0",
+        "6.1.0",
+        "6.2.0",
+        "6.3.0",
+        "7.0.0",
+        "8.0.0",
+        "9.0.0",
+        "10.0.0",
+        "11.0.0",
+        "12.0.0",
+        "12.1.0",
+        "13.0.0",
+    )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/version.json 
new/wcwidth-0.2.5/wcwidth/version.json
--- old/wcwidth-0.2.4/wcwidth/version.json      2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/wcwidth/version.json      1970-01-01 01:00:00.000000000 
+0100
@@ -1 +0,0 @@
-{"tables": ["4.1.0", "5.0.0", "5.1.0", "5.2.0", "6.0.0", "6.1.0", "6.2.0", 
"6.3.0", "7.0.0", "8.0.0", "9.0.0", "10.0.0", "11.0.0", "12.0.0", "12.1.0", 
"13.0.0"], "package": "0.2.4", "default": "8.0.0"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wcwidth-0.2.4/wcwidth/wcwidth.py 
new/wcwidth-0.2.5/wcwidth/wcwidth.py
--- old/wcwidth-0.2.4/wcwidth/wcwidth.py        2020-06-08 05:37:40.000000000 
+0200
+++ new/wcwidth-0.2.5/wcwidth/wcwidth.py        2020-06-23 18:08:54.000000000 
+0200
@@ -65,15 +65,12 @@
 # std imports
 import os
 import sys
-import json
 import warnings
 
-# 3rd party
-import pkg_resources
-
 # local
 from .table_wide import WIDE_EASTASIAN
 from .table_zero import ZERO_WIDTH
+from .unicode_versions import list_versions
 
 try:
     from functools import lru_cache
@@ -252,25 +249,6 @@
     return width
 
 
-@lru_cache(maxsize=1)
-def list_versions():
-    """
-    Return Unicode version levels supported by this module release.
-
-    Any of the version strings returned may be used as keyword argument
-    ``unicode_version`` to the ``wcwidth()`` family of functions.
-
-    :returns: Supported Unicode version numbers in ascending sorted order.
-    :rtype: list[str]
-    """
-    # load from 'version.json', use setuptools to access
-    # resource string so that the package is zip/wheel-compatible.
-    return json.loads(
-        pkg_resources.resource_string(
-            'wcwidth', "version.json"
-        ).decode('utf8'))['tables']
-
-
 @lru_cache(maxsize=128)
 def _wcversion_value(ver_string):
     """
@@ -395,16 +373,3 @@
         if cmp_next_version > cmp_given:
             return unicode_version
     assert False, ("Code path unreachable", given_version, unicode_versions)
-
-
-def _get_package_version():
-    """
-    Version of wcwidth (produces module-level ``__version__`` val).
-
-    :rtype: str
-    :return: the version of the wcwidth library package.
-    """
-    return json.loads(
-        pkg_resources.resource_string(
-            'wcwidth', "version.json"
-        ).decode('utf8'))['package']


Reply via email to