Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-importlab for 
openSUSE:Factory checked in at 2022-10-29 20:17:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-importlab (Old)
 and      /work/SRC/openSUSE:Factory/.python-importlab.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-importlab"

Sat Oct 29 20:17:37 2022 rev:7 rq:1032186 version:0.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-importlab/python-importlab.changes        
2022-09-29 18:14:54.847437971 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-importlab.new.2275/python-importlab.changes  
    2022-10-29 20:18:43.570728357 +0200
@@ -2 +2 @@
-Thu Sep 29 02:39:43 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+Fri Oct 28 17:41:56 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
@@ -6,0 +7,3 @@
+
+-------------------------------------------------------------------
+Thu Sep 29 02:39:43 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>

Old:
----
  importlab-0.7.tar.gz

New:
----
  importlab-0.8.tar.gz

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

Other differences:
------------------
++++++ python-importlab.spec ++++++
--- /var/tmp/diff_new_pack.GIjX8B/_old  2022-10-29 20:18:44.010730702 +0200
+++ /var/tmp/diff_new_pack.GIjX8B/_new  2022-10-29 20:18:44.018730744 +0200
@@ -21,7 +21,7 @@
 # python36-networkx no longer exists in Tumbleweed (due to SciPy following NEP 
29)
 %define         skip_python36 1
 Name:           python-importlab
-Version:        0.7
+Version:        0.8
 Release:        0
 Summary:        A library to calculate python dependency graphs
 License:        Apache-2.0

++++++ importlab-0.7.tar.gz -> importlab-0.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/CHANGELOG new/importlab-0.8/CHANGELOG
--- old/importlab-0.7/CHANGELOG 2022-01-07 22:55:21.000000000 +0100
+++ new/importlab-0.8/CHANGELOG 2022-09-22 21:26:33.000000000 +0200
@@ -1,3 +1,7 @@
+Version 0.8 (2022-09-22)
+* Add --version to bin importlab.
+* Use ImportStatement.source to impove import resolution.
+
 Version 0.7 (2022-01-07)
 * Fix path resolution for case-insensitive filesystems.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/PKG-INFO new/importlab-0.8/PKG-INFO
--- old/importlab-0.7/PKG-INFO  2022-01-07 23:08:30.701219600 +0100
+++ new/importlab-0.8/PKG-INFO  2022-09-23 00:35:42.746949200 +0200
@@ -1,84 +1,11 @@
-Metadata-Version: 1.2
+Metadata-Version: 2.1
 Name: importlab
-Version: 0.7
+Version: 0.8
 Summary: A library to calculate python dependency graphs.
 Home-page: https://github.com/google/importlab
 Maintainer: Google Inc.
 Maintainer-email: pytype-...@google.com
 License: Apache 2.0
-Description: 
-        importlab
-        ---------
-        
-        Importlab is a library for Python that automatically infers 
dependencies
-        and calculates a dependency graph. It can perform dependency ordering 
of
-        a set of files, including cycle detection.
-        
-        Importlab's main use case is to work with static analysis tools that
-        process one file at a time, ensuring that a file's dependencies are
-        analysed before it is.
-        
-        (This is not an official Google product.)
-        
-        License
-        -------
-        
-        Apache 2.0
-        
-        Installation
-        ------------
-        
-        Importlab can be installed from pip
-        
-        ::
-        
-            pip install importlab
-        
-        To check out and install the latest source code
-        
-        ::
-        
-            git clone https://github.com/google/importlab.git
-            cd importlab
-            python setup.py install
-        
-        Usage
-        -----
-        
-        Importlab is primarily intended to be used as a library. It takes one 
or
-        more python files as arguments, and generates an import graph, 
typically
-        used to process files in dependency order.
-        
-        It is currently integrated into
-        `pytype <https://github.com/google/pytype>`__
-        
-        Command-line tool
-        -----------------
-        
-        Importlab ships with a small command-line tool, also called
-        ``importlab``, which can display some information about a project's
-        import graph.
-        
-        ::
-        
-            usage: importlab [-h] [--tree] [--unresolved] [filename [filename 
...]]
-        
-            positional arguments:
-              filename              input file(s)
-        
-            optional arguments:
-              -h, --help            show this help message and exit
-              --tree                Display import tree.
-              --unresolved          Display unresolved dependencies.
-        
-        Roadmap
-        -------
-        
-        -  ``Makefile`` generation, to take advantage of ``make``'s incremental
-           update and parallel execution features
-        
-        -  Integration with other static analysis tools
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers
@@ -88,3 +15,79 @@
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Topic :: Software Development
 Requires-Python: >=3.6.0
+License-File: LICENSE
+
+
+importlab
+---------
+
+Importlab is a library for Python that automatically infers dependencies
+and calculates a dependency graph. It can perform dependency ordering of
+a set of files, including cycle detection.
+
+Importlab's main use case is to work with static analysis tools that
+process one file at a time, ensuring that a file's dependencies are
+analysed before it is.
+
+(This is not an official Google product.)
+
+License
+-------
+
+Apache 2.0
+
+Installation
+------------
+
+Importlab can be installed from pip
+
+::
+
+    pip install importlab
+
+To check out and install the latest source code
+
+::
+
+    git clone https://github.com/google/importlab.git
+    cd importlab
+    python setup.py install
+
+Usage
+-----
+
+Importlab is primarily intended to be used as a library. It takes one or
+more python files as arguments, and generates an import graph, typically
+used to process files in dependency order.
+
+It is currently integrated into
+`pytype <https://github.com/google/pytype>`__
+
+Command-line tool
+-----------------
+
+Importlab ships with a small command-line tool, also called
+``importlab``, which can display some information about a project's
+import graph.
+
+::
+
+    usage: importlab [-h] [--tree] [--unresolved] [filename [filename ...]]
+
+    positional arguments:
+      filename              input file(s)
+
+    optional arguments:
+      -h, --help            show this help message and exit
+      --tree                Display import tree.
+      --unresolved          Display unresolved dependencies.
+
+Roadmap
+-------
+
+-  ``Makefile`` generation, to take advantage of ``make``'s incremental
+   update and parallel execution features
+
+-  Integration with other static analysis tools
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/bin/importlab 
new/importlab-0.8/bin/importlab
--- old/importlab-0.7/bin/importlab     2022-01-07 22:51:34.000000000 +0100
+++ new/importlab-0.8/bin/importlab     2022-04-23 01:16:51.000000000 +0200
@@ -21,6 +21,7 @@
 import argparse
 import os
 import sys
+from importlib.metadata import version
 
 from importlab import environment
 from importlab import graph
@@ -51,6 +52,8 @@
                         default=False,
                         help=('Trim the dependencies of builtin and system '
                               'files.'))
+    parser.add_argument('-v', '--version', action='version', 
version=version('importlab'),
+                        help='Script version')
     return parser.parse_args()
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/importlab/resolve.py 
new/importlab-0.8/importlab/resolve.py
--- old/importlab-0.7/importlab/resolve.py      2022-01-07 22:51:34.000000000 
+0100
+++ new/importlab-0.8/importlab/resolve.py      2022-09-22 21:19:37.000000000 
+0200
@@ -185,8 +185,25 @@
             filename = os.path.normpath(
                 os.path.join(self.current_directory, filename))
 
-        files = [(name, filename)]
-        if short_name:
+        if not short_name:
+            try_filename = True
+            try_short_filename = False
+        elif item.source:
+            # If the import has a source path, we can use it to eliminate
+            # filenames that don't match.
+            source_filename, _ = os.path.splitext(item.source)
+            dirname, basename = os.path.split(source_filename)
+            if basename == "__init__":
+                source_filename = dirname
+            try_filename = source_filename.endswith(filename)
+            try_short_filename = not try_filename
+        else:
+            try_filename = try_short_filename = True
+
+        files = []
+        if try_filename:
+            files.append((name, filename))
+        if try_short_filename:
             short_filename = os.path.dirname(filename)
             files.append((short_name, short_filename))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/importlab.egg-info/PKG-INFO 
new/importlab-0.8/importlab.egg-info/PKG-INFO
--- old/importlab-0.7/importlab.egg-info/PKG-INFO       2022-01-07 
23:08:30.000000000 +0100
+++ new/importlab-0.8/importlab.egg-info/PKG-INFO       2022-09-23 
00:35:42.000000000 +0200
@@ -1,84 +1,11 @@
-Metadata-Version: 1.2
+Metadata-Version: 2.1
 Name: importlab
-Version: 0.7
+Version: 0.8
 Summary: A library to calculate python dependency graphs.
 Home-page: https://github.com/google/importlab
 Maintainer: Google Inc.
 Maintainer-email: pytype-...@google.com
 License: Apache 2.0
-Description: 
-        importlab
-        ---------
-        
-        Importlab is a library for Python that automatically infers 
dependencies
-        and calculates a dependency graph. It can perform dependency ordering 
of
-        a set of files, including cycle detection.
-        
-        Importlab's main use case is to work with static analysis tools that
-        process one file at a time, ensuring that a file's dependencies are
-        analysed before it is.
-        
-        (This is not an official Google product.)
-        
-        License
-        -------
-        
-        Apache 2.0
-        
-        Installation
-        ------------
-        
-        Importlab can be installed from pip
-        
-        ::
-        
-            pip install importlab
-        
-        To check out and install the latest source code
-        
-        ::
-        
-            git clone https://github.com/google/importlab.git
-            cd importlab
-            python setup.py install
-        
-        Usage
-        -----
-        
-        Importlab is primarily intended to be used as a library. It takes one 
or
-        more python files as arguments, and generates an import graph, 
typically
-        used to process files in dependency order.
-        
-        It is currently integrated into
-        `pytype <https://github.com/google/pytype>`__
-        
-        Command-line tool
-        -----------------
-        
-        Importlab ships with a small command-line tool, also called
-        ``importlab``, which can display some information about a project's
-        import graph.
-        
-        ::
-        
-            usage: importlab [-h] [--tree] [--unresolved] [filename [filename 
...]]
-        
-            positional arguments:
-              filename              input file(s)
-        
-            optional arguments:
-              -h, --help            show this help message and exit
-              --tree                Display import tree.
-              --unresolved          Display unresolved dependencies.
-        
-        Roadmap
-        -------
-        
-        -  ``Makefile`` generation, to take advantage of ``make``'s incremental
-           update and parallel execution features
-        
-        -  Integration with other static analysis tools
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Intended Audience :: Developers
@@ -88,3 +15,79 @@
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Topic :: Software Development
 Requires-Python: >=3.6.0
+License-File: LICENSE
+
+
+importlab
+---------
+
+Importlab is a library for Python that automatically infers dependencies
+and calculates a dependency graph. It can perform dependency ordering of
+a set of files, including cycle detection.
+
+Importlab's main use case is to work with static analysis tools that
+process one file at a time, ensuring that a file's dependencies are
+analysed before it is.
+
+(This is not an official Google product.)
+
+License
+-------
+
+Apache 2.0
+
+Installation
+------------
+
+Importlab can be installed from pip
+
+::
+
+    pip install importlab
+
+To check out and install the latest source code
+
+::
+
+    git clone https://github.com/google/importlab.git
+    cd importlab
+    python setup.py install
+
+Usage
+-----
+
+Importlab is primarily intended to be used as a library. It takes one or
+more python files as arguments, and generates an import graph, typically
+used to process files in dependency order.
+
+It is currently integrated into
+`pytype <https://github.com/google/pytype>`__
+
+Command-line tool
+-----------------
+
+Importlab ships with a small command-line tool, also called
+``importlab``, which can display some information about a project's
+import graph.
+
+::
+
+    usage: importlab [-h] [--tree] [--unresolved] [filename [filename ...]]
+
+    positional arguments:
+      filename              input file(s)
+
+    optional arguments:
+      -h, --help            show this help message and exit
+      --tree                Display import tree.
+      --unresolved          Display unresolved dependencies.
+
+Roadmap
+-------
+
+-  ``Makefile`` generation, to take advantage of ``make``'s incremental
+   update and parallel execution features
+
+-  Integration with other static analysis tools
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/setup.py new/importlab-0.8/setup.py
--- old/importlab-0.7/setup.py  2022-01-07 22:58:05.000000000 +0100
+++ new/importlab-0.8/setup.py  2022-09-22 21:26:33.000000000 +0200
@@ -13,7 +13,7 @@
 EMAIL = 'pytype-...@google.com'
 AUTHOR = 'Google Inc.'
 REQUIRES_PYTHON = '>=3.6.0'
-VERSION = '0.7'
+VERSION = '0.8'
 
 REQUIRED = [
     'networkx>=2',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/tests/test_parsepy.py 
new/importlab-0.8/tests/test_parsepy.py
--- old/importlab-0.7/tests/test_parsepy.py     2018-09-11 00:27:10.000000000 
+0200
+++ new/importlab-0.8/tests/test_parsepy.py     2022-04-23 01:16:51.000000000 
+0200
@@ -25,8 +25,6 @@
 class TestParsePy(unittest.TestCase):
     """Tests for parsepy.py."""
 
-    PYTHON_VERSION = (2, 7)
-
     def parse(self, src):
         with tempfile.NamedTemporaryFile() as f:
             src = textwrap.dedent(src)
@@ -34,7 +32,7 @@
                 src = src.encode('utf-8')
             f.write(src)
             f.flush()
-            return parsepy.get_imports(f.name, self.PYTHON_VERSION)
+            return parsepy.get_imports(f.name, sys.version_info[:2])
 
     def test_simple(self):
         self.assertEqual(self.parse("""
@@ -185,11 +183,6 @@
       import a
     """), [parsepy.ImportStatement(name='a')])
 
-    def test_print_statement(self):
-        self.assertEqual(self.parse("""
-      print "hello", "world", "!"
-    """), [])
-
     def test_print_function(self):
         self.assertEqual(self.parse("""
       from __future__ import print_function
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/importlab-0.7/tests/test_resolve.py 
new/importlab-0.8/tests/test_resolve.py
--- old/importlab-0.7/tests/test_resolve.py     2022-01-07 22:51:34.000000000 
+0100
+++ new/importlab-0.8/tests/test_resolve.py     2022-09-22 21:19:37.000000000 
+0200
@@ -288,6 +288,27 @@
         with self.assertRaises(resolve.ImportException):
             r.resolve_import(imp)
 
+    def testResolveWithImportSource(self):
+        for source, expected_resolution in [("z.py", "pyi"),
+                                            ("z/__init__.py", "pyi"),
+                                            ("z/zz.py", "system"),
+                                            ("z/zz/__init__.py", "system")]:
+            for pyi in ["z.pyi", "z/__init__.pyi"]:
+                with self.subTest(source=source, pyi=pyi):
+                    pyis = {pyi: "contents of z", **PYI_FILES}
+                    pyi_fs = fs.PYIFileSystem(fs.StoredFileSystem(pyis))
+                    self.path = [pyi_fs, self.py_fs]
+                    r = self.make_resolver("a.py", "a")
+                    imp = parsepy.ImportStatement(
+                        name="z.zz", new_name="zz", is_from=True, 
source=source)
+                    f = r.resolve_import(imp)
+                    if expected_resolution == "pyi":
+                        self.assertEqual(f.fs, pyi_fs)
+                        self.assertEqual(f.path, pyi)
+                    else:
+                        assert expected_resolution == "system"
+                        self.assertTrue(isinstance(f, resolve.System))
+
 
 class TestResolverUtils(unittest.TestCase):
     """Tests for utility functions."""

Reply via email to