Compare commits
17 Commits
Author | SHA256 | Date | |
---|---|---|---|
668cda8dfd | |||
b954cf22d2 | |||
8ce7da8faf | |||
7375e372f8 | |||
1b63ed844d | |||
6ce7fa9c67 | |||
2d0fb91ef5 | |||
ea041c61d6 | |||
7c07e9f922 | |||
4d5b97cf2e | |||
d19933b047 | |||
39bd1bae2f | |||
9a2f7fa9c2 | |||
dceb7e9db6 | |||
e744186903 | |||
f720edea9a | |||
a3657628ac |
29
click-8.2.patch
Normal file
29
click-8.2.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From df295583784427214324b974c75901da12931ec1 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
|
||||
Date: Thu, 26 Jun 2025 11:32:54 +0200
|
||||
Subject: [PATCH] Fix test_self with click >= 8.2.0
|
||||
|
||||
https://click.palletsprojects.com/en/stable/changes/#version-8-2-0
|
||||
---
|
||||
tests/cli/self/test_self.py | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/cli/self/test_self.py b/tests/cli/self/test_self.py
|
||||
index cd1a4aed1..f727b87f4 100644
|
||||
--- a/tests/cli/self/test_self.py
|
||||
+++ b/tests/cli/self/test_self.py
|
||||
@@ -1,7 +1,13 @@
|
||||
import os
|
||||
+import importlib
|
||||
|
||||
|
||||
def test(hatch):
|
||||
result = hatch(os.environ['PYAPP_COMMAND_NAME'])
|
||||
+ exit_code = 2
|
||||
|
||||
- assert result.exit_code == 0, result.output
|
||||
+ click_version = importlib.metadata.version('click')
|
||||
+ if click_version <= '8.1.8':
|
||||
+ exit_code = 0
|
||||
+
|
||||
+ assert result.exit_code == exit_code, result.output
|
924
fix-with-latest-hatchling.patch
Normal file
924
fix-with-latest-hatchling.patch
Normal file
@@ -0,0 +1,924 @@
|
||||
From f8a2eaa2e0ce80a931837539d8f565ceeab75961 Mon Sep 17 00:00:00 2001
|
||||
From: Ofek Lev <ofekmeister@gmail.com>
|
||||
Date: Sat, 9 Nov 2024 11:35:16 -0500
|
||||
Subject: [PATCH] Bump `packaging` to 24.2 (#1788)
|
||||
|
||||
---
|
||||
hatch.toml | 4 -
|
||||
pyproject.toml | 2 +-
|
||||
src/hatch/template/default.py | 2 +-
|
||||
tests/backend/licenses/__init__.py | 0
|
||||
tests/backend/licenses/test_parse.py | 56 --
|
||||
tests/backend/licenses/test_supported.py | 31 -
|
||||
tests/backend/metadata/test_core.py | 2 +-
|
||||
15 files changed, 11 insertions(+), 974 deletions(-)
|
||||
delete mode 100644 tests/backend/licenses/__init__.py
|
||||
delete mode 100644 tests/backend/licenses/test_parse.py
|
||||
delete mode 100644 tests/backend/licenses/test_supported.py
|
||||
|
||||
Index: hatch-hatch-v1.14.0/hatch.toml
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/hatch.toml
|
||||
+++ hatch-hatch-v1.14.0/hatch.toml
|
||||
@@ -114,11 +114,7 @@ update-hatch = [
|
||||
"update-distributions",
|
||||
"update-ruff",
|
||||
]
|
||||
-update-hatchling = [
|
||||
- "update-licenses",
|
||||
-]
|
||||
update-distributions = "python scripts/update_distributions.py"
|
||||
-update-licenses = "python backend/scripts/update_licenses.py"
|
||||
update-ruff = [
|
||||
"{env:HATCH_UV} pip install --upgrade ruff",
|
||||
"python scripts/update_ruff.py",
|
||||
Index: hatch-hatch-v1.14.0/pyproject.toml
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/pyproject.toml
|
||||
+++ hatch-hatch-v1.14.0/pyproject.toml
|
||||
@@ -44,7 +44,7 @@ dependencies = [
|
||||
"httpx>=0.22.0",
|
||||
"hyperlink>=21.0.0",
|
||||
"keyring>=23.5.0",
|
||||
- "packaging>=23.2",
|
||||
+ "packaging>=24.2",
|
||||
"pexpect~=4.8",
|
||||
"platformdirs>=2.5.0",
|
||||
"rich>=11.2.0",
|
||||
Index: hatch-hatch-v1.14.0/src/hatch/template/default.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/src/hatch/template/default.py
|
||||
+++ hatch-hatch-v1.14.0/src/hatch/template/default.py
|
||||
@@ -38,7 +38,7 @@ class DefaultTemplate(TemplateInterface)
|
||||
license_file_name = f'{license_id}.txt'
|
||||
cached_license_path = cached_licenses_dir / license_file_name
|
||||
if not cached_license_path.is_file():
|
||||
- from hatchling.licenses.supported import VERSION
|
||||
+ from packaging.licenses._spdx import VERSION # noqa: PLC2701
|
||||
|
||||
url = f'https://raw.githubusercontent.com/spdx/license-list-data/v{VERSION}/text/{license_file_name}'
|
||||
for _ in range(5):
|
||||
Index: hatch-hatch-v1.14.0/tests/backend/licenses/test_parse.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/tests/backend/licenses/test_parse.py
|
||||
+++ /dev/null
|
||||
@@ -1,56 +0,0 @@
|
||||
-import re
|
||||
-
|
||||
-import pytest
|
||||
-
|
||||
-from hatchling.licenses.parse import normalize_license_expression
|
||||
-
|
||||
-
|
||||
-@pytest.mark.parametrize(
|
||||
- 'expression',
|
||||
- [
|
||||
- 'or',
|
||||
- 'and',
|
||||
- 'with',
|
||||
- 'mit or',
|
||||
- 'mit and',
|
||||
- 'mit with',
|
||||
- 'or mit',
|
||||
- 'and mit',
|
||||
- 'with mit',
|
||||
- '(mit',
|
||||
- 'mit)',
|
||||
- 'mit or or apache-2.0',
|
||||
- 'mit or apache-2.0 (bsd-3-clause and MPL-2.0)',
|
||||
- ],
|
||||
-)
|
||||
-def test_syntax_errors(expression):
|
||||
- with pytest.raises(ValueError, match=re.escape(f'invalid license expression: {expression}')):
|
||||
- normalize_license_expression(expression)
|
||||
-
|
||||
-
|
||||
-def test_unknown_license():
|
||||
- with pytest.raises(ValueError, match='unknown license: foo'):
|
||||
- normalize_license_expression('mit or foo')
|
||||
-
|
||||
-
|
||||
-def test_unknown_license_exception():
|
||||
- with pytest.raises(ValueError, match='unknown license exception: foo'):
|
||||
- normalize_license_expression('mit with foo')
|
||||
-
|
||||
-
|
||||
-@pytest.mark.parametrize(
|
||||
- ('raw', 'normalized'),
|
||||
- [
|
||||
- ('mIt', 'MIT'),
|
||||
- ('mit or apache-2.0', 'MIT OR Apache-2.0'),
|
||||
- ('mit and apache-2.0', 'MIT AND Apache-2.0'),
|
||||
- ('gpl-2.0-or-later with bison-exception-2.2', 'GPL-2.0-or-later WITH Bison-exception-2.2'),
|
||||
- ('mit or apache-2.0 and (bsd-3-clause or mpl-2.0)', 'MIT OR Apache-2.0 AND (BSD-3-Clause OR MPL-2.0)'),
|
||||
- ('mit and (apache-2.0+ or mpl-2.0+)', 'MIT AND (Apache-2.0+ OR MPL-2.0+)'),
|
||||
- # Valid non-SPDX values
|
||||
- ('licenseref-public-domain', 'LicenseRef-Public-Domain'),
|
||||
- ('licenseref-proprietary', 'LicenseRef-Proprietary'),
|
||||
- ],
|
||||
-)
|
||||
-def test_normalization(raw, normalized):
|
||||
- assert normalize_license_expression(raw) == normalized
|
||||
Index: hatch-hatch-v1.14.0/tests/backend/licenses/test_supported.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/tests/backend/licenses/test_supported.py
|
||||
+++ /dev/null
|
||||
@@ -1,31 +0,0 @@
|
||||
-from hatchling.licenses.supported import EXCEPTIONS, LICENSES
|
||||
-
|
||||
-
|
||||
-def test_licenses():
|
||||
- assert isinstance(LICENSES, dict)
|
||||
- assert list(LICENSES) == sorted(LICENSES)
|
||||
-
|
||||
- for name, data in LICENSES.items():
|
||||
- assert isinstance(data, dict)
|
||||
-
|
||||
- assert 'id' in data
|
||||
- assert isinstance(data['id'], str)
|
||||
- assert data['id'].lower() == name
|
||||
-
|
||||
- assert 'deprecated' in data
|
||||
- assert isinstance(data['deprecated'], bool)
|
||||
-
|
||||
-
|
||||
-def test_exceptions():
|
||||
- assert isinstance(EXCEPTIONS, dict)
|
||||
- assert list(EXCEPTIONS) == sorted(EXCEPTIONS)
|
||||
-
|
||||
- for name, data in EXCEPTIONS.items():
|
||||
- assert isinstance(data, dict)
|
||||
-
|
||||
- assert 'id' in data
|
||||
- assert isinstance(data['id'], str)
|
||||
- assert data['id'].lower() == name
|
||||
-
|
||||
- assert 'deprecated' in data
|
||||
- assert isinstance(data['deprecated'], bool)
|
||||
Index: hatch-hatch-v1.14.0/tests/backend/metadata/test_core.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/tests/backend/metadata/test_core.py
|
||||
+++ hatch-hatch-v1.14.0/tests/backend/metadata/test_core.py
|
||||
@@ -558,7 +558,7 @@ class TestLicense:
|
||||
def test_invalid_expression(self, isolation):
|
||||
metadata = ProjectMetadata(str(isolation), None, {'project': {'license': 'mit or foo'}})
|
||||
|
||||
- with pytest.raises(ValueError, match='Error parsing field `project.license` - unknown license: foo'):
|
||||
+ with pytest.raises(ValueError, match="Error parsing field `project.license` - Unknown license: 'foo'"):
|
||||
_ = metadata.core.license_expression
|
||||
|
||||
def test_multiple_options(self, isolation):
|
||||
@@ -621,54 +621,16 @@ class TestLicenseFiles:
|
||||
):
|
||||
_ = metadata.core.license_files
|
||||
|
||||
- def test_not_table(self, isolation):
|
||||
+ def test_not_array(self, isolation):
|
||||
metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': 9000}})
|
||||
|
||||
- with pytest.raises(TypeError, match='Field `project.license-files` must be a table'):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
- def test_multiple_options(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {'paths': [], 'globs': []}}})
|
||||
-
|
||||
- with pytest.raises(
|
||||
- ValueError, match='Cannot specify both `paths` and `globs` in the `project.license-files` table'
|
||||
- ):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
- def test_no_option(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {}}})
|
||||
-
|
||||
- with pytest.raises(
|
||||
- ValueError, match='Must specify either `paths` or `globs` in the `project.license-files` table if defined'
|
||||
- ):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
- def test_paths_not_array(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {'paths': 9000}}})
|
||||
-
|
||||
- with pytest.raises(TypeError, match='Field `paths` in the `project.license-files` table must be an array'):
|
||||
+ with pytest.raises(TypeError, match='Field `project.license-files` must be an array'):
|
||||
_ = metadata.core.license_files
|
||||
|
||||
- def test_paths_entry_not_string(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {'paths': [9000]}}})
|
||||
-
|
||||
- with pytest.raises(
|
||||
- TypeError, match='Entry #1 in field `paths` in the `project.license-files` table must be a string'
|
||||
- ):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
- def test_globs_not_array(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {'globs': 9000}}})
|
||||
-
|
||||
- with pytest.raises(TypeError, match='Field `globs` in the `project.license-files` table must be an array'):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
- def test_globs_entry_not_string(self, isolation):
|
||||
- metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': {'globs': [9000]}}})
|
||||
+ def test_entry_not_string(self, isolation):
|
||||
+ metadata = ProjectMetadata(str(isolation), None, {'project': {'license-files': [9000]}})
|
||||
|
||||
- with pytest.raises(
|
||||
- TypeError, match='Entry #1 in field `globs` in the `project.license-files` table must be a string'
|
||||
- ):
|
||||
+ with pytest.raises(TypeError, match='Entry #1 of field `project.license-files` must be a string'):
|
||||
_ = metadata.core.license_files
|
||||
|
||||
def test_default_globs_no_licenses(self, isolation):
|
||||
@@ -693,7 +655,7 @@ class TestLicenseFiles:
|
||||
assert metadata.core.license_files == sorted(expected)
|
||||
|
||||
def test_globs_with_licenses(self, temp_dir):
|
||||
- metadata = ProjectMetadata(str(temp_dir), None, {'project': {'license-files': {'globs': ['LICENSES/*']}}})
|
||||
+ metadata = ProjectMetadata(str(temp_dir), None, {'project': {'license-files': ['LICENSES/*']}})
|
||||
|
||||
licenses_dir = temp_dir / 'LICENSES'
|
||||
licenses_dir.mkdir()
|
||||
@@ -709,7 +671,7 @@ class TestLicenseFiles:
|
||||
metadata = ProjectMetadata(
|
||||
str(temp_dir),
|
||||
None,
|
||||
- {'project': {'license-files': {'paths': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt', 'COPYING']}}},
|
||||
+ {'project': {'license-files': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt', 'COPYING']}},
|
||||
)
|
||||
|
||||
licenses_dir = temp_dir / 'LICENSES'
|
||||
@@ -722,20 +684,6 @@ class TestLicenseFiles:
|
||||
|
||||
assert metadata.core.license_files == ['COPYING', 'LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt']
|
||||
|
||||
- def test_paths_missing_license(self, temp_dir):
|
||||
- metadata = ProjectMetadata(
|
||||
- str(temp_dir),
|
||||
- None,
|
||||
- {'project': {'license-files': {'paths': ['LICENSES/MIT.txt']}}},
|
||||
- )
|
||||
-
|
||||
- licenses_dir = temp_dir / 'LICENSES'
|
||||
- licenses_dir.mkdir()
|
||||
- (licenses_dir / 'Apache-2.0.txt').touch()
|
||||
-
|
||||
- with pytest.raises(OSError, match='License file does not exist: LICENSES/MIT.txt'):
|
||||
- _ = metadata.core.license_files
|
||||
-
|
||||
|
||||
class TestAuthors:
|
||||
def test_dynamic(self, isolation):
|
||||
@@ -1661,7 +1609,7 @@ class TestMetadataConversion:
|
||||
raw_metadata = {
|
||||
'name': 'My.App',
|
||||
'version': '0.0.1',
|
||||
- 'license-files': {'paths': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt']},
|
||||
+ 'license-files': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt'],
|
||||
}
|
||||
metadata = ProjectMetadata(str(temp_dir), None, {'project': raw_metadata})
|
||||
|
||||
Index: hatch-hatch-v1.14.0/tests/backend/builders/test_wheel.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/tests/backend/builders/test_wheel.py
|
||||
+++ hatch-hatch-v1.14.0/tests/backend/builders/test_wheel.py
|
||||
@@ -909,7 +909,7 @@ class TestBuildStandard:
|
||||
(project_path / 'LICENSES' / 'test').mkdir()
|
||||
|
||||
config = {
|
||||
- 'project': {'name': project_name, 'dynamic': ['version'], 'license-files': {'globs': ['LICENSES/*']}},
|
||||
+ 'project': {'name': project_name, 'dynamic': ['version'], 'license-files': ['LICENSES/*']},
|
||||
'tool': {
|
||||
'hatch': {
|
||||
'version': {'path': 'my_app/__about__.py'},
|
||||
Index: hatch-hatch-v1.14.0/tests/backend/metadata/test_spec.py
|
||||
===================================================================
|
||||
--- hatch-hatch-v1.14.0.orig/tests/backend/metadata/test_spec.py
|
||||
+++ hatch-hatch-v1.14.0/tests/backend/metadata/test_spec.py
|
||||
@@ -131,7 +131,7 @@ License-File: LICENSES/MIT.txt
|
||||
assert project_metadata_from_core_metadata(core_metadata) == {
|
||||
'name': 'My.App',
|
||||
'version': '0.1.0',
|
||||
- 'license-files': {'paths': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt']},
|
||||
+ 'license-files': ['LICENSES/Apache-2.0.txt', 'LICENSES/MIT.txt'],
|
||||
}
|
||||
|
||||
def test_license_expression(self):
|
||||
@@ -419,6 +419,22 @@ class TestCoreMetadataV12:
|
||||
"""
|
||||
)
|
||||
|
||||
+ def test_license_expression(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'license': 'mit'}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 1.2
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ License: MIT
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
def test_keywords_single(self, constructor, isolation, helpers):
|
||||
metadata = ProjectMetadata(
|
||||
str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'keywords': ['foo']}}
|
||||
@@ -762,7 +778,7 @@ class TestCoreMetadataV21:
|
||||
Metadata-Version: 2.1
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
- License-Expression: MIT
|
||||
+ License: MIT
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -961,7 +977,6 @@ class TestCoreMetadataV21:
|
||||
Maintainer-email: foo <bar@domain>
|
||||
License: foo
|
||||
bar
|
||||
- License-File: LICENSE.txt
|
||||
Keywords: bar,foo
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
@@ -1202,7 +1217,7 @@ class TestCoreMetadataV22:
|
||||
Metadata-Version: 2.2
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
- License-Expression: MIT
|
||||
+ License: MIT
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -1431,7 +1446,6 @@ class TestCoreMetadataV22:
|
||||
Maintainer-email: foo <bar@domain>
|
||||
License: foo
|
||||
bar
|
||||
- License-File: LICENSE.txt
|
||||
Keywords: bar,foo
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
@@ -1664,7 +1678,7 @@ class TestCoreMetadataV23:
|
||||
metadata = ProjectMetadata(
|
||||
str(isolation),
|
||||
None,
|
||||
- {'project': {'name': 'My.App', 'version': '0.1.0', 'license': 'mit or apache-2.0'}},
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'license': 'mit'}},
|
||||
)
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
@@ -1672,6 +1686,445 @@ class TestCoreMetadataV23:
|
||||
Metadata-Version: 2.3
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
+ License: MIT
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_keywords_single(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'keywords': ['foo']}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Keywords: foo
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_keywords_multiple(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'keywords': ['foo', 'bar']}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Keywords: bar,foo
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_classifiers(self, constructor, isolation, helpers):
|
||||
+ classifiers = [
|
||||
+ 'Programming Language :: Python :: 3.11',
|
||||
+ 'Programming Language :: Python :: 3.9',
|
||||
+ ]
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'classifiers': classifiers}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Classifier: Programming Language :: Python :: 3.9
|
||||
+ Classifier: Programming Language :: Python :: 3.11
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_requires_python(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'requires-python': '>=1,<2'}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Requires-Python: <2,>=1
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_dependencies(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'dependencies': ['foo==1', 'bar==5']}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Requires-Dist: bar==5
|
||||
+ Requires-Dist: foo==1
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_optional_dependencies(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {
|
||||
+ 'project': {
|
||||
+ 'name': 'My.App',
|
||||
+ 'version': '0.1.0',
|
||||
+ 'optional-dependencies': {
|
||||
+ 'feature2': ['foo==1; python_version < "3"', 'bar==5'],
|
||||
+ 'feature1': ['foo==1', 'bar==5; python_version < "3"'],
|
||||
+ },
|
||||
+ }
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Provides-Extra: feature1
|
||||
+ Requires-Dist: bar==5; (python_version < '3') and extra == 'feature1'
|
||||
+ Requires-Dist: foo==1; extra == 'feature1'
|
||||
+ Provides-Extra: feature2
|
||||
+ Requires-Dist: bar==5; extra == 'feature2'
|
||||
+ Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_extra_runtime_dependencies(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'dependencies': ['foo==1', 'bar==5']}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata, extra_dependencies=['baz==9']) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Requires-Dist: bar==5
|
||||
+ Requires-Dist: foo==1
|
||||
+ Requires-Dist: baz==9
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_readme(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {
|
||||
+ 'project': {
|
||||
+ 'name': 'My.App',
|
||||
+ 'version': '0.1.0',
|
||||
+ 'readme': {'content-type': 'text/markdown', 'text': 'test content\n'},
|
||||
+ }
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Description-Content-Type: text/markdown
|
||||
+
|
||||
+ test content
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_all(self, constructor, temp_dir, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(temp_dir),
|
||||
+ None,
|
||||
+ {
|
||||
+ 'project': {
|
||||
+ 'name': 'My.App',
|
||||
+ 'version': '0.1.0',
|
||||
+ 'description': 'foo',
|
||||
+ 'urls': {'foo': 'bar', 'bar': 'baz'},
|
||||
+ 'authors': [{'email': 'bar@domain', 'name': 'foo'}],
|
||||
+ 'maintainers': [{'email': 'bar@domain', 'name': 'foo'}],
|
||||
+ 'keywords': ['foo', 'bar'],
|
||||
+ 'classifiers': [
|
||||
+ 'Programming Language :: Python :: 3.11',
|
||||
+ 'Programming Language :: Python :: 3.9',
|
||||
+ ],
|
||||
+ 'requires-python': '>=1,<2',
|
||||
+ 'dependencies': ['foo==1', 'bar==5'],
|
||||
+ 'optional-dependencies': {
|
||||
+ 'feature2': ['foo==1; python_version < "3"', 'bar==5'],
|
||||
+ 'feature1': ['foo==1', 'bar==5; python_version < "3"'],
|
||||
+ 'feature3': ['baz @ file:///path/to/project'],
|
||||
+ },
|
||||
+ 'readme': {'content-type': 'text/markdown', 'text': 'test content\n'},
|
||||
+ },
|
||||
+ 'tool': {'hatch': {'metadata': {'allow-direct-references': True}}},
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ licenses_dir = temp_dir / 'LICENSES'
|
||||
+ licenses_dir.mkdir()
|
||||
+ (licenses_dir / 'MIT.txt').touch()
|
||||
+ (licenses_dir / 'Apache-2.0.txt').touch()
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.3
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Summary: foo
|
||||
+ Project-URL: foo, bar
|
||||
+ Project-URL: bar, baz
|
||||
+ Author-email: foo <bar@domain>
|
||||
+ Maintainer-email: foo <bar@domain>
|
||||
+ Keywords: bar,foo
|
||||
+ Classifier: Programming Language :: Python :: 3.9
|
||||
+ Classifier: Programming Language :: Python :: 3.11
|
||||
+ Requires-Python: <2,>=1
|
||||
+ Requires-Dist: bar==5
|
||||
+ Requires-Dist: foo==1
|
||||
+ Provides-Extra: feature1
|
||||
+ Requires-Dist: bar==5; (python_version < '3') and extra == 'feature1'
|
||||
+ Requires-Dist: foo==1; extra == 'feature1'
|
||||
+ Provides-Extra: feature2
|
||||
+ Requires-Dist: bar==5; extra == 'feature2'
|
||||
+ Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
|
||||
+ Provides-Extra: feature3
|
||||
+ Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
|
||||
+ Description-Content-Type: text/markdown
|
||||
+
|
||||
+ test content
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('constructor', [get_core_metadata_constructors()['2.4']])
|
||||
+class TestCoreMetadataV24:
|
||||
+ def test_default(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0'}})
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_description(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'description': 'foo'}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Summary: foo
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_dynamic(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'dynamic': ['authors', 'classifiers']}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Dynamic: Author
|
||||
+ Dynamic: Author-email
|
||||
+ Dynamic: Classifier
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_urls(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'urls': {'foo': 'bar', 'bar': 'baz'}}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Project-URL: foo, bar
|
||||
+ Project-URL: bar, baz
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_authors_name(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'authors': [{'name': 'foo'}]}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Author: foo
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_authors_email(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'authors': [{'email': 'foo@domain'}]}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Author-email: foo@domain
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_authors_name_and_email(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'authors': [{'email': 'bar@domain', 'name': 'foo'}]}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Author-email: foo <bar@domain>
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_authors_multiple(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'authors': [{'name': 'foo'}, {'name': 'bar'}]}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Author: foo, bar
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_maintainers_name(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'maintainers': [{'name': 'foo'}]}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Maintainer: foo
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_maintainers_email(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'maintainers': [{'email': 'foo@domain'}]}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Maintainer-email: foo@domain
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_maintainers_name_and_email(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {
|
||||
+ 'project': {
|
||||
+ 'name': 'My.App',
|
||||
+ 'version': '0.1.0',
|
||||
+ 'maintainers': [{'email': 'bar@domain', 'name': 'foo'}],
|
||||
+ }
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Maintainer-email: foo <bar@domain>
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_maintainers_multiple(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'maintainers': [{'name': 'foo'}, {'name': 'bar'}]}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ Maintainer: foo, bar
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_license(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation), None, {'project': {'name': 'My.App', 'version': '0.1.0', 'license': {'text': 'foo\nbar'}}}
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
+ License: foo
|
||||
+ bar
|
||||
+ """
|
||||
+ )
|
||||
+
|
||||
+ def test_license_expression(self, constructor, isolation, helpers):
|
||||
+ metadata = ProjectMetadata(
|
||||
+ str(isolation),
|
||||
+ None,
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'license': 'mit or apache-2.0'}},
|
||||
+ )
|
||||
+
|
||||
+ assert constructor(metadata) == helpers.dedent(
|
||||
+ """
|
||||
+ Metadata-Version: 2.4
|
||||
+ Name: My.App
|
||||
+ Version: 0.1.0
|
||||
License-Expression: MIT OR Apache-2.0
|
||||
"""
|
||||
)
|
||||
@@ -1680,7 +2133,7 @@ class TestCoreMetadataV23:
|
||||
metadata = ProjectMetadata(
|
||||
str(temp_dir),
|
||||
None,
|
||||
- {'project': {'name': 'My.App', 'version': '0.1.0', 'license-files': {'globs': ['LICENSES/*']}}},
|
||||
+ {'project': {'name': 'My.App', 'version': '0.1.0', 'license-files': ['LICENSES/*']}},
|
||||
)
|
||||
|
||||
licenses_dir = temp_dir / 'LICENSES'
|
||||
@@ -1690,7 +2143,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
License-File: LICENSES/Apache-2.0.txt
|
||||
@@ -1705,7 +2158,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Keywords: foo
|
||||
@@ -1719,7 +2172,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Keywords: bar,foo
|
||||
@@ -1737,7 +2190,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
@@ -1752,7 +2205,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Requires-Python: <2,>=1
|
||||
@@ -1768,7 +2221,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Requires-Dist: bar==5
|
||||
@@ -1794,7 +2247,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Provides-Extra: feature1
|
||||
@@ -1815,7 +2268,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata, extra_dependencies=['baz==9']) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Requires-Dist: bar==5
|
||||
@@ -1839,7 +2292,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Description-Content-Type: text/markdown
|
||||
@@ -1861,7 +2314,7 @@ class TestCoreMetadataV23:
|
||||
'authors': [{'email': 'bar@domain', 'name': 'foo'}],
|
||||
'maintainers': [{'email': 'bar@domain', 'name': 'foo'}],
|
||||
'license': 'mit or apache-2.0',
|
||||
- 'license-files': {'globs': ['LICENSES/*']},
|
||||
+ 'license-files': ['LICENSES/*'],
|
||||
'keywords': ['foo', 'bar'],
|
||||
'classifiers': [
|
||||
'Programming Language :: Python :: 3.11',
|
||||
@@ -1887,7 +2340,7 @@ class TestCoreMetadataV23:
|
||||
|
||||
assert constructor(metadata) == helpers.dedent(
|
||||
"""
|
||||
- Metadata-Version: 2.3
|
||||
+ Metadata-Version: 2.4
|
||||
Name: My.App
|
||||
Version: 0.1.0
|
||||
Summary: foo
|
BIN
hatch-v1.14.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
hatch-v1.14.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1cafce05e853e9a878e24ab519a18863cf27e21a3aa11a8f6d92b0a3606ca583
|
||||
size 768420
|
@@ -1,3 +1,145 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 21 08:22:26 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to libalternatives on SLE-16-based and newer systems only
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 10 12:33:57 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to libalternatives
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 26 09:36:32 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add click-8.2.patch to fix tests with click >= 8.2
|
||||
gh#pypa/hatch#2013
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 16 07:11:55 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||
|
||||
- Update to 1.14.1
|
||||
* Remove uses of the deprecated --no-python-version-warning
|
||||
flag when using pip
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 19 17:05:14 UTC 2024 - Nico Krapp <nico.krapp@suse.com>
|
||||
|
||||
- Add fix-with-latest-hatchling.patch to restore compatibility with
|
||||
hatchling >= 1.26.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 19 15:40:19 UTC 2024 - Nico Krapp <nico.krapp@suse.com>
|
||||
|
||||
- actually remove fix-test.patch from tracked files
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 16 13:26:27 UTC 2024 - Nico Krapp <nico.krapp@suse.com>
|
||||
|
||||
- Update to 1.14.0:
|
||||
* Upgrade default CPython distributions to 20241206
|
||||
* Bump the minimum supported version of Hatchling to 1.26.3
|
||||
* Update virtualenv dependency
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 11 18:31:58 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Upgrade to 1.13.0:
|
||||
|
||||
- Remove upstreamed patches:
|
||||
- fix-tests.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-hatch
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -24,27 +24,30 @@
|
||||
%define psuffix %{nil}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
%bcond_with libalternatives
|
||||
%endif
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-hatch%{psuffix}
|
||||
Version: 1.9.4
|
||||
Version: 1.14.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 Based on parts of the following commits:
|
||||
# gh#pypa/hatch#9a80ffc2567bb09160e97f1ade1dd4c768004089
|
||||
# gh#pypa/hatch#f3b2159a8c4221062692881774bc58dfed5aaa76
|
||||
Patch0: support-hatchling-1.22.patch
|
||||
# PATCH-FIX-UPSTREAM fix-with-latest-hatchling.patch gh#f8a2eaa gh#28f233c gh#fc25690
|
||||
Patch0: fix-with-latest-hatchling.patch
|
||||
# PATCH-FIX-UPSTREAM click-8.2.patch gh#pypa/hatch#2013
|
||||
Patch1: click-8.2.patch
|
||||
BuildRequires: %{python_module base >= 3.8}
|
||||
BuildRequires: %{python_module hatch-vcs >= 0.3}
|
||||
BuildRequires: %{python_module hatchling >= 1.19}
|
||||
BuildRequires: %{python_module hatchling >= 1.26.3}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Requires: git-core
|
||||
Requires: python-click >= 8.0.6
|
||||
Requires: python-hatchling >= 1.21.0
|
||||
@@ -59,17 +62,27 @@ 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 libalternatives}
|
||||
BuildRequires: alts
|
||||
Requires: alts
|
||||
%else
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
%endif
|
||||
%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,12 +127,22 @@ 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
|
||||
%pytest -v -k "not ($donttest)"
|
||||
|
||||
# Requires network
|
||||
donttest+=" or test_uv_env"
|
||||
# Fails with python 3.12
|
||||
donttest+=" or test_pyenv or test_no_open or test_open"
|
||||
# Fails with hatchling >= 1.26
|
||||
|
||||
# Ignore test_build.py it fails because output format difference.
|
||||
# https://github.com/pypa/hatch/commit/e843c42da2e71468b519a3aacdfeab31b14985a3
|
||||
%pytest -v -k "not ($donttest)" --ignore tests/cli/build/test_build.py
|
||||
%endif
|
||||
|
||||
%post
|
||||
@@ -128,6 +151,9 @@ donttest="$donttest or test_context_formatting"
|
||||
%postun
|
||||
%python_uninstall_alternative hatch
|
||||
|
||||
%pre
|
||||
%python_libalternatives_reset_alternative hatch
|
||||
|
||||
%if !%{with test}
|
||||
%files %{python_files}
|
||||
%doc README.md
|
||||
|
@@ -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):
|
Reference in New Issue
Block a user