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 2024-06-25 23:06:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-hatchling (Old)
 and      /work/SRC/openSUSE:Factory/.python-hatchling.new.18349 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-hatchling"

Tue Jun 25 23:06:35 2024 rev:27 rq:1183018 version:1.25.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-hatchling/python-hatchling.changes        
2024-05-14 13:37:12.776073369 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-hatchling.new.18349/python-hatchling.changes 
    2024-06-25 23:06:53.997040111 +0200
@@ -1,0 +2,16 @@
+Sat Jun 22 18:36:39 UTC 2024 - Benoît Monin <benoit.mo...@gmx.fr>
+
+- update to version 1.25.0:
+  * Changed:
+    + The macos-max-compat option for the wheel target is now
+      disabled by default and will be removed in a future release
+  * Added:
+    + Artifacts for the wheel and sdist targets now have their
+      permission bits normalized
+  * Fixed:
+    + Ignore manylinux/musllinux tags for the wheel target artifact
+      name when enabling the infer_tag build data
+    + The wheel target build data infer_tag when enabled now
+      respects the MACOSX_DEPLOYMENT_TARGET environment variable
+
+-------------------------------------------------------------------

Old:
----
  hatchling-1.24.2.tar.gz

New:
----
  hatchling-1.25.0.tar.gz

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

Other differences:
------------------
++++++ python-hatchling.spec ++++++
--- /var/tmp/diff_new_pack.zRh1Nz/_old  2024-06-25 23:06:55.193084200 +0200
+++ /var/tmp/diff_new_pack.zRh1Nz/_new  2024-06-25 23:06:55.193084200 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-hatchling
-Version:        1.24.2
+Version:        1.25.0
 Release:        0
 Summary:        Build backend used by Hatch
 License:        MIT

++++++ hatchling-1.24.2.tar.gz -> hatchling-1.25.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/PKG-INFO 
new/hatchling-1.25.0/PKG-INFO
--- old/hatchling-1.24.2/PKG-INFO       2020-02-02 01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/PKG-INFO       2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.3
 Name: hatchling
-Version: 1.24.2
+Version: 1.25.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.24.2/src/hatchling/__about__.py 
new/hatchling-1.25.0/src/hatchling/__about__.py
--- old/hatchling-1.24.2/src/hatchling/__about__.py     2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/__about__.py     2020-02-02 
01:00:00.000000000 +0100
@@ -1 +1 @@
-__version__ = '1.24.2'
+__version__ = '1.25.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/builders/macos.py 
new/hatchling-1.25.0/src/hatchling/builders/macos.py
--- old/hatchling-1.24.2/src/hatchling/builders/macos.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/builders/macos.py        2020-02-02 
01:00:00.000000000 +0100
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+import os
+import platform
+import re
+
+__all__ = ['process_macos_plat_tag']
+
+
+def process_macos_plat_tag(plat: str, /, *, compat: bool) -> str:
+    """
+    Process the macOS platform tag. This will normalize the macOS version to
+    10.16 if compat=True. If the MACOSX_DEPLOYMENT_TARGET environment variable
+    is set, then it will be used instead for the target version.  If archflags
+    is set, then the archs will be respected, including a universal build.
+    """
+    # Default to a native build
+    current_arch = platform.machine()
+    arm = current_arch == 'arm64'
+
+    # Look for cross-compiles
+    archflags = os.environ.get('ARCHFLAGS', '')
+    if archflags and (archs := re.findall(r'-arch (\S+)', archflags)):
+        new_arch = 'universal2' if set(archs) == {'x86_64', 'arm64'} else 
archs[0]
+        arm = archs == ['arm64']
+        plat = f'{plat[: plat.rfind(current_arch)]}{new_arch}'
+
+    # Process macOS version
+    if sdk_match := re.search(r'macosx_(\d+_\d+)', plat):
+        macos_version = sdk_match.group(1)
+        target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None)
+
+        try:
+            new_version = normalize_macos_version(target or macos_version, 
arm=arm, compat=compat)
+        except ValueError:
+            new_version = normalize_macos_version(macos_version, arm=arm, 
compat=compat)
+
+        return plat.replace(macos_version, new_version, 1)
+
+    return plat
+
+
+def normalize_macos_version(version: str, *, arm: bool, compat: bool) -> str:
+    """
+    Set minor version to 0 if major is 11+. Enforces 11+ if arm=True. 11+ is
+    converted to 10.16 if compat=True. Version is always returned in
+    "major_minor" format.
+    """
+    version = version.replace('.', '_')
+    if '_' not in version:
+        version = f'{version}_0'
+    major, minor = (int(d) for d in version.split('_')[:2])
+    major = max(major, 11) if arm else major
+    minor = 0 if major >= 11 else minor  # noqa: PLR2004
+    if compat and major >= 11:  # noqa: PLR2004
+        major = 10
+        minor = 16
+    return f'{major}_{minor}'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/builders/sdist.py 
new/hatchling-1.25.0/src/hatchling/builders/sdist.py
--- old/hatchling-1.24.2/src/hatchling/builders/sdist.py        2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/builders/sdist.py        2020-02-02 
01:00:00.000000000 +0100
@@ -15,6 +15,7 @@
 from hatchling.builders.utils import (
     get_reproducible_timestamp,
     normalize_archive_path,
+    normalize_artifact_permissions,
     normalize_file_permissions,
     normalize_relative_path,
     replace_file,
@@ -202,6 +203,7 @@
         target = os.path.join(directory, f'{self.artifact_project_id}.tar.gz')
 
         replace_file(archive.path, target)
+        normalize_artifact_permissions(target)
         return target
 
     @property
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/builders/utils.py 
new/hatchling-1.25.0/src/hatchling/builders/utils.py
--- old/hatchling-1.24.2/src/hatchling/builders/utils.py        2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/builders/utils.py        2020-02-02 
01:00:00.000000000 +0100
@@ -110,6 +110,15 @@
     return new_mode
 
 
+def normalize_artifact_permissions(path: str) -> None:
+    """
+    Normalize the permission bits for artifacts
+    """
+    file_stat = os.stat(path)
+    new_mode = normalize_file_permissions(file_stat.st_mode)
+    os.chmod(path, new_mode)
+
+
 def set_zip_info_mode(zip_info: ZipInfo, mode: int = 0o644) -> None:
     """
     https://github.com/python/cpython/blob/v3.12.3/Lib/zipfile/__init__.py#L574
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/builders/wheel.py 
new/hatchling-1.25.0/src/hatchling/builders/wheel.py
--- old/hatchling-1.24.2/src/hatchling/builders/wheel.py        2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/builders/wheel.py        2020-02-02 
01:00:00.000000000 +0100
@@ -20,6 +20,7 @@
     get_known_python_major_versions,
     get_reproducible_timestamp,
     normalize_archive_path,
+    normalize_artifact_permissions,
     normalize_file_permissions,
     normalize_inclusion_map,
     replace_file,
@@ -402,7 +403,7 @@
     @property
     def macos_max_compat(self) -> bool:
         if self.__macos_max_compat is None:
-            macos_max_compat = self.target_config.get('macos-max-compat', True)
+            macos_max_compat = self.target_config.get('macos-max-compat', 
False)
             if not isinstance(macos_max_compat, bool):
                 message = f'Field 
`tool.hatch.build.targets.{self.plugin_name}.macos-max-compat` must be a 
boolean'
                 raise TypeError(message)
@@ -483,6 +484,7 @@
         target = os.path.join(directory, 
f"{self.artifact_project_id}-{build_data['tag']}.whl")
 
         replace_file(archive.path, target)
+        normalize_artifact_permissions(target)
         return target
 
     def build_editable(self, directory: str, **build_data: Any) -> str:
@@ -571,6 +573,7 @@
         target = os.path.join(directory, 
f"{self.artifact_project_id}-{build_data['tag']}.whl")
 
         replace_file(archive.path, target)
+        normalize_artifact_permissions(target)
         return target
 
     def build_editable_explicit(self, directory: str, **build_data: Any) -> 
str:
@@ -599,6 +602,7 @@
         target = os.path.join(directory, 
f"{self.artifact_project_id}-{build_data['tag']}.whl")
 
         replace_file(archive.path, target)
+        normalize_artifact_permissions(target)
         return target
 
     def write_data(
@@ -774,31 +778,15 @@
 
         from packaging.tags import sys_tags
 
-        tag = next(sys_tags())
+        # Linux tag is after many/musl; packaging tools are required to skip
+        # many/musl, see https://github.com/pypa/packaging/issues/160
+        tag = next(iter(t for t in sys_tags() if 'manylinux' not in t.platform 
and 'musllinux' not in t.platform))
         tag_parts = [tag.interpreter, tag.abi, tag.platform]
 
-        archflags = os.environ.get('ARCHFLAGS', '')
         if sys.platform == 'darwin':
-            if archflags and sys.version_info[:2] >= (3, 8):
-                import platform
-                import re
-
-                archs = re.findall(r'-arch (\S+)', archflags)
-                if archs:
-                    plat = tag_parts[2]
-                    current_arch = platform.mac_ver()[2]
-                    new_arch = 'universal2' if set(archs) == {'x86_64', 
'arm64'} else archs[0]
-                    tag_parts[2] = f'{plat[: 
plat.rfind(current_arch)]}{new_arch}'
-
-            if self.config.macos_max_compat:
-                import re
-
-                plat = tag_parts[2]
-                sdk_match = re.search(r'macosx_(\d+_\d+)', plat)
-                if sdk_match:
-                    sdk_version_part = sdk_match.group(1)
-                    if tuple(map(int, sdk_version_part.split('_'))) >= (11, 0):
-                        tag_parts[2] = plat.replace(sdk_version_part, '10_16', 
1)
+            from hatchling.builders.macos import process_macos_plat_tag
+
+            tag_parts[2] = process_macos_plat_tag(tag_parts[2], 
compat=self.config.macos_max_compat)
 
         return '-'.join(tag_parts)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/dep/core.py 
new/hatchling-1.25.0/src/hatchling/dep/core.py
--- old/hatchling-1.24.2/src/hatchling/dep/core.py      2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/dep/core.py      2020-02-02 
01:00:00.000000000 +0100
@@ -126,7 +126,7 @@
     if sys_path is None:
         sys_path = sys.path
     if environment is None:
-        environment = default_environment()
+        environment = default_environment()  # type: ignore
 
     installed_distributions = DistributionCache(sys_path)
-    return all(dependency_in_sync(requirement, environment, 
installed_distributions) for requirement in requirements)
+    return all(dependency_in_sync(requirement, environment, 
installed_distributions) for requirement in requirements)  # type: ignore
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hatchling-1.24.2/src/hatchling/licenses/parse.py 
new/hatchling-1.25.0/src/hatchling/licenses/parse.py
--- old/hatchling-1.24.2/src/hatchling/licenses/parse.py        2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/licenses/parse.py        2020-02-02 
01:00:00.000000000 +0100
@@ -51,7 +51,7 @@
 
     python_expression = ' '.join(python_tokens)
     try:
-        result = eval(python_expression)  # noqa: PGH001, S307
+        result = eval(python_expression)  # noqa: S307
     except Exception:  # noqa: BLE001
         result = True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hatchling-1.24.2/src/hatchling/version/source/code.py 
new/hatchling-1.25.0/src/hatchling/version/source/code.py
--- old/hatchling-1.24.2/src/hatchling/version/source/code.py   2020-02-02 
01:00:00.000000000 +0100
+++ new/hatchling-1.25.0/src/hatchling/version/source/code.py   2020-02-02 
01:00:00.000000000 +0100
@@ -55,7 +55,7 @@
             sys.path[:] = old_search_paths
 
         # Execute the expression to determine the version
-        version = eval(expression, vars(module))  # noqa: PGH001, S307
+        version = eval(expression, vars(module))  # noqa: S307
 
         return {'version': version}
 

Reply via email to