Sync from SUSE:ALP:Source:Standard:1.0 python-hatch revision 439fc4ad7d9d8447e1eb570e34cfc820

This commit is contained in:
Adrian Schröter 2023-10-19 00:42:27 +02:00
commit 89f6e5536e
8 changed files with 627 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

30
CI.patch Normal file
View File

@ -0,0 +1,30 @@
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}"
"""

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<flavor>test</flavor>
</multibuild>

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()

111
hatch-pr828-pth-tests.patch Normal file
View File

@ -0,0 +1,111 @@
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) Normal file

Binary file not shown.

304
python-hatch.changes Normal file
View File

@ -0,0 +1,304 @@
-------------------------------------------------------------------
Sat Oct 7 11:16:12 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
- Remove superflous BR pytest plugins: randomly rerunfailures
-------------------------------------------------------------------
Tue Sep 19 11:01:55 UTC 2023 - Markéta Machová <mmachova@suse.com>
- Add CI.patch to fix tests
-------------------------------------------------------------------
Wed Jun 21 08:39:40 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Add hatch-pr828-pth-tests.patch, gh#pypa/hatch#828 fixing
test failure with hatchling >= 1.17.1
-------------------------------------------------------------------
Sun Jun 11 08:38:31 UTC 2023 - ecsos <ecsos@opensuse.org>
- Add %{?sle15_python_module_pythons}
-------------------------------------------------------------------
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>
- Update to v1.6.3
## Fixed:
* Fix version command when the version is dynamic and build
dependencies are unmet
- Release 1.6.2 - 2022-10-20
## Fixed:
* Fix getting dynamic metadata from hooks for environments when
dependencies are not dynamic
- Release 1.6.1 - 2022-10-16
## Fixed:
* Computing the path to the user's home directory now gracefully
falls back to ~ when it cannot be determined
- Release 1.6.0 - 2022-10-08
## Changed:
* The run_shell_command environment interface method now accepts
arbitrary subprocess.Popen keyword arguments. This is not
strictly breaking, but will be utilized in upcoming features.
* The internal directory structure for storing virtual
environments is now more nested. This is not breaking, but any
local environments will be created anew.
## Added:
* Add project command group to view details about the project
like PEP 621 metadata
* Better support for auto-detection of environments by tools like
Visual Studio Code now that the storage directory of virtual
environments will be flat if Hatch's configured virtual
environment directory resides somewhere within the project root
or if it is set to a .virtualenvs directory within the user's
home directory
* Build environments for the virtual environment type are now
cached for improved performance
* Add build_environment_exists method to the environment
interface for implementations that cache the build environment
* Add path option to the virtual environment type
* Add --initialize-auth flag to the index publisher to allow for
the saving of authentication information before publishing
* Support Bash on Windows for the shell command
* The setuptools migration script no longer modifies the
formatting of existing pyproject.toml configuration
* Bump the minimum supported version of Hatchling to 1.11.0
## Fixed:
* Environments now respect dynamically defined project
dependencies
* The dep hash and all dep show commands now respect dynamically
defined project dependencies
* The env show, dep hash, and all dep show commands now honor
context formatting
* Fix matrix variable inclusion filtering of the run and env run
commands when there are multiple possible variables
* Build environment compatibility is now checked before use
* Decreasing verbosity now has no affect on output that should
always be displayed
* Handle more edge cases in the setuptools migration script
* Environments now respect user defined environment variables for
context formatting
* Update the scripts in the generated test environment template
for new projects to reflect the documentation
* Allow extra-dependencies in environment overrides
* Depend on packaging explicitly rather than relying on it being
a transitive dependency of Hatchling
- Release 1.5.0 - 2022-08-28
## Added:
* The index publisher now recognizes repository-specific options
* Add the --ignore-compat flag to the env run command
* Setting the HATCH_PYTHON environment variable to self will now
force the use of the Python executable Hatch is running on for
virtual environment creation
## Fixed:
* Fix the --force-continue flag of the env run command
* Handle more edge cases in the setuptools migration script
- Release 1.4.2 - 2022-08-16
## Fixed:
* Fix check for updating static versions with the version command
when metadata hooks are in use
- Release 1.4.1 - 2022-08-13
## Fixed:
* Fix non-detached inheritance disabling for environments
- Release 1.4.0 - 2022-08-06
## Added:
* The default Python for virtual environments now checks PATH
before using the one Hatch is running on
* Values for environment env-vars now support context formatting
* Add name override for environments to allow for regular
expression matching
* The index publisher now better supports non-PyPI indices
* Add certificate options to the index publisher
* Display waiting text when checking dependencies and removing
environments
* Display help text the first time the shell command is executed
* Update project templates with Python 3.11 and the latest
versions of various GitHub Actions
* Add support for Almquist (ash) shells
* Add hyperlink as a dependency for better handling of package
index URLs
* Bump the minimum supported version of virtualenv to 20.16.2
* Bump the minimum supported version of tomlkit to 0.11.1
## Fixed:
* Acknowledge extra-dependencies for the env show command
* Fix locating executables within virtual environments on Debian
* Fix managing the terminal size inside the shell command
* Fix default code coverage file omission for the src-layout
project template option
- Release 1.3.1 - 2022-07-11
## Fixed:
* Support -h/--help flag for the run command
- Release 1.3.0 - 2022-07-10
## Changed:
* Rename the default publishing plugin from pypi to the more
generic index
## Added:
* Support the absence of pyproject.toml files, as is the case for
apps and non-Python projects
* Hide scripts that start with an underscore for the env show
command by default
* Ignoring the exit codes of commands by prefixing with hyphens
now works with entire named scripts
* Add a way to require confirmation for publishing
* Add --force-continue flag to the env run command
* Make tracebacks colorful and less verbose
* When shell configuration has not been defined, attempt to use
the current shell based on parent processes before resorting to
the defaults
* The shell name pwsh is now an alias for powershell
* Remove atomicwrites dependency
* Relax constraint on userpath dependency
* Bump the minimum supported version of Hatchling to 1.4.1
## Fixed:
* Keep environments in sync with the dependencies of the selected
features
* Use utf-8 for all files generated for new projects
* Escape special characters Git may return in the user name when
writing generated files for new projects
* Normalize the package name to lowercase in setuptools migration
script
* Fix parsing of source distributions during publishing
- Release 1.2.1 - 2022-05-30
## Fixed:
* Fix handling of top level data_files in setuptools migration
script
- Release 1.2.0 - 2022-05-22
## Changed:
* The enter_shell environment plugin method now accepts an
additional args parameter
## Added:
* Allow context string formatting for environment dependencies
* Add environment context string formatting fields env_name,
env_type, matrix, verbosity, and args
* Support overriding the default arguments used to spawn shells
on non-Windows systems
* Bump the minimum supported version of Hatchling to 1.3.0
## Fixed:
* Improve setuptools migration script
- Release 1.1.2 - 2022-05-20
## Fixed:
* Bump the minimum supported version of Hatchling to 1.2.0
* Update project metadata to reflect support for Python 3.11
- Release 1.1.1 - 2022-05-12
## Fixed:
* Fix setuptools migration script for non-Windows systems
- Release 1.1.0 - 2022-05-12
## Changed:
* In order to simplify the implementation of command execution
for environment plugins, the run_shell_commands method has been
replaced by the singular run_shell_command. A new
command_context method has been added to more easily satisfy
complex use cases.
* The finalize_command environment plugin method has been removed
in favor of the newly introduced context formatting
functionality.
## Added:
* Add context formatting functionality i.e. the ability to insert
values into configuration like environment variables and
command line arguments
* Any verbosity for command execution will now always display
headers, even for single environments
* Every executed command is now displayed when running multiple
commands or when verbosity is enabled
* Similar to make, ignore the exit code of executed commands that
start with - (a hyphen)
* Add ability for the --init flag of the new command to
automatically migrate setuptools configuration
* Update project metadata to reflect the adoption by PyPA and
production stability
- Release 1.0.0 - 2022-04-28
* This is the first stable release of Hatch v1, a complete
rewrite. Enjoy!
- Use python dependency generator, check in multibuild
- Add hatch-pr659-utf8.patch for compatibility with new hatchling
(gh#pypa/hatch#659).
-------------------------------------------------------------------
Mon Jun 8 11:01:18 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Testsuite is too flaky, just skip the stuff overall unless someone
invests more time into it
-------------------------------------------------------------------
Wed Jun 3 08:08:21 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Skip more flaky tests
-------------------------------------------------------------------
Mon May 25 10:59:15 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Sun Apr 5 07:19:23 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Skip flaky test
-------------------------------------------------------------------
Wed Dec 11 12:00:14 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.23.0:
* fixes wheel packaging a bit
-------------------------------------------------------------------
Mon Oct 21 09:42:14 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Update to v0.22.0, dropping merged patches
-------------------------------------------------------------------
Sat Oct 12 13:49:07 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Activate test suite
- Add patch 38ca5de2.patch and update-userpath.patch to support
using latest python-userpath instead of unmaintained python-adduserpath
- Add unmerged fixes in upstream pull requests:
* pr_59.patch: Add decorator to tests which require internet connection
* pr_60.patch: Avoid installing tests as a package
* pr_62.patch: Fixed bad encoding for Python 3.7
-------------------------------------------------------------------
Thu Aug 2 19:17:22 UTC 2018 - aboe76@gmail.com
- Update to v0.20.0
-------------------------------------------------------------------
Mon Sep 11 07:39:28 UTC 2017 - thomas.schraitle@suse.com
- First public version 0.9.1

113
python-hatch.spec Normal file
View File

@ -0,0 +1,113 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-hatch%{psuffix}
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 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
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling >= 1.14}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires: git-core
%{?python_enable_dependency_generator}
%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}
%endif
%python_subpackages
%description
Hatch is a modern, extensible Python project manager.
Features
* Standardized build system with reproducible builds by default
* Robust environment management with support for custom scripts
* Easy publishing to PyPI or other indexes
* Version management
* Configurable project generation with sane defaults
* Responsive CLI, ~2-3x faster than equivalent tools
%prep
%autosetup -p1 -n hatch-hatch-v%{version}
%if !%{with test}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/hatch
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
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
%endif
%post
%python_install_alternative hatch
%postun
%python_uninstall_alternative hatch
%if !%{with test}
%files %{python_files}
%doc README.md
%license LICENSE.txt
%python_alternative %{_bindir}/hatch
%{python_sitelib}/hatch
%{python_sitelib}/hatch-%{version}.dist-info
%endif
%changelog