Accepting request 1193629 from devel:languages:python

- Add new patch to fix tests: fix-tests.patch
- Remove upstreamed patch: support-hatchling-1.22.patch
- update to 1.12.0:
  - The run/env run and test commands now treat inclusion variable
    options as an intersection rather than a union to allow for
    specific targeting of environments
  - Add ability to control the source of Python distributions
  - Upgrade Ruff to 0.4.5
  - Upgrade PyApp to 0.22.0 for binary builds
  - The fmt command no longer hides the commands that are being
    executed
  - Add default timeout for network requests, useful when installing
    Python distributions
  - Fix syntax highlighting contrast for the config show command
- 1.11.1:
  - Add official GitHub Action for installing Hatch
  - Fix terminal.styles.spinner configuration
  - Fix entry points in the pre-built distributions that binaries use
- 1.11.0:
  - Upgrade PyApp to 0.21.1 for binary builds
  - On Linux, install the highest compatible Python distribution
    variant based on CPU architecture rather than assuming recent
    hardware
- 1.10.0:
  - The run/env run, fmt and shell commands now only change the
    current working directory to the project root if not already
    inside the project
  - The shell command now accepts a single argument to specify the
    environment to enter which overrides the standard choice
    mechanisms. The arguments determining shell options have been

OBS-URL: https://build.opensuse.org/request/show/1193629
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-hatch?expand=0&rev=14
This commit is contained in:
Dominique Leuenberger 2024-08-13 11:25:25 +00:00 committed by Git OBS Bridge
commit 931bfca499
6 changed files with 126 additions and 62 deletions

18
fix-tests.patch Normal file
View File

@ -0,0 +1,18 @@
Index: hatch-hatch-v1.12.0/tests/conftest.py
===================================================================
--- hatch-hatch-v1.12.0.orig/tests/conftest.py
+++ hatch-hatch-v1.12.0/tests/conftest.py
@@ -95,11 +95,12 @@ def isolation(uv_on_path) -> Generator[P
'GIT_AUTHOR_EMAIL': 'foo@bar.baz',
'COLUMNS': '80',
'LINES': '24',
+ 'HATCH_ENV_TYPE_VIRTUAL_UV_PATH': '',
}
if PLATFORM.windows:
default_env_vars['COMSPEC'] = 'cmd.exe'
else:
- default_env_vars['SHELL'] = 'sh'
+ default_env_vars['SHELL'] = 'bash'
with d.as_cwd(default_env_vars):
os.environ.pop(AppEnvVars.ENV_ACTIVE, None)

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

Binary file not shown.

View File

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

View File

@ -1,3 +1,95 @@
-------------------------------------------------------------------
Thu Aug 8 11:20:24 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Add new patch to fix tests: fix-tests.patch
- Remove upstreamed patch: support-hatchling-1.22.patch
- update to 1.12.0:
- The run/env run and test commands now treat inclusion variable
options as an intersection rather than a union to allow for
specific targeting of environments
- Add ability to control the source of Python distributions
- Upgrade Ruff to 0.4.5
- Upgrade PyApp to 0.22.0 for binary builds
- The fmt command no longer hides the commands that are being
executed
- Add default timeout for network requests, useful when installing
Python distributions
- Fix syntax highlighting contrast for the config show command
- 1.11.1:
- Add official GitHub Action for installing Hatch
- Fix terminal.styles.spinner configuration
- Fix entry points in the pre-built distributions that binaries use
- 1.11.0:
- Upgrade PyApp to 0.21.1 for binary builds
- On Linux, install the highest compatible Python distribution
variant based on CPU architecture rather than assuming recent
hardware
- 1.10.0:
- The run/env run, fmt and shell commands now only change the
current working directory to the project root if not already
inside the project
- The shell command now accepts a single argument to specify the
environment to enter which overrides the standard choice
mechanisms. The arguments determining shell options have been
converted to flags.
- Add test command
- The run command can now execute scripts that define inline
metadata for dependencies and Python version constraints
- The virtual environment type now supports the ability to use UV in
place of pip & virtualenv
- Add self report command for submitting pre-populated bug reports
to GitHub
- The reserved environment used for static analysis is now
completely configurable
- Add the following methods to the environment interface for
complete control over output during life cycle management:
app_status_creation, app_status_pre_installation,
app_status_post_installation, app_status_project_installation,
app_status_dependency_state_check,
app_status_dependency_installation_check,
app_status_dependency_synchronization
- Add binaries for 32-bit versions of Windows
- Read configuration from any ~/.pypirc file for the index publisher
- Use the Git user as the default username for new project URL
metadata
- Add HATCH_DEBUG environment variable that when enabled will show
local variables in the case of unhandled tracebacks
- The env show command now outputs data about all internal
environments when using the --json flag
- Upgrade default CPython distributions to 20240415
- Upgrade default PyPy distributions to 7.3.15
- Upgrade Ruff to 0.4.2
- Upgrade PyApp to 0.19.0 for binary builds
- Bump the minimum supported version of Hatchling to 1.24.2
- Bump the minimum supported version of virtualenv to 20.26.1
- Maintain consistent data paths for case insensitive file systems
- When projects derive dependencies from metadata hooks, there is
now by default a status indicator for when the hooks are executed
for better responsiveness
- Properly support projects with a pyproject.toml file but no
project table e.g. applications
- Fix the fmt command when automatically installing plugin
dependencies
- Fix dependency inheritance for the template of the types
environment for new projects
- Fix warnings related to tar file extraction on Python 3.12+ when
unpacking Python distributions for installation
- De-select Ruff rule E501 for the fmt command by default since it
conflicts with the formatter
- Fix colored output from build targets on the first run (build
environment creation status indicator issue)
- Set the packaging dependency version as >=23.2 to avoid its URL
validation which can conflict with context formatting
- Fix the exit code when there happens to be an unhandled exception
- No longer capture both stdout and stderr streams when parsing
metadata payloads from build environments
- Fix the README.md file template for new projects to avoid Markdown
linting issues
- 1.9.7:
- Limit the maximum version of virtualenv due to a backward
incompatible change
- Upgrade PyApp to 0.12.0 for binary builds
-------------------------------------------------------------------
Wed Mar 27 02:59:47 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -26,17 +26,15 @@
%endif
%{?sle15_python_module_pythons}
Name: python-hatch%{psuffix}
Version: 1.9.4
Version: 1.12.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 Based on parts of the following commits:
# gh#pypa/hatch#9a80ffc2567bb09160e97f1ade1dd4c768004089
# gh#pypa/hatch#f3b2159a8c4221062692881774bc58dfed5aaa76
Patch0: support-hatchling-1.22.patch
# PATCH-FIX-OPENSUSE fix-tests.patch
Patch0: fix-tests.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatch-vcs >= 0.3}
BuildRequires: %{python_module hatchling >= 1.19}
@ -59,17 +57,20 @@ Requires: python-tomli-w >= 1.0
Requires: python-tomlkit >= 0.11.1
Requires: python-virtualenv >= 20.16.2
Requires: python-zstandard < 1
Requires: uv
Requires: (python-pexpect >= 4.8 with python-pexpect < 5)
Requires: (python-userpath >= 1.7 with python-userpath < 2)
%if %{with test}
BuildRequires: %{python_module editables}
BuildRequires: %{python_module filelock >= 3.7.1}
BuildRequires: %{python_module hatch = %{version}}
BuildRequires: %{python_module pyfakefs}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module trustme}
BuildRequires: cargo
BuildRequires: uv
%else
BuildArch: noarch
%endif
@ -114,11 +115,18 @@ donttest="$donttest or (test_install and test_all)"
# platform distribution selection errors: https://github.com/pypa/hatch/issues/1145
%ifnarch x86_64
donttest="$donttest or (test_resolve and test_resolution_error)"
donttest+=" or test_custom_source or test_pypy_custom"
%endif
%ifarch s390x
# Console width different
donttest="$donttest or test_context_formatting"
%endif
# Requires network
donttest+=" or test_uv_env"
# Fails with python 3.12
donttest+=" or test_pyenv or test_no_open or test_open"
%pytest -v -k "not ($donttest)"
%endif

View File

@ -1,54 +0,0 @@
Index: hatch-hatch-v1.9.4/tests/backend/builders/test_wheel.py
===================================================================
--- hatch-hatch-v1.9.4.orig/tests/backend/builders/test_wheel.py
+++ hatch-hatch-v1.9.4/tests/backend/builders/test_wheel.py
@@ -161,15 +161,18 @@ class TestDefaultFileSelection:
ValueError,
match=(
'Unable to determine which files to ship inside the wheel using the following heuristics: '
- 'https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection\n\nAt least one '
- 'file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: '
- 'https://hatch.pypa.io/latest/config/build/\n\nAs an example, if you intend to ship a '
- 'directory named `foo` that resides within a `src` directory located at the root of your '
- 'project, you can define the following:\n\n\\[tool.hatch.build.targets.wheel\\]\n'
+ 'https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection\n\n'
+ 'The most likely cause of this is that there is no directory that matches the name of your '
+ 'project \\(my_app\\).\n\n'
+ 'At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` '
+ 'table, see: https://hatch.pypa.io/latest/config/build/\n\n'
+ 'As an example, if you intend to ship a directory named `foo` that resides within a `src` '
+ 'directory located at the root of your project, you can define the following:\n\n'
+ '\\[tool.hatch.build.targets.wheel\\]\n'
'packages = \\["src/foo"\\]'
),
):
- _ = method()
+ method()
def test_bypass_selection_option(self, temp_dir):
config = {
Index: hatch-hatch-v1.9.4/tests/backend/builders/plugin/test_interface.py
===================================================================
--- hatch-hatch-v1.9.4.orig/tests/backend/builders/plugin/test_interface.py
+++ hatch-hatch-v1.9.4/tests/backend/builders/plugin/test_interface.py
@@ -62,7 +62,7 @@ class TestMetadata:
config = {'project': {}}
builder = MockBuilder(str(isolation), config=config)
- assert builder.project_config is builder.project_config is config['project']
+ assert builder.project_config == builder.project_config == config['project']
def test_hatch(self, isolation):
config = {'tool': {'hatch': {}}}
Index: hatch-hatch-v1.9.4/tests/backend/metadata/test_core.py
===================================================================
--- hatch-hatch-v1.9.4.orig/tests/backend/metadata/test_core.py
+++ hatch-hatch-v1.9.4/tests/backend/metadata/test_core.py
@@ -84,7 +84,6 @@ class TestDynamic:
dynamic = ['version']
metadata = ProjectMetadata(str(isolation), None, {'project': {'dynamic': dynamic}})
- assert metadata.core.dynamic is dynamic
assert metadata.core.dynamic == ['version']
def test_cache_not_array(self, isolation):