Accepting request 1133911 from home:bnavigator:branches:devel:languages:python

- Update to 1.8.1
  ## Fixed:
  * Fix regression in calling subprocesses with updated PATH
  * Fix automatic installation of environment plugins when running
    as a standalone binary
  * Change default location of Python installations
- Release 1.8.0
  ## Changed:
  * Drop support for Python 3.7
  * The get_build_process method of the environment interface has
    been removed; plugins should use the new run_builder method
    instead
  * Remove pyperclip dependency and the --copy flag of the config
    find command
  * When running the build command all output from builders is now
    displayed as-is in real time without the stripping of ANSI
    codes
  * Version information (for Hatch itself) is now derived from Git
  ## Added:
  * Support Python 3.12
  * Add installers and standalone binaries
  * Add the ability to manage Python installations
  * Add fmt command
  * The virtual environment type can now automatically download
    requested versions of Python that are not installed
  * Add dependency_hash method to the environment interface
  * The state of installed dependencies for environments is saved
    as metadata so if dependency definitions have not changed then
    no checking is performed, which can be computationally
    expensive

OBS-URL: https://build.opensuse.org/request/show/1133911
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hatch?expand=0&rev=28
This commit is contained in:
Dirk Mueller 2023-12-19 08:42:14 +00:00 committed by Git OBS Bridge
parent 6cd47e5a49
commit e873d67eb1
8 changed files with 71 additions and 248 deletions

View File

@ -1,30 +0,0 @@
From 4ddbf0a9a720caed18d19c083ff88427c9d2a993 Mon Sep 17 00:00:00 2001
From: Maximilian Hils <github@maximilianhils.com>
Date: Thu, 24 Aug 2023 05:30:00 +0200
Subject: [PATCH] Fix CI (#940)
fix unrelated ci issue
---
tests/cli/config/test_set.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/cli/config/test_set.py b/tests/cli/config/test_set.py
index 73bb9bc03..cd576feb4 100644
--- a/tests/cli/config/test_set.py
+++ b/tests/cli/config/test_set.py
@@ -184,7 +184,6 @@ def test_project_location_basic_set_first_project(hatch, config_file, helpers, t
f"""
New setting:
project = "foo"
-
[projects]
foo = "{path}"
"""
@@ -206,7 +205,6 @@ def test_project_location_complex_set_first_project(hatch, config_file, helpers,
f"""
New setting:
project = "foo"
-
[projects.foo]
location = "{path}"
"""

View File

@ -1,40 +0,0 @@
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,111 +0,0 @@
From d07463ea6afcecd83fd55bdac975516de6f3bc10 Mon Sep 17 00:00:00 2001
From: Ryan Morshead <ryan.morshead@gmail.com>
Date: Mon, 17 Apr 2023 22:02:59 -0700
Subject: [PATCH 1/3] Name .pth file so it loads first
Users adding their own .pth files likely need to be loaded after the one inserted by hatchling. The only way to do this is by naming it so the hatchling .pth file comes first alphabetically.
---
backend/src/hatchling/builders/wheel.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: hatch-hatch-v1.7.0/backend/src/hatchling/builders/wheel.py
===================================================================
--- hatch-hatch-v1.7.0.orig/backend/src/hatchling/builders/wheel.py
+++ hatch-hatch-v1.7.0/backend/src/hatchling/builders/wheel.py
@@ -438,6 +438,9 @@ class WheelBuilder(BuilderInterface):
editable_project.add_to_path(os.path.dirname(relative_path))
for filename, content in sorted(editable_project.files()):
+ if filename.endswith('.pth') and not filename.startswith('_'):
+ filename = f'_{filename}'
+
record = archive.write_file(filename, content)
records.write(record)
@@ -475,7 +478,7 @@ class WheelBuilder(BuilderInterface):
for relative_directory in self.config.dev_mode_dirs
)
- record = archive.write_file(f"{self.metadata.core.name.replace('-', '_')}.pth", '\n'.join(directories))
+ record = archive.write_file(f"_{self.metadata.core.name.replace('-', '_')}.pth", '\n'.join(directories))
records.write(record)
for included_file in self.recurse_forced_files(self.get_forced_inclusion_map(build_data)):
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_exact.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact.py
@@ -16,7 +16,7 @@ def get_files(**kwargs):
if str(f.path) == 'LICENSE.txt':
files.append(File(Path(metadata_directory, 'licenses', f.path), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
loader_file_name = f"_editable_impl_{kwargs['package_name']}.py"
files.append(File(Path(pth_file_name), f"import _editable_impl_{kwargs['package_name']}"))
files.append(
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py
@@ -16,7 +16,7 @@ def get_files(**kwargs):
if str(f.path) == 'LICENSE.txt':
files.append(File(Path(metadata_directory, 'licenses', f.path), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
loader_file_name = f"_editable_impl_{kwargs['package_name']}.py"
files.append(File(Path(pth_file_name), f"import _editable_impl_{kwargs['package_name']}"))
files.append(
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact_force_include.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_exact_force_include.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_exact_force_include.py
@@ -18,7 +18,7 @@ def get_files(**kwargs):
elif f.path.parts[-1] == '__about__.py':
files.append(File(Path('zfoo.py'), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
loader_file_name = f"_editable_impl_{kwargs['package_name']}.py"
files.append(File(Path(pth_file_name), f"import _editable_impl_{kwargs['package_name']}"))
files.append(
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_pth.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth.py
@@ -16,7 +16,7 @@ def get_files(**kwargs):
if str(f.path) == 'LICENSE.txt':
files.append(File(Path(metadata_directory, 'licenses', f.path), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
files.append(File(Path(pth_file_name), '\n'.join(package_paths)))
files.append(
File(
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py
@@ -16,7 +16,7 @@ def get_files(**kwargs):
if str(f.path) == 'LICENSE.txt':
files.append(File(Path(metadata_directory, 'licenses', f.path), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
files.append(File(Path(pth_file_name), '\n'.join(package_paths)))
files.append(
File(
Index: hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth_force_include.py
===================================================================
--- hatch-hatch-v1.7.0.orig/tests/helpers/templates/wheel/standard_editable_pth_force_include.py
+++ hatch-hatch-v1.7.0/tests/helpers/templates/wheel/standard_editable_pth_force_include.py
@@ -18,7 +18,7 @@ def get_files(**kwargs):
elif f.path.parts[-1] == '__about__.py':
files.append(File(Path('zfoo.py'), f.contents))
- pth_file_name = f"{kwargs['package_name']}.pth"
+ pth_file_name = f"_{kwargs['package_name']}.pth"
files.append(File(Path(pth_file_name), '\n'.join(package_paths)))
files.append(
File(

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

Binary file not shown.

3
hatch-v1.8.1.tar.gz Normal file
View File

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

View File

@ -1,49 +0,0 @@
From 22a4eb02f00f2b332d3199d18ee7f546640564d0 Mon Sep 17 00:00:00 2001
From: Ofek Lev <ofekmeister@gmail.com>
Date: Sat, 7 Oct 2023 20:04:32 -0400
Subject: [PATCH] Fix tests
---
tests/cli/env/test_show.py | 18 +++++++++---------
tests/index/server/devpi/Dockerfile | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/tests/cli/env/test_show.py b/tests/cli/env/test_show.py
index 3588ce243..9cc2f42a2 100644
--- a/tests/cli/env/test_show.py
+++ b/tests/cli/env/test_show.py
@@ -439,15 +439,15 @@ def test_context_formatting(hatch, helpers, temp_dir, config_file):
+======+=========+==============+=======================+
| foo | virtual | pydantic | BAR=FOO_BAR |
+------+---------+--------------+-----------------------+
- Matrices
- +---------+---------+------------+-------------------------+
- | Name | Type | Envs | Dependencies |
- +=========+=========+============+=========================+
- | default | virtual | py39-9000 | foo @ {root:uri}/../foo |
- | | | py39-3.14 | |
- | | | py310-9000 | |
- | | | py310-3.14 | |
- +---------+---------+------------+-------------------------+
+ Matrices
+ +---------+---------+------------+------------------------+
+ | Name | Type | Envs | Dependencies |
+ +=========+=========+============+========================+
+ | default | virtual | py39-9000 | foo@ {root:uri}/../foo |
+ | | | py39-3.14 | |
+ | | | py310-9000 | |
+ | | | py310-3.14 | |
+ +---------+---------+------------+------------------------+
"""
)
diff --git a/tests/index/server/devpi/Dockerfile b/tests/index/server/devpi/Dockerfile
index d00434f84..01d4c0ddd 100644
--- a/tests/index/server/devpi/Dockerfile
+++ b/tests/index/server/devpi/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:alpine
+FROM python:3.11-alpine
RUN apk add --update build-base && \
pip install -U devpi-server devpi-client devpi-web

View File

@ -1,3 +1,61 @@
-------------------------------------------------------------------
Mon Dec 18 20:27:19 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Update to 1.8.1
## Fixed:
* Fix regression in calling subprocesses with updated PATH
* Fix automatic installation of environment plugins when running
as a standalone binary
* Change default location of Python installations
- Release 1.8.0
## Changed:
* Drop support for Python 3.7
* The get_build_process method of the environment interface has
been removed; plugins should use the new run_builder method
instead
* Remove pyperclip dependency and the --copy flag of the config
find command
* When running the build command all output from builders is now
displayed as-is in real time without the stripping of ANSI
codes
* Version information (for Hatch itself) is now derived from Git
## Added:
* Support Python 3.12
* Add installers and standalone binaries
* Add the ability to manage Python installations
* Add fmt command
* The virtual environment type can now automatically download
requested versions of Python that are not installed
* Add dependency_hash method to the environment interface
* The state of installed dependencies for environments is saved
as metadata so if dependency definitions have not changed then
no checking is performed, which can be computationally
expensive
* The build command now supports backends other than Hatchling
* Allow the use of features for environments when skip-install is
enabled
* The default is now __TOKEN__ when prompting for a username for
the publish command
* Add a new run_builder method to the environment interface
* Bump the minimum supported version of Hatchling to 1.19.0
* Bump the minimum supported version of click to 8.0.6
## Fixed:
* Fix nushell activation
* Better handling of flat storage directory hierarchies for the
virtual environment type
* Display useful information when running the version command
outside of a project rather than erroring
* Fix the project metadata command by only capturing stdout from
the backend
* Properly support Google Artifact Registry
* Fix parsing dependencies for environments when warnings are
emitted
- Drop patches
* CI.patch
* fix-sdist-target.patch
* hatch-pr828-pth-tests.patch
* packaging232.patch
-------------------------------------------------------------------
Thu Nov 23 10:22:50 UTC 2023 - Markéta Machová <mmachova@suse.com>

View File

@ -26,23 +26,16 @@
%endif
%{?sle15_python_module_pythons}
Name: python-hatch%{psuffix}
Version: 1.7.0
Version: 1.8.1
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 fix-sdist-target.patch -- gh#pypa/hatch@1b10663e645e
Patch0: fix-sdist-target.patch
# PATCH-FIX-UPSTREAM hatch-pr828-pth-tests.patch, gh#pypa/hatch#828
Patch1: hatch-pr828-pth-tests.patch
# PATCH-FIX-UPSTREAM CI.patch, gh#pypa/hatch#940
Patch2: CI.patch
# PATCH-FIX-UPSTREAM packaging232.patch gh#pypa/hatch#989
Patch3: packaging232.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling >= 1.14}
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatch-vcs >= 0.3}
BuildRequires: %{python_module hatchling >= 1.19}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@ -54,14 +47,12 @@ Requires: git-core
%if %{with test}
BuildRequires: %{python_module filelock >= 3.7.1}
BuildRequires: %{python_module hatch = %{version}}
# Due to Patch1, gh#pypa/hatch#828
BuildRequires: %{python_module hatchling >= 1.17.1}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module trustme}
BuildRequires: cargo
%endif
%python_subpackages
%description
@ -94,7 +85,11 @@ export LANG=en_US.UTF-8
# tests expect this to be unset and use their own reproducible value. Nothing installed from here.
# https://hatch.pypa.io/latest/config/build/#reproducible-builds
unset SOURCE_DATE_EPOCH
%pytest
# finds bash instead of expected sh as default shell inside obs
donttest="(test_install and test_already_installed_update_prompt)"
donttest="$donttest or (test_install and test_already_installed_update_flag)"
donttest="$donttest or (test_install and test_all)"
%pytest -k "not ($donttest)"
%endif
%post