diff --git a/backend/src/hatchling/metadata/spec.py b/backend/src/hatchling/metadata/spec.py index 971f25829..b295b7014 100644 --- a/backend/src/hatchling/metadata/spec.py +++ b/backend/src/hatchling/metadata/spec.py @@ -5,7 +5,7 @@ if TYPE_CHECKING: from hatchling.metadata.core import ProjectMetadata -DEFAULT_METADATA_VERSION = '2.3' +DEFAULT_METADATA_VERSION = '2.4' LATEST_METADATA_VERSION = '2.4' CORE_METADATA_PROJECT_FIELDS = { 'Author': ('authors',), diff --git a/docs/history/hatchling.md b/docs/history/hatchling.md index 945c6ddbf..58a57d4cc 100644 --- a/docs/history/hatchling.md +++ b/docs/history/hatchling.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +***Added:*** + +- Update the default version of core metadata to 2.4 + ## [1.26.3](https://github.com/pypa/hatch/releases/tag/hatchling-v1.26.3) - 2024-11-12 ## {: #hatchling-v1.26.3 } ***Fixed:*** diff --git a/docs/plugins/builder/sdist.md b/docs/plugins/builder/sdist.md index eed7f017b..13db3f657 100644 --- a/docs/plugins/builder/sdist.md +++ b/docs/plugins/builder/sdist.md @@ -16,7 +16,7 @@ The builder plugin name is `sdist`. | Option | Default | Description | | --- | --- | --- | -| `core-metadata-version` | `"2.3"` | The version of [core metadata](https://packaging.python.org/specifications/core-metadata/) to use | +| `core-metadata-version` | `"2.4"` | The version of [core metadata](https://packaging.python.org/specifications/core-metadata/) to use | | `strict-naming` | `true` | Whether or not file names should contain the normalized version of the project name | | `support-legacy` | `false` | Whether or not to include a `setup.py` file to support legacy installation mechanisms | diff --git a/docs/plugins/builder/wheel.md b/docs/plugins/builder/wheel.md index 5dd64d7e7..a538e8edb 100644 --- a/docs/plugins/builder/wheel.md +++ b/docs/plugins/builder/wheel.md @@ -16,7 +16,7 @@ The builder plugin name is `wheel`. | Option | Default | Description | | --- | --- | --- | -| `core-metadata-version` | `"2.3"` | The version of [core metadata](https://packaging.python.org/specifications/core-metadata/) to use | +| `core-metadata-version` | `"2.4"` | The version of [core metadata](https://packaging.python.org/specifications/core-metadata/) to use | | `shared-data` | | A mapping similar to the [forced inclusion](../../config/build.md#forced-inclusion) option corresponding to the `data` subdirectory within the standard [data directory](https://packaging.python.org/en/latest/specifications/binary-distribution-format/#the-data-directory) that will be installed globally in a given Python environment, usually under `#!python sys.prefix` | | `shared-scripts` | | A mapping similar to the [forced inclusion](../../config/build.md#forced-inclusion) option corresponding to the `scripts` subdirectory within the standard [data directory](https://packaging.python.org/en/latest/specifications/binary-distribution-format/#the-data-directory) that will be installed in a given Python environment, usually under `Scripts` on Windows or `bin` otherwise, and would normally be available on PATH | | `extra-metadata` | | A mapping similar to the [forced inclusion](../../config/build.md#forced-inclusion) option corresponding to extra [metadata](https://peps.python.org/pep-0427/#the-dist-info-directory) that will be shipped in a directory named `extra_metadata` | diff --git a/tests/helpers/templates/sdist/standard_default.py b/tests/helpers/templates/sdist/standard_default.py index bd73c39d8..301275412 100644 --- a/tests/helpers/templates/sdist/standard_default.py +++ b/tests/helpers/templates/sdist/standard_default.py @@ -16,6 +16,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ) ) diff --git a/tests/helpers/templates/sdist/standard_default_build_script_artifacts.py b/tests/helpers/templates/sdist/standard_default_build_script_artifacts.py index 643702b04..29d2a4b25 100644 --- a/tests/helpers/templates/sdist/standard_default_build_script_artifacts.py +++ b/tests/helpers/templates/sdist/standard_default_build_script_artifacts.py @@ -39,6 +39,7 @@ def initialize(self, version, build_data): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/sdist/standard_default_build_script_extra_dependencies.py b/tests/helpers/templates/sdist/standard_default_build_script_extra_dependencies.py index 9d4ed91da..eb6c0b14b 100644 --- a/tests/helpers/templates/sdist/standard_default_build_script_extra_dependencies.py +++ b/tests/helpers/templates/sdist/standard_default_build_script_extra_dependencies.py @@ -40,6 +40,7 @@ def initialize(self, version, build_data): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Dist: binary """, ), diff --git a/tests/helpers/templates/sdist/standard_default_support_legacy.py b/tests/helpers/templates/sdist/standard_default_support_legacy.py index 3914c2a97..e33ac7a7c 100644 --- a/tests/helpers/templates/sdist/standard_default_support_legacy.py +++ b/tests/helpers/templates/sdist/standard_default_support_legacy.py @@ -16,6 +16,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), File( diff --git a/tests/helpers/templates/sdist/standard_default_vcs_git_exclusion_files.py b/tests/helpers/templates/sdist/standard_default_vcs_git_exclusion_files.py index 527a77c3c..09a8cebb1 100644 --- a/tests/helpers/templates/sdist/standard_default_vcs_git_exclusion_files.py +++ b/tests/helpers/templates/sdist/standard_default_vcs_git_exclusion_files.py @@ -25,6 +25,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/sdist/standard_default_vcs_mercurial_exclusion_files.py b/tests/helpers/templates/sdist/standard_default_vcs_mercurial_exclusion_files.py index 35ba37ecf..f8cc3d596 100644 --- a/tests/helpers/templates/sdist/standard_default_vcs_mercurial_exclusion_files.py +++ b/tests/helpers/templates/sdist/standard_default_vcs_mercurial_exclusion_files.py @@ -31,6 +31,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/sdist/standard_include.py b/tests/helpers/templates/sdist/standard_include.py index d5893b382..96abbe7e4 100644 --- a/tests/helpers/templates/sdist/standard_include.py +++ b/tests/helpers/templates/sdist/standard_include.py @@ -21,6 +21,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Description-Content-Type: text/markdown # My.App diff --git a/tests/helpers/templates/sdist/standard_include_config_file.py b/tests/helpers/templates/sdist/standard_include_config_file.py index 99c435222..27272aee0 100644 --- a/tests/helpers/templates/sdist/standard_include_config_file.py +++ b/tests/helpers/templates/sdist/standard_include_config_file.py @@ -22,6 +22,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Description-Content-Type: text/markdown # My.App diff --git a/tests/helpers/templates/wheel/standard_default_build_script.py b/tests/helpers/templates/wheel/standard_default_build_script.py index adc8f9edb..69d3ceca0 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script.py +++ b/tests/helpers/templates/wheel/standard_default_build_script.py @@ -36,6 +36,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_build_script_artifacts.py b/tests/helpers/templates/wheel/standard_default_build_script_artifacts.py index 2bcd32277..19d0e58fb 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_artifacts.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_artifacts.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_build_script_artifacts_with_src_layout.py b/tests/helpers/templates/wheel/standard_default_build_script_artifacts_with_src_layout.py index 6a4616a09..ac1cc84d8 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_artifacts_with_src_layout.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_artifacts_with_src_layout.py @@ -38,6 +38,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_build_script_configured_build_hooks.py b/tests/helpers/templates/wheel/standard_default_build_script_configured_build_hooks.py index 7556f54ba..31e34ed6d 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_configured_build_hooks.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_configured_build_hooks.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_build_script_extra_dependencies.py b/tests/helpers/templates/wheel/standard_default_build_script_extra_dependencies.py index 5ad08fe31..13d2c95b9 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_extra_dependencies.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_extra_dependencies.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 Requires-Dist: binary """, diff --git a/tests/helpers/templates/wheel/standard_default_build_script_force_include.py b/tests/helpers/templates/wheel/standard_default_build_script_force_include.py index 73534e9d3..d32daf6be 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_force_include.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_force_include.py @@ -38,6 +38,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_build_script_force_include_no_duplication.py b/tests/helpers/templates/wheel/standard_default_build_script_force_include_no_duplication.py index fe03316fd..2ec64023d 100644 --- a/tests/helpers/templates/wheel/standard_default_build_script_force_include_no_duplication.py +++ b/tests/helpers/templates/wheel/standard_default_build_script_force_include_no_duplication.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_extra_metadata.py b/tests/helpers/templates/wheel/standard_default_extra_metadata.py index 57c1262ba..614d09ff6 100644 --- a/tests/helpers/templates/wheel/standard_default_extra_metadata.py +++ b/tests/helpers/templates/wheel/standard_default_extra_metadata.py @@ -38,6 +38,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_license_multiple.py b/tests/helpers/templates/wheel/standard_default_license_multiple.py index 0cdcb2fb5..7a330a70c 100644 --- a/tests/helpers/templates/wheel/standard_default_license_multiple.py +++ b/tests/helpers/templates/wheel/standard_default_license_multiple.py @@ -39,6 +39,8 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSES/Apache-2.0.txt +License-File: LICENSES/MIT.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_default_license_single.py b/tests/helpers/templates/wheel/standard_default_license_single.py index 2e03998a4..066d8e286 100644 --- a/tests/helpers/templates/wheel/standard_default_license_single.py +++ b/tests/helpers/templates/wheel/standard_default_license_single.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_default_namespace_package.py b/tests/helpers/templates/wheel/standard_default_namespace_package.py index 5515700a0..331fe4011 100644 --- a/tests/helpers/templates/wheel/standard_default_namespace_package.py +++ b/tests/helpers/templates/wheel/standard_default_namespace_package.py @@ -39,6 +39,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_default_python_constraint.py b/tests/helpers/templates/wheel/standard_default_python_constraint.py index 86767f948..611f40ba8 100644 --- a/tests/helpers/templates/wheel/standard_default_python_constraint.py +++ b/tests/helpers/templates/wheel/standard_default_python_constraint.py @@ -36,6 +36,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_python_constraint_three_components.py b/tests/helpers/templates/wheel/standard_default_python_constraint_three_components.py index 67e74150c..e1efbb359 100644 --- a/tests/helpers/templates/wheel/standard_default_python_constraint_three_components.py +++ b/tests/helpers/templates/wheel/standard_default_python_constraint_three_components.py @@ -36,6 +36,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: ==3.11.4 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_shared_data.py b/tests/helpers/templates/wheel/standard_default_shared_data.py index 0f1e85724..3132c32ad 100644 --- a/tests/helpers/templates/wheel/standard_default_shared_data.py +++ b/tests/helpers/templates/wheel/standard_default_shared_data.py @@ -39,6 +39,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_shared_scripts.py b/tests/helpers/templates/wheel/standard_default_shared_scripts.py index 7f1ed2853..b89c997bd 100644 --- a/tests/helpers/templates/wheel/standard_default_shared_scripts.py +++ b/tests/helpers/templates/wheel/standard_default_shared_scripts.py @@ -74,6 +74,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_default_single_module.py b/tests/helpers/templates/wheel/standard_default_single_module.py index 63a88494c..00da83449 100644 --- a/tests/helpers/templates/wheel/standard_default_single_module.py +++ b/tests/helpers/templates/wheel/standard_default_single_module.py @@ -34,6 +34,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_default_symlink.py b/tests/helpers/templates/wheel/standard_default_symlink.py index 7998e06ec..c328eafe8 100644 --- a/tests/helpers/templates/wheel/standard_default_symlink.py +++ b/tests/helpers/templates/wheel/standard_default_symlink.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Python: >3 """, ), diff --git a/tests/helpers/templates/wheel/standard_editable_exact.py b/tests/helpers/templates/wheel/standard_editable_exact.py index c0414119f..25d574091 100644 --- a/tests/helpers/templates/wheel/standard_editable_exact.py +++ b/tests/helpers/templates/wheel/standard_editable_exact.py @@ -44,6 +44,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Dist: editables~=0.3 """, ), diff --git a/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py b/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py index 3d2ebc59c..5d25e809a 100644 --- a/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py +++ b/tests/helpers/templates/wheel/standard_editable_exact_extra_dependencies.py @@ -44,6 +44,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Dist: binary Requires-Dist: editables~=0.3 """, diff --git a/tests/helpers/templates/wheel/standard_editable_exact_force_include.py b/tests/helpers/templates/wheel/standard_editable_exact_force_include.py index 28851d512..50e9dc684 100644 --- a/tests/helpers/templates/wheel/standard_editable_exact_force_include.py +++ b/tests/helpers/templates/wheel/standard_editable_exact_force_include.py @@ -45,6 +45,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Dist: editables~=0.3 """, ), diff --git a/tests/helpers/templates/wheel/standard_editable_pth.py b/tests/helpers/templates/wheel/standard_editable_pth.py index c772a9f5d..bb6eb04ce 100644 --- a/tests/helpers/templates/wheel/standard_editable_pth.py +++ b/tests/helpers/templates/wheel/standard_editable_pth.py @@ -36,6 +36,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py b/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py index 889f3632e..8319e36a8 100644 --- a/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py +++ b/tests/helpers/templates/wheel/standard_editable_pth_extra_dependencies.py @@ -36,6 +36,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt Requires-Dist: binary """, ), diff --git a/tests/helpers/templates/wheel/standard_editable_pth_force_include.py b/tests/helpers/templates/wheel/standard_editable_pth_force_include.py index ca76d2618..9c46c46e1 100644 --- a/tests/helpers/templates/wheel/standard_editable_pth_force_include.py +++ b/tests/helpers/templates/wheel/standard_editable_pth_force_include.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_entry_points.py b/tests/helpers/templates/wheel/standard_entry_points.py index 9c0ae6482..4c97d9e8d 100644 --- a/tests/helpers/templates/wheel/standard_entry_points.py +++ b/tests/helpers/templates/wheel/standard_entry_points.py @@ -45,6 +45,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_no_strict_naming.py b/tests/helpers/templates/wheel/standard_no_strict_naming.py index 2fb936946..d02eefed8 100644 --- a/tests/helpers/templates/wheel/standard_no_strict_naming.py +++ b/tests/helpers/templates/wheel/standard_no_strict_naming.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_only_packages_artifact_override.py b/tests/helpers/templates/wheel/standard_only_packages_artifact_override.py index d2bf6ca2a..25c1721c5 100644 --- a/tests/helpers/templates/wheel/standard_only_packages_artifact_override.py +++ b/tests/helpers/templates/wheel/standard_only_packages_artifact_override.py @@ -40,6 +40,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), )) diff --git a/tests/helpers/templates/wheel/standard_tests.py b/tests/helpers/templates/wheel/standard_tests.py index 9171811fd..7ff087fd9 100644 --- a/tests/helpers/templates/wheel/standard_tests.py +++ b/tests/helpers/templates/wheel/standard_tests.py @@ -37,6 +37,7 @@ def get_files(**kwargs): Metadata-Version: {DEFAULT_METADATA_VERSION} Name: {kwargs['project_name']} Version: 0.0.1 +License-File: LICENSE.txt """, ), ))