Accepting request 1086107 from devel:languages:python

- Add fix-sdist-target.patch to fix tests: gh#pypa/hatch@1b10663e645e
- update to 1.7.0:
  * The `src-layout` project template option is now enabled by
    default
  * Non-critical output now goes to stderr
  * Add `tool.hatch.env.requires` configuration to automatically
    install dependencies for environment and environment
    collector plugins
  * Add `custom` environment collector
  * Improve syncing of dependencies provided through Git direct
    references
  * Add `isolated_data_directory` attribute to the environment
    interface
  * Increase the timeout for and add retries to the `index`
    publisher
  * Expand home and environment variables in configured cache and
    data directories
  * Improve readability of exceptions
  * Update project templates
  * Bump the minimum supported version of Hatchling to 1.14.0
  * Fix displaying the version with the `version` command when
    the version is static and build dependencies are unmet
  * Fix build environments for the `virtual` environment type
    when storing within a relative path
  * Allow setuptools metadata migration for projects without
    `setup.py` if `setup.cfg` is present
  * Handle additional edge cases for setuptools metadata
    migration
  * Support boolean values for the `config set` command
- drop hatch-pr659-utf8.patch (upstream)

OBS-URL: https://build.opensuse.org/request/show/1086107
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-hatch?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2023-05-11 10:33:35 +00:00 committed by Git OBS Bridge
commit bf1c206c2f
6 changed files with 85 additions and 50 deletions

40
fix-sdist-target.patch Normal file
View File

@ -0,0 +1,40 @@
Index: hatch-hatch-v1.7.0/backend/src/hatchling/builders/sdist.py
===================================================================
--- hatch-hatch-v1.7.0.orig/backend/src/hatchling/builders/sdist.py
+++ hatch-hatch-v1.7.0/backend/src/hatchling/builders/sdist.py
@@ -161,7 +161,7 @@ class SdistBuilder(BuilderInterface):
def build_standard(self, directory: str, **build_data: Any) -> str:
found_packages = set()
- with SdistArchive(self.project_id, reproducible=self.config.reproducible) as archive:
+ with SdistArchive(self.artifact_project_id, reproducible=self.config.reproducible) as archive:
for included_file in self.recurse_included_files():
if self.config.support_legacy:
possible_package, file_name = os.path.split(included_file.relative_path)
@@ -170,7 +170,9 @@ class SdistBuilder(BuilderInterface):
tar_info = archive.gettarinfo(
included_file.path,
- arcname=normalize_archive_path(os.path.join(self.project_id, included_file.distribution_path)),
+ arcname=normalize_archive_path(
+ os.path.join(self.artifact_project_id, included_file.distribution_path)
+ ),
)
if tar_info.isfile():
Index: hatch-hatch-v1.7.0/tests/backend/builders/test_sdist.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/backend/builders/test_sdist.py
+++ hatch-hatch-v1.7.0/tests/backend/builders/test_sdist.py
@@ -1516,9 +1516,9 @@ class TestBuildStandard:
tar_archive.extractall(str(extraction_directory))
expected_files = helpers.get_template_files(
- 'sdist.standard_default', project_name, relative_root=builder.project_id
+ 'sdist.standard_default', project_name, relative_root=builder.artifact_project_id
)
helpers.assert_files(extraction_directory, expected_files)
- stat = os.stat(str(extraction_directory / builder.project_id / 'PKG-INFO'))
+ stat = os.stat(str(extraction_directory / builder.artifact_project_id / 'PKG-INFO'))
assert stat.st_mtime == get_reproducible_timestamp()

View File

@ -1,43 +0,0 @@
From c42f1d7086e4a8d1a7e1f299c50db2f1a16a2e3d Mon Sep 17 00:00:00 2001
From: Ofek Lev <ofekmeister@gmail.com>
Date: Sat, 10 Dec 2022 11:49:48 -0500
Subject: [PATCH] Remove unnecessary encoding declaration
---
backend/src/hatchling/version/core.py | 1 -
docs/history/hatchling.md | 4 ++++
tests/backend/builders/hooks/test_version.py | 2 --
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/backend/src/hatchling/version/core.py b/backend/src/hatchling/version/core.py
index 38c26aca7..cad01f94b 100644
--- a/backend/src/hatchling/version/core.py
+++ b/backend/src/hatchling/version/core.py
@@ -5,7 +5,6 @@
DEFAULT_PATTERN = r'(?i)^(__version__|VERSION) *= *([\'"])v?(?P<version>.+?)\2'
DEFAULT_TEMPLATE = """\
-# -*- coding: utf-8 -*-
# This file is auto-generated by Hatchling. As such, do not:
# - modify
# - track in version control e.g. be sure to add to .gitignore
diff --git a/tests/backend/builders/hooks/test_version.py b/tests/backend/builders/hooks/test_version.py
index 3b916d3ed..b03500292 100644
--- a/tests/backend/builders/hooks/test_version.py
+++ b/tests/backend/builders/hooks/test_version.py
@@ -91,7 +91,6 @@ def update(self, metadata):
assert expected_file.is_file()
assert expected_file.read_text() == helpers.dedent(
"""
- # -*- coding: utf-8 -*-
# This file is auto-generated by Hatchling. As such, do not:
# - modify
# - track in version control e.g. be sure to add to .gitignore
@@ -132,7 +131,6 @@ def update(self, metadata):
assert expected_file.is_file()
assert expected_file.read_text() == helpers.dedent(
"""
- # -*- coding: utf-8 -*-
# This file is auto-generated by Hatchling. As such, do not:
# - modify
# - track in version control e.g. be sure to add to .gitignore

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:de6d4bb1b6453de289551fac54e3d114eaeed369dc8f1b8a3493849c3581b423
size 367984

BIN
hatch-v1.7.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,41 @@
-------------------------------------------------------------------
Wed May 10 16:07:25 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add fix-sdist-target.patch to fix tests: gh#pypa/hatch@1b10663e645e
-------------------------------------------------------------------
Fri May 5 10:45:53 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.7.0:
* The `src-layout` project template option is now enabled by
default
* Non-critical output now goes to stderr
* Add `tool.hatch.env.requires` configuration to automatically
install dependencies for environment and environment
collector plugins
* Add `custom` environment collector
* Improve syncing of dependencies provided through Git direct
references
* Add `isolated_data_directory` attribute to the environment
interface
* Increase the timeout for and add retries to the `index`
publisher
* Expand home and environment variables in configured cache and
data directories
* Improve readability of exceptions
* Update project templates
* Bump the minimum supported version of Hatchling to 1.14.0
* Fix displaying the version with the `version` command when
the version is static and build dependencies are unmet
* Fix build environments for the `virtual` environment type
when storing within a relative path
* Allow setuptools metadata migration for projects without
`setup.py` if `setup.cfg` is present
* Handle additional edge cases for setuptools metadata
migration
* Support boolean values for the `config set` command
- drop hatch-pr659-utf8.patch (upstream)
-------------------------------------------------------------------
Fri Jan 6 16:17:06 UTC 2023 - Ben Greiner <code@bnavigator.de>

View File

@ -26,17 +26,17 @@
%endif
Name: python-hatch%{psuffix}
Version: 1.6.3
Version: 1.7.0
Release: 0
Summary: Modern, extensible Python project management
License: MIT
URL: https://hatch.pypa.io/latest/
# SourceRepository: https://github.com/pypa/hatch
Source: https://github.com/pypa/hatch/archive/refs/tags/hatch-v%{version}.tar.gz
# PATCH-FIX-UPSTREAM hatch-pr659-utf8.patch gh#pypa/hatch#659 required due to newer hatchling
Patch1: hatch-pr659-utf8.patch
# PATCH-FIX-UPSTREAM fix-sdist-target.patch -- gh#pypa/hatch@1b10663e645e
Patch0: fix-sdist-target.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling >= 1.11.0}
BuildRequires: %{python_module hatchling >= 1.14}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros