Hello community,

here is the log from the commit of package python-Arpeggio for openSUSE:Factory 
checked in at 2019-06-18 14:49:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Arpeggio (Old)
 and      /work/SRC/openSUSE:Factory/.python-Arpeggio.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Arpeggio"

Tue Jun 18 14:49:33 2019 rev:5 rq:709299 version:1.9.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Arpeggio/python-Arpeggio.changes  
2019-03-22 14:59:48.233850721 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-Arpeggio.new.4811/python-Arpeggio.changes    
    2019-06-18 14:49:41.769677008 +0200
@@ -1,0 +2,17 @@
+Wed Jun 12 05:09:35 UTC 2019 - Matej Cepl <mc...@suse.com>
+
+- Update imp-to-importlib.patch to deal with irregular imports as well.
+
+-------------------------------------------------------------------
+Tue Jun 11 20:52:07 CEST 2019 - Matej Cepl <mc...@suse.com>
+
+- It's better to fix a bug, than to switch off test. Add
+  imp-to-importlib.patch replacing use of imp library in Python
+  3 with importlib. gh#textX/Arpeggio#54
+
+-------------------------------------------------------------------
+Tue Jun 11 13:14:44 UTC 2019 - Tomáš Chvátal <tchva...@suse.com>
+
+- Skip one randomly failing test
+
+-------------------------------------------------------------------

New:
----
  imp-to-importlib.patch

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

Other differences:
------------------
++++++ python-Arpeggio.spec ++++++
--- /var/tmp/diff_new_pack.gF8xLg/_old  2019-06-18 14:49:42.645676618 +0200
+++ /var/tmp/diff_new_pack.gF8xLg/_new  2019-06-18 14:49:42.649676617 +0200
@@ -23,14 +23,16 @@
 Summary:        Packrat parser interpreter
 License:        MIT
 Group:          Development/Languages/Python
-Url:            https://github.com/textX/Arpeggio/
+URL:            https://github.com/textX/Arpeggio/
 Source:         https://github.com/textX/Arpeggio/archive/v%{version}.tar.gz
+# PATCH-FIX-UPSTREAM imp-to-importlib.patch gh#textX/Arpeggio#54 mc...@suse.com
+# Replace use of imp library with importlib.
+Patch0:         imp-to-importlib.patch
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -42,6 +44,7 @@
 
 %prep
 %setup -q -n Arpeggio-%{version}
+%autopatch -p1
 
 %build
 %python_build
@@ -51,7 +54,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
py.test-%{$python_bin_suffix} -v tests/unit
+%pytest tests/unit
 
 %files %{python_files}
 %doc README.rst CHANGELOG AUTHORS.md

++++++ imp-to-importlib.patch ++++++
--- a/tests/unit/test_examples.py
+++ b/tests/unit/test_examples.py
@@ -7,11 +7,16 @@
 # License: MIT License
 #######################################################################
 import pytest   # noqa
+import logging
 import os
 import sys
 import glob
-import imp
 
+PY2 = sys.version_info[0] < 3
+if PY2:
+    import imp
+else:
+    import importlib
 
 def test_examples():
 
@@ -24,10 +29,18 @@ def test_examples():
         example_dir = os.path.dirname(e)
         sys.path.insert(0, example_dir)
         (module_name, _) = os.path.splitext(os.path.basename(e))
-        (module_file, module_path, desc) = \
-            imp.find_module(module_name, [example_dir])
+        if PY2:
+            (module_file, module_path, desc) = \
+                imp.find_module(module_name, [example_dir])
+            try:
+                mod = imp.load_module(module_name, module_file, module_path, 
desc)
+            except ImportError:
+                logging.exception('Error when processing %s', module_name)
+                raise
+        else:
+            mod_spec = importlib.util.spec_from_file_location(module_name, e)
+            mod = importlib.util.module_from_spec(mod_spec)
+            mod_spec.loader.exec_module(mod)
 
-        m = imp.load_module(module_name, module_file, module_path, desc)
-
-        if hasattr(m, 'main'):
-            m.main(debug=False)
+        if hasattr(mod, 'main'):
+            mod.main(debug=False)
--- a/examples/csv/csv_peg.py
+++ b/examples/csv/csv_peg.py
@@ -10,7 +10,7 @@ import os
 import pprint
 from arpeggio import visit_parse_tree
 from arpeggio.cleanpeg import ParserPEG
-from csv import CSVVisitor
+from examples.csv.csv import CSVVisitor
 
 def main(debug=False):
     # First we will make a parser - an instance of the CVS parser model.
--- /dev/null
+++ b/examples/__init__.py
@@ -0,0 +1 @@
+# Comment left intentionally blank

Reply via email to