Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-entrypoints for 
openSUSE:Factory checked in at 2022-10-10 18:43:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-entrypoints (Old)
 and      /work/SRC/openSUSE:Factory/.python-entrypoints.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-entrypoints"

Mon Oct 10 18:43:21 2022 rev:7 rq:1008558 version:0.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-entrypoints/python-entrypoints.changes    
2020-03-27 00:25:37.300266659 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-entrypoints.new.2275/python-entrypoints.changes
  2022-10-10 18:43:25.614721995 +0200
@@ -1,0 +2,10 @@
+Thu Oct  6 14:25:37 UTC 2022 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 0.4:
+  * Use set comprehension
+  * Fix link to entry_points
+  * Treat editable installs as Distributions too
+  * Document motvation / constrast to pkg_resources
+  * Switch build-backend to flit_core
+
+-------------------------------------------------------------------

Old:
----
  entrypoints-0.3.tar.gz

New:
----
  entrypoints-0.4.tar.gz

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

Other differences:
------------------
++++++ python-entrypoints.spec ++++++
--- /var/tmp/diff_new_pack.g2qDMj/_old  2022-10-10 18:43:26.138723122 +0200
+++ /var/tmp/diff_new_pack.g2qDMj/_new  2022-10-10 18:43:26.142723131 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-entrypoints
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,14 +19,16 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %bcond_without python2
 Name:           python-entrypoints
-Version:        0.3
+Version:        0.4
 Release:        0
 Summary:        Discover and load entry points from installed packages
 License:        MIT
 URL:            https://github.com/takluyver/entrypoints
 Source:         
https://files.pythonhosted.org/packages/source/e/entrypoints/entrypoints-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module flit-core}
+BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
@@ -52,10 +54,10 @@
 %setup -q -n entrypoints-%{version}
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
@@ -65,6 +67,6 @@
 %license LICENSE
 %{python_sitelib}/entrypoints.py*
 %pycache_only %{python_sitelib}/__pycache__/entrypoints*.py*
-%{python_sitelib}/entrypoints-%{version}-py*.egg-info
+%{python_sitelib}/entrypoints-%{version}.dist-info
 
 %changelog

++++++ entrypoints-0.3.tar.gz -> entrypoints-0.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/.github/workflows/test.yml 
new/entrypoints-0.4/.github/workflows/test.yml
--- old/entrypoints-0.3/.github/workflows/test.yml      1970-01-01 
01:00:00.000000000 +0100
+++ new/entrypoints-0.4/.github/workflows/test.yml      2022-02-02 
22:24:03.721162600 +0100
@@ -0,0 +1,25 @@
+name: Test
+
+on: [push, pull_request]
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip wheel
+          pip install . pytest
+
+      - name: Run tests
+        run: pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/.travis.yml 
new/entrypoints-0.4/.travis.yml
--- old/entrypoints-0.3/.travis.yml     2018-04-09 13:59:57.228085800 +0200
+++ new/entrypoints-0.4/.travis.yml     1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-language: python
-python:
-  - "3.6"
-  - "3.5"
-  - "3.4"
-  - "2.7"
-install:
-  - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install configparser; fi
-# command to run tests
-script: py.test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/PKG-INFO new/entrypoints-0.4/PKG-INFO
--- old/entrypoints-0.3/PKG-INFO        1970-01-01 01:00:00.000000000 +0100
+++ new/entrypoints-0.4/PKG-INFO        1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +1,50 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: entrypoints
-Version: 0.3
+Version: 0.4
 Summary: Discover and load entry points from installed packages.
 Home-page: https://github.com/takluyver/entrypoints
 Author: Thomas Kluyver
 Author-email: tho...@kluyver.me.uk
+Requires-Python: >=3.6
+Description-Content-Type: text/x-rst
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Programming Language :: Python :: 3
+Project-URL: Documentation, https://entrypoints.readthedocs.io/en/latest/
+
+**This package is in maintenance-only mode.** New code should use the
+`importlib.metadata module 
<https://docs.python.org/3/library/importlib.metadata.html>`_
+in the Python standard library to find and load entry points.
+
+Entry points are a way for Python packages to advertise objects with some
+common interface. The most common examples are ``console_scripts`` entry 
points,
+which define shell commands by identifying a Python function to run.
+
+*Groups* of entry points, such as ``console_scripts``, point to objects with
+similar interfaces. An application might use a group to find its plugins, or
+multiple groups if it has different kinds of plugins.
+
+The **entrypoints** module contains functions to find and load entry points.
+You can install it from PyPI with ``pip install entrypoints``.
+
+To advertise entry points when distributing a package, see
+`entry_points in the Python Packaging User Guide
+<https://packaging.python.org/guides/distributing-packages-using-setuptools/#entry-points>`_.
+
+The ``pkg_resources`` module distributed with ``setuptools`` provides a way to
+discover entrypoints as well, but it contains other functionality unrelated to
+entrypoint discovery, and it does a lot of work at import time.  Merely
+*importing* ``pkg_resources`` causes it to scan the files of all installed
+packages. Thus, in environments where a large number of packages are installed,
+importing ``pkg_resources`` can be very slow (several seconds).
+
+By contrast, ``entrypoints`` is focused solely on entrypoint discovery and it
+is faster. Importing ``entrypoints`` does not scan anything, and getting a
+given entrypoint group performs a more focused scan.
+
+When there are multiple versions of the same distribution in different
+directories on ``sys.path``, ``entrypoints`` follows the rule that the first
+one wins.  In most cases, this follows the logic of imports.  Similarly,
+Entrypoints relies on ``pip`` to ensure that only one ``.dist-info`` or
+``.egg-info`` directory exists for each installed package.  There is no 
reliable
+way to pick which of several `.dist-info` folders accurately relates to the
+importable modules.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/README.rst 
new/entrypoints-0.4/README.rst
--- old/entrypoints-0.3/README.rst      2019-01-07 18:59:21.456033700 +0100
+++ new/entrypoints-0.4/README.rst      2022-02-02 22:24:40.368295200 +0100
@@ -1,3 +1,7 @@
+**This package is in maintenance-only mode.** New code should use the
+`importlib.metadata module 
<https://docs.python.org/3/library/importlib.metadata.html>`_
+in the Python standard library to find and load entry points.
+
 Entry points are a way for Python packages to advertise objects with some
 common interface. The most common examples are ``console_scripts`` entry 
points,
 which define shell commands by identifying a Python function to run.
@@ -11,4 +15,23 @@
 
 To advertise entry points when distributing a package, see
 `entry_points in the Python Packaging User Guide
-<https://packaging.python.org/en/latest/distributing.html#entry-points>`_.
+<https://packaging.python.org/guides/distributing-packages-using-setuptools/#entry-points>`_.
+
+The ``pkg_resources`` module distributed with ``setuptools`` provides a way to
+discover entrypoints as well, but it contains other functionality unrelated to
+entrypoint discovery, and it does a lot of work at import time.  Merely
+*importing* ``pkg_resources`` causes it to scan the files of all installed
+packages. Thus, in environments where a large number of packages are installed,
+importing ``pkg_resources`` can be very slow (several seconds).
+
+By contrast, ``entrypoints`` is focused solely on entrypoint discovery and it
+is faster. Importing ``entrypoints`` does not scan anything, and getting a
+given entrypoint group performs a more focused scan.
+
+When there are multiple versions of the same distribution in different
+directories on ``sys.path``, ``entrypoints`` follows the rule that the first
+one wins.  In most cases, this follows the logic of imports.  Similarly,
+Entrypoints relies on ``pip`` to ensure that only one ``.dist-info`` or
+``.egg-info`` directory exists for each installed package.  There is no 
reliable
+way to pick which of several `.dist-info` folders accurately relates to the
+importable modules.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/entrypoints.py 
new/entrypoints-0.4/entrypoints.py
--- old/entrypoints-0.3/entrypoints.py  2019-01-07 19:02:53.261767600 +0100
+++ new/entrypoints-0.4/entrypoints.py  2022-02-02 22:28:52.950209600 +0100
@@ -13,10 +13,7 @@
 import warnings
 import zipfile
 
-if sys.version_info[0] >= 3:
-    import configparser
-else:
-    from backports import configparser
+import configparser
 
 entry_point_pattern = re.compile(r"""
 (?P<modulename>\w+(\.\w+)*)
@@ -31,7 +28,7 @@
 [/\\]entry_points.txt$
 """, re.VERBOSE)
 
-__version__ = '0.3'
+__version__ = '0.4'
 
 class BadEntryPoint(Exception):
     """Raised when an entry point can't be parsed.
@@ -110,6 +107,18 @@
         self.name = name
         self.version = version
 
+    @classmethod
+    def from_name_version(cls, name):
+        """Parse a distribution from a "name-version" string
+
+        :param str name: The name-version string (entrypoints-0.3)
+        Returns an :class:`Distribution` object
+        """
+        version = None
+        if '-' in name:
+            name, version = name.split('-', 1)
+        return cls(name, version)
+
     def __repr__(self):
         return "Distribution(%r, %r)" % (self.name, self.version)
 
@@ -128,15 +137,12 @@
         if folder.rstrip('/\\').endswith('.egg'):
             # Gah, eggs
             egg_name = osp.basename(folder)
-            if '-' in egg_name:
-                distro = Distribution(*egg_name.split('-')[:2])
+            distro = Distribution.from_name_version(egg_name.split(".egg")[0])
 
-                if (repeated_distro == 'first') \
-                        and (distro.name in distro_names_seen):
-                    continue
-                distro_names_seen.add(distro.name)
-            else:
-                distro = None
+            if (repeated_distro == 'first') \
+                    and (distro.name in distro_names_seen):
+                continue
+            distro_names_seen.add(distro.name)
 
             if osp.isdir(folder):
                 ep_path = osp.join(folder, 'EGG-INFO', 'entry_points.txt')
@@ -154,8 +160,8 @@
                 cp = CaseSensitiveConfigParser(delimiters=('=',))
                 with z.open(info) as f:
                     fu = io.TextIOWrapper(f)
-                    cp.read_file(fu,
-                        source=osp.join(folder, 'EGG-INFO', 
'entry_points.txt'))
+                    cp.read_file(fu, source=osp.join(
+                        folder, 'EGG-INFO', 'entry_points.txt'))
                 yield cp, distro
 
         # zip imports, not egg
@@ -167,15 +173,12 @@
                         continue
 
                     distro_name_version = m.group('dist_version')
-                    if '-' in distro_name_version:
-                        distro = Distribution(*distro_name_version.split('-', 
1))
+                    distro = 
Distribution.from_name_version(distro_name_version)
 
-                        if (repeated_distro == 'first') \
-                                and (distro.name in distro_names_seen):
-                            continue
-                        distro_names_seen.add(distro.name)
-                    else:
-                        distro = None
+                    if (repeated_distro == 'first') \
+                            and (distro.name in distro_names_seen):
+                        continue
+                    distro_names_seen.add(distro.name)
 
                     cp = CaseSensitiveConfigParser(delimiters=('=',))
                     with zf.open(info) as f:
@@ -185,19 +188,17 @@
 
         # Regular file imports (not egg, not zip file)
         for path in itertools.chain(
-            glob.iglob(osp.join(folder, '*.dist-info', 'entry_points.txt')),
-            glob.iglob(osp.join(folder, '*.egg-info', 'entry_points.txt'))
+            glob.iglob(osp.join(glob.escape(folder), '*.dist-info', 
'entry_points.txt')),
+            glob.iglob(osp.join(glob.escape(folder), '*.egg-info', 
'entry_points.txt'))
         ):
             distro_name_version = 
osp.splitext(osp.basename(osp.dirname(path)))[0]
-            if '-' in distro_name_version:
-                distro = Distribution(*distro_name_version.split('-', 1))
+            distro = Distribution.from_name_version(distro_name_version)
+
+            if (repeated_distro == 'first') \
+                    and (distro.name in distro_names_seen):
+                continue
+            distro_names_seen.add(distro.name)
 
-                if (repeated_distro == 'first') \
-                        and (distro.name in distro_names_seen):
-                    continue
-                distro_names_seen.add(distro.name)
-            else:
-                distro = None
             cp = CaseSensitiveConfigParser(delimiters=('=',))
             cp.read([path])
             yield cp, distro
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/pyproject.toml 
new/entrypoints-0.4/pyproject.toml
--- old/entrypoints-0.3/pyproject.toml  2019-01-07 19:01:25.197482800 +0100
+++ new/entrypoints-0.4/pyproject.toml  2022-02-02 22:24:03.721162600 +0100
@@ -1,6 +1,6 @@
 [build-system]
-requires = ["flit"]
-build-backend = "flit.buildapi"
+requires = ["flit_core  >=2,<4"]
+build-backend = "flit_core.buildapi"
 
 [tool.flit.metadata]
 module = "entrypoints"
@@ -10,11 +10,9 @@
 description-file = "README.rst"
 classifiers = [
     "License :: OSI Approved :: MIT License",
-    "Programming Language :: Python :: 2",
     "Programming Language :: Python :: 3"
 ]
-requires-python = ">=2.7"
-requires = ["configparser (>=3.5); python_version == '2.7'"]
+requires-python = ">=3.6"
 
 [tool.flit.metadata.urls]
 Documentation = "https://entrypoints.readthedocs.io/en/latest/";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/setup.py new/entrypoints-0.4/setup.py
--- old/entrypoints-0.3/setup.py        1970-01-01 01:00:00.000000000 +0100
+++ new/entrypoints-0.4/setup.py        1970-01-01 01:00:00.000000000 +0100
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-# setup.py generated by flit for tools that don't yet use PEP 517
-
-from distutils.core import setup
-
-extras_require = \
-{":python_version == '2.7'": ['configparser>=3.5']}
-
-setup(name='entrypoints',
-      version='0.3',
-      description='Discover and load entry points from installed packages.',
-      author='Thomas Kluyver',
-      author_email='tho...@kluyver.me.uk',
-      url='https://github.com/takluyver/entrypoints',
-      py_modules=['entrypoints'],
-      extras_require=extras_require,
-      python_requires='>=2.7',
-     )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/entrypoints-0.3/tests/samples/packages4/dev.egg-info/entry_points.txt 
new/entrypoints-0.4/tests/samples/packages4/dev.egg-info/entry_points.txt
--- old/entrypoints-0.3/tests/samples/packages4/dev.egg-info/entry_points.txt   
1970-01-01 01:00:00.000000000 +0100
+++ new/entrypoints-0.4/tests/samples/packages4/dev.egg-info/entry_points.txt   
2022-02-02 21:09:08.997373300 +0100
@@ -0,0 +1,3 @@
+[entrypoints.test1]
+def = dev:def
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entrypoints-0.3/tests/test_entrypoints.py 
new/entrypoints-0.4/tests/test_entrypoints.py
--- old/entrypoints-0.3/tests/test_entrypoints.py       2019-01-07 
18:00:27.146827000 +0100
+++ new/entrypoints-0.4/tests/test_entrypoints.py       2022-02-02 
21:09:08.997373300 +0100
@@ -17,11 +17,28 @@
     osp.join(samples_dir, 'packages2', 'qux-0.4.egg'),
 ]
 
+def test_iter_files_distros():
+    result = entrypoints.iter_files_distros(path=sample_path)
+    # the sample_path has 4 unique items so iter_files_distros returns 4 tuples
+    assert len(list(result)) == 4
+
+    # testing a development, egg aka installed with pip install -e .
+    # these don't have version info in the .egg-info directory name
+    # (eg dev-0.0.1.egg-info)
+    path_with_dev = [osp.join(samples_dir, 'packages4')]
+    result = entrypoints.iter_files_distros(path=path_with_dev)
+    assert len(list(result)) == 1
+
+    # duplicate dev versions should still return one result
+    path_with_dev_duplicates = path_with_dev * 2
+    result = entrypoints.iter_files_distros(path=path_with_dev_duplicates)
+    assert len(list(result)) == 1
+
 def test_get_group_all():
     group = entrypoints.get_group_all('entrypoints.test1', sample_path)
     print(group)
     assert len(group) == 5
-    assert set(ep.name for ep in group) == {'abc', 'rew', 'opo', 'njn'}
+    assert {ep.name for ep in group} == {'abc', 'rew', 'opo', 'njn'}
 
 def test_get_group_named():
     group = entrypoints.get_group_named('entrypoints.test1', sample_path)

Reply via email to