Hello community,

here is the log from the commit of package python-dephell-discover for 
openSUSE:Factory checked in at 2019-12-18 14:46:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dephell-discover (Old)
 and      /work/SRC/openSUSE:Factory/.python-dephell-discover.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-dephell-discover"

Wed Dec 18 14:46:43 2019 rev:4 rq:757711 version:0.2.10

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-dephell-discover/python-dephell-discover.changes
  2019-09-13 15:05:13.217257987 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-dephell-discover.new.4691/python-dephell-discover.changes
        2019-12-18 14:48:49.317952436 +0100
@@ -1,0 +2,7 @@
+Wed Dec 18 11:23:44 CET 2019 - Matej Cepl <mc...@suse.com>
+
+- Update to 0.2.10:
+  - Fix default package_dir format
+  - Python 3.8 support
+
+-------------------------------------------------------------------

Old:
----
  dephell_discover-0.2.8.tar.gz

New:
----
  dephell_discover-0.2.10.tar.gz

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

Other differences:
------------------
++++++ python-dephell-discover.spec ++++++
--- /var/tmp/diff_new_pack.DQdL5i/_old  2019-12-18 14:48:49.641952585 +0100
+++ /var/tmp/diff_new_pack.DQdL5i/_new  2019-12-18 14:48:49.645952587 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-dephell-discover
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-dephell-discover
-Version:        0.2.8
+Version:        0.2.10
 Release:        0
 Summary:        Module to find project modules and data files
 License:        MIT

++++++ dephell_discover-0.2.8.tar.gz -> dephell_discover-0.2.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/PKG-INFO 
new/dephell_discover-0.2.10/PKG-INFO
--- old/dephell_discover-0.2.8/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/dephell_discover-0.2.10/PKG-INFO        1970-01-01 01:00:00.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dephell-discover
-Version: 0.2.8
+Version: 0.2.10
 Summary: Find project modules and data files (packages and package_data for 
setup.py).
 Project-URL: Repository, https://github.com/dephell/dephell_discover
 Author: Gram
@@ -66,7 +66,7 @@
    # {Data(path=Path('../dephell/dephell/templates'), ext='.j2', 
package=Package(...)), ...}
 
    root.package_dir
-   # {'': ''}
+   # {'': '.'}
 
 Package properties:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/README.md 
new/dephell_discover-0.2.10/README.md
--- old/dephell_discover-0.2.8/README.md        2019-05-21 16:43:43.000000000 
+0200
+++ new/dephell_discover-0.2.10/README.md       2019-11-13 11:59:39.000000000 
+0100
@@ -31,7 +31,7 @@
 # {Data(path=Path('../dephell/dephell/templates'), ext='.j2', 
package=Package(...)), ...}
 
 root.package_dir
-# {'': ''}
+# {'': '.'}
 ```
 
 Package properties:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/README.rst 
new/dephell_discover-0.2.10/README.rst
--- old/dephell_discover-0.2.8/README.rst       2019-07-15 15:53:45.000000000 
+0200
+++ new/dephell_discover-0.2.10/README.rst      2019-11-13 12:09:30.000000000 
+0100
@@ -48,7 +48,7 @@
    # {Data(path=Path('../dephell/dephell/templates'), ext='.j2', 
package=Package(...)), ...}
 
    root.package_dir
-   # {'': ''}
+   # {'': '.'}
 
 Package properties:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/dephell_discover/__init__.py 
new/dephell_discover-0.2.10/dephell_discover/__init__.py
--- old/dephell_discover-0.2.8/dephell_discover/__init__.py     2019-07-15 
15:53:26.000000000 +0200
+++ new/dephell_discover-0.2.10/dephell_discover/__init__.py    2019-11-13 
12:09:24.000000000 +0100
@@ -9,7 +9,7 @@
 from ._root import Root
 
 
-__version__ = '0.2.8'
+__version__ = '0.2.10'
 __author__ = 'Gram (@orsinium)'
 __license__ = 'MIT'
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/dephell_discover/_line.py 
new/dephell_discover-0.2.10/dephell_discover/_line.py
--- old/dephell_discover-0.2.8/dephell_discover/_line.py        2019-07-15 
15:52:45.000000000 +0200
+++ new/dephell_discover-0.2.10/dephell_discover/_line.py       2019-11-12 
13:21:49.000000000 +0100
@@ -1,5 +1,6 @@
 import ast
 from pathlib import Path
+import sys
 from typing import Optional
 
 import attr
@@ -7,6 +8,20 @@
 from ._constants import DOCSTRING
 
 
+def _get_str(node) -> Optional[str]:
+    # python <3.8
+    if sys.version_info[:2] < (3, 8):
+        if type(node) is ast.Str:
+            return node.s
+        return None
+
+    # python >=3.8
+    if type(node) is ast.Constant:
+        if type(node.value) is str:
+            return node.value
+    return None
+
+
 @attr.s(frozen=True)
 class Line:
     target = attr.ib(type=str)
@@ -50,26 +65,28 @@
         if target.id not in cls._vars:
             return None
 
-        value = tree.body[0].value  # type: ignore
+        expr = tree.body[0].value  # type: ignore
 
         # get string
-        if type(value) is ast.Str:
+        value = _get_str(expr)
+        if value:
             return cls(
                 target=target.id,
-                value=value.s,
+                value=value,
                 content=content,
                 row=row,
                 path=path,
             )
 
         # get list
-        if type(value) is ast.List or type(value) is ast.Tuple:
-            for element in value.elts:
-                if type(element) is not ast.Str:
+        if type(expr) is ast.List or type(expr) is ast.Tuple:
+            elements = [_get_str(element) for element in expr.elts]
+            for element in elements:
+                if element is None:
                     return None
             return cls(
                 target=target.id,
-                value=[element.s for element in value.elts],
+                value=elements,
                 content=content,
                 row=row,
                 path=path,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/dephell_discover/_root.py 
new/dephell_discover-0.2.10/dephell_discover/_root.py
--- old/dephell_discover-0.2.8/dephell_discover/_root.py        2019-07-15 
15:52:45.000000000 +0200
+++ new/dephell_discover-0.2.10/dephell_discover/_root.py       2019-11-13 
12:09:09.000000000 +0100
@@ -40,7 +40,7 @@
             return {self.name: ''}
 
         # when packages placed in the dirs by package names
-        return {'': ''}
+        return {'': '.'}
 
     @cached_property
     def packages(self) -> List[Package]:
@@ -116,7 +116,7 @@
     def _get_module_name(self, path: Path) -> str:
         parts = list(path.parts[len(self.path.parts):])
         root_name, root_dir = next(iter(self.package_dir.items()))
-        if root_dir == '':
+        if root_dir in ('', '.'):
             parts.insert(0, root_name)
         elif parts and parts[0] == root_dir:
             parts = [root_name] + parts[1:]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dephell_discover-0.2.8/dephell_discover.egg-info/PKG-INFO 
new/dephell_discover-0.2.10/dephell_discover.egg-info/PKG-INFO
--- old/dephell_discover-0.2.8/dephell_discover.egg-info/PKG-INFO       
1970-01-01 01:00:00.000000000 +0100
+++ new/dephell_discover-0.2.10/dephell_discover.egg-info/PKG-INFO      
1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dephell-discover
-Version: 0.2.8
+Version: 0.2.10
 Summary: Find project modules and data files (packages and package_data for 
setup.py).
 Project-URL: Repository, https://github.com/dephell/dephell_discover
 Author: Gram
@@ -66,7 +66,7 @@
    # {Data(path=Path('../dephell/dephell/templates'), ext='.j2', 
package=Package(...)), ...}
 
    root.package_dir
-   # {'': ''}
+   # {'': '.'}
 
 Package properties:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dephell_discover-0.2.8/dephell_discover.egg-info/SOURCES.txt 
new/dephell_discover-0.2.10/dephell_discover.egg-info/SOURCES.txt
--- old/dephell_discover-0.2.8/dephell_discover.egg-info/SOURCES.txt    
1970-01-01 01:00:00.000000000 +0100
+++ new/dephell_discover-0.2.10/dephell_discover.egg-info/SOURCES.txt   
1970-01-01 01:00:00.000000000 +0100
@@ -3,10 +3,10 @@
 setup.cfg
 setup.py
 dephell_discover/_constants.py
+dephell_discover/_package.py
+dephell_discover/_data.py
 dephell_discover/_cached_propery.py
-dephell_discover/_line.py
 dephell_discover/__init__.py
-dephell_discover/_package.py
 dephell_discover/_root.py
-dephell_discover/_data.py
-dephell_discover/_metainfo.py
\ No newline at end of file
+dephell_discover/_metainfo.py
+dephell_discover/_line.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/setup.py 
new/dephell_discover-0.2.10/setup.py
--- old/dephell_discover-0.2.8/setup.py 2019-07-15 15:53:45.000000000 +0200
+++ new/dephell_discover-0.2.10/setup.py        2019-11-13 12:09:30.000000000 
+0100
@@ -21,7 +21,7 @@
 setup(
     long_description=readme,
     name='dephell_discover',
-    version='0.2.8',
+    version='0.2.10',
     description='Find project modules and data files (packages and 
package_data for setup.py).',
     python_requires='>=3.5',
     project_urls={'repository': 'https://github.com/dephell/dephell_discover'},
@@ -37,6 +37,7 @@
         'Topic :: Software Development :: Libraries :: Python Modules'
     ],
     packages=['dephell_discover'],
+    package_dir={'': '.'},
     package_data={},
     install_requires=['attrs'],
 )
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/__init__.cpython-36.pyc and 
new/dephell_discover-0.2.10/tests/__pycache__/__init__.cpython-36.pyc differ
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/__init__.cpython-37.pyc and 
new/dephell_discover-0.2.10/tests/__pycache__/__init__.cpython-37.pyc differ
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/test_metainfo.cpython-36-PYTEST.pyc
 and 
new/dephell_discover-0.2.10/tests/__pycache__/test_metainfo.cpython-36-PYTEST.pyc
 differ
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/test_metainfo.cpython-37-pytest-5.2.2.pyc
 and 
new/dephell_discover-0.2.10/tests/__pycache__/test_metainfo.cpython-37-pytest-5.2.2.pyc
 differ
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/test_root.cpython-36-PYTEST.pyc 
and 
new/dephell_discover-0.2.10/tests/__pycache__/test_root.cpython-36-PYTEST.pyc 
differ
Binary files 
old/dephell_discover-0.2.8/tests/__pycache__/test_root.cpython-37-pytest-5.2.2.pyc
 and 
new/dephell_discover-0.2.10/tests/__pycache__/test_root.cpython-37-pytest-5.2.2.pyc
 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_discover-0.2.8/tests/test_root.py 
new/dephell_discover-0.2.10/tests/test_root.py
--- old/dephell_discover-0.2.8/tests/test_root.py       2019-05-21 
16:43:43.000000000 +0200
+++ new/dephell_discover-0.2.10/tests/test_root.py      2019-11-13 
11:59:39.000000000 +0100
@@ -40,7 +40,7 @@
 
 
 @pytest.mark.parametrize('files, expected', [
-    [('foobar/__init__.py', 'foobar/foo.py', 'foobar/bar.py'), {'': ''}],
+    [('foobar/__init__.py', 'foobar/foo.py', 'foobar/bar.py'), {'': '.'}],
     [('src/__init__.py', 'src/foo.py', 'src/bar.py'), {'foobar': 'src'}],
     [('src/foo.py', 'src/bar.py'), {'': 'src'}],
     [('__init__.py', 'foo.py', 'bar.py'), {'foobar': ''}],


Reply via email to