Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-hatchling for 
openSUSE:Factory checked in at 2022-08-20 20:27:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-hatchling (Old)
 and      /work/SRC/openSUSE:Factory/.python-hatchling.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-hatchling"

Sat Aug 20 20:27:43 2022 rev:6 rq:998088 version:1.8.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-hatchling/python-hatchling.changes        
2022-08-16 17:07:02.279751478 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-hatchling.new.2083/python-hatchling.changes  
    2022-08-20 20:27:49.869214222 +0200
@@ -1,0 +2,10 @@
+Thu Aug 18 15:44:17 UTC 2022 - Beno??t Monin <benoit.mo...@gmx.fr>
+
+- update to version 1.8.0:
+  * Added:
+    + Add get_known_classifiers method to metadata hooks
+  * Fixed:
+    + Fix check for updating static versions with the version
+      command when metadata hooks are in use
+
+-------------------------------------------------------------------

Old:
----
  hatchling-1.7.1.tar.gz

New:
----
  hatchling-1.8.0.tar.gz

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

Other differences:
------------------
++++++ python-hatchling.spec ++++++
--- /var/tmp/diff_new_pack.5sxvN4/_old  2022-08-20 20:27:50.345215543 +0200
+++ /var/tmp/diff_new_pack.5sxvN4/_new  2022-08-20 20:27:50.353215565 +0200
@@ -19,7 +19,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-hatchling
-Version:        1.7.1
+Version:        1.8.0
 Release:        0
 Summary:        Build backend used by Hatch
 License:        MIT

++++++ hatchling-1.7.1.tar.gz -> hatchling-1.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.7.1/PKG-INFO new/hatchling-1.8.0/PKG-INFO
--- old/hatchling-1.7.1/PKG-INFO        2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.8.0/PKG-INFO        2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: hatchling
-Version: 1.7.1
+Version: 1.8.0
 Summary: Modern, extensible Python build backend
 Project-URL: Homepage, https://hatch.pypa.io/latest/
 Project-URL: Sponsor, https://github.com/sponsors/ofek
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.7.1/src/hatchling/__about__.py 
new/hatchling-1.8.0/src/hatchling/__about__.py
--- old/hatchling-1.7.1/src/hatchling/__about__.py      2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.8.0/src/hatchling/__about__.py      2020-02-02 
01:00:00.000000000 +0100
@@ -1 +1 @@
-__version__ = '1.7.1'
+__version__ = '1.8.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hatchling-1.7.1/src/hatchling/cli/version/__init__.py 
new/hatchling-1.8.0/src/hatchling/cli/version/__init__.py
--- old/hatchling-1.7.1/src/hatchling/cli/version/__init__.py   2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.8.0/src/hatchling/cli/version/__init__.py   2020-02-02 
01:00:00.000000000 +0100
@@ -14,7 +14,7 @@
     plugin_manager = PluginManager()
     metadata = ProjectMetadata(root, plugin_manager)
 
-    if metadata.core.version is not None:
+    if 'version' in metadata.config.get('project', {}):
         if desired_version:
             app.abort('Cannot set version when it is statically defined by the 
`project.version` field')
         else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.7.1/src/hatchling/metadata/core.py 
new/hatchling-1.8.0/src/hatchling/metadata/core.py
--- old/hatchling-1.7.1/src/hatchling/metadata/core.py  2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.8.0/src/hatchling/metadata/core.py  2020-02-02 
01:00:00.000000000 +0100
@@ -100,6 +100,7 @@
 
                 for metadata_hook in metadata_hooks.values():
                     metadata_hook.update(core_metadata)
+                    
metadata.add_known_classifiers(metadata_hook.get_known_classifiers())
 
                 new_fields = set(core_metadata) - static_fields
                 for new_field in new_fields:
@@ -269,6 +270,7 @@
         self._maintainers_data = None
         self._keywords = None
         self._classifiers = None
+        self._extra_classifiers = set()
         self._urls = None
         self._scripts = None
         self._gui_scripts = None
@@ -799,6 +801,8 @@
         https://peps.python.org/pep-0621/#classifiers
         """
         if self._classifiers is None:
+            import bisect
+
             from hatchling.metadata.classifiers import KNOWN_CLASSIFIERS, 
SORTED_CLASSIFIERS, is_private
 
             if 'classifiers' in self.config:
@@ -814,17 +818,24 @@
             if not isinstance(classifiers, list):
                 raise TypeError('Field `project.classifiers` must be an array')
 
+            known_classifiers = KNOWN_CLASSIFIERS | self._extra_classifiers
             unique_classifiers = set()
 
             for i, classifier in enumerate(classifiers, 1):
                 if not isinstance(classifier, str):
                     raise TypeError(f'Classifier #{i} of field 
`project.classifiers` must be a string')
-                elif not is_private(classifier) and classifier not in 
KNOWN_CLASSIFIERS:
+                elif not is_private(classifier) and classifier not in 
known_classifiers:
                     raise ValueError(f'Unknown classifier in field 
`project.classifiers`: {classifier}')
 
                 unique_classifiers.add(classifier)
 
-            self._classifiers = sorted(unique_classifiers, key=lambda c: 
is_private(c) or SORTED_CLASSIFIERS.index(c))
+            sorted_classifiers = list(SORTED_CLASSIFIERS)
+            for classifier in sorted(self._extra_classifiers - 
KNOWN_CLASSIFIERS):
+                bisect.insort(sorted_classifiers, classifier)
+
+            self._classifiers = sorted(
+                unique_classifiers, key=lambda c: -1 if is_private(c) else 
sorted_classifiers.index(c)
+            )
 
         return self._classifiers
 
@@ -1129,6 +1140,9 @@
 
         return self._dynamic
 
+    def add_known_classifiers(self, classifiers):
+        self._extra_classifiers.update(classifiers)
+
     def validate_fields(self):
         # Trigger validation for everything
         for attribute in dir(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hatchling-1.7.1/src/hatchling/metadata/plugin/interface.py 
new/hatchling-1.8.0/src/hatchling/metadata/plugin/interface.py
--- old/hatchling-1.7.1/src/hatchling/metadata/plugin/interface.py      
2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.8.0/src/hatchling/metadata/plugin/interface.py      
2020-02-02 01:00:00.000000000 +0100
@@ -70,3 +70,9 @@
         """
         This updates the metadata mapping of the `project` table in-place.
         """
+
+    def get_known_classifiers(self) -> list[str]:
+        """
+        This returns extra classifiers that should be considered valid in 
addition to the ones known to PyPI.
+        """
+        return []

Reply via email to