Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 99855dc

Browse files
committedNov 19, 2024
MAINT: bump required pyproject-metadata version to 0.9.0
Having PEP 639 metadata supported or not based on the version of a transitive dependency would not make for a great user experience. Supporting PEP 639 metadata requires pyproject-metadata 0.9.0.
1 parent 8de712f commit 99855dc

File tree

6 files changed

+5
-22
lines changed

6 files changed

+5
-22
lines changed
 

‎.github/workflows/tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ jobs:
9898
- os: windows-latest
9999
python: '3.12'
100100
meson: '@git+https://github.com/mesonbuild/meson.git'
101-
# Test with oldest supported pyproject-metadata
102-
- os: ubuntu-latest
103-
python: '3.12'
104-
pyproject_metadata: '==0.8.0'
105101

106102
steps:
107103
- name: Checkout

‎pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requires = [
99
'meson >= 0.64.0; python_version < "3.12"',
1010
'meson >= 1.2.3; python_version >= "3.12"',
1111
'packaging >= 19.0',
12-
'pyproject-metadata >= 0.8.0',
12+
'pyproject-metadata >= 0.9.0',
1313
'tomli >= 1.0.0; python_version < "3.11"',
1414
]
1515

@@ -37,7 +37,7 @@ dependencies = [
3737
'meson >= 0.64.0; python_version < "3.12"',
3838
'meson >= 1.2.3; python_version >= "3.12"',
3939
'packaging >= 19.0',
40-
'pyproject-metadata >= 0.8.0',
40+
'pyproject-metadata >= 0.9.0',
4141
'tomli >= 1.0.0; python_version < "3.11"',
4242
]
4343

‎tests/conftest.py

-3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818

1919
import packaging.metadata
2020
import packaging.version
21-
import pyproject_metadata
2221
import pytest
2322

2423
import mesonpy
2524

2625
from mesonpy._util import chdir
2726

2827

29-
PYPROJECT_METADATA_VERSION = tuple(map(int, pyproject_metadata.__version__.split('.')[:2]))
30-
3128
_meson_ver_str = subprocess.run(['meson', '--version'], check=True, stdout=subprocess.PIPE, text=True).stdout
3229
MESON_VERSION = tuple(map(int, _meson_ver_str.split('.')[:3]))
3330

‎tests/test_project.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import mesonpy
2121

22-
from .conftest import MESON_VERSION, PYPROJECT_METADATA_VERSION, in_git_repo_context, metadata, package_dir
22+
from .conftest import MESON_VERSION, in_git_repo_context, metadata, package_dir
2323

2424

2525
def test_unsupported_python_version(package_unsupported_python_version):
@@ -40,7 +40,6 @@ def test_missing_dynamic_version(package_missing_dynamic_version):
4040
pass
4141

4242

43-
@pytest.mark.skipif(PYPROJECT_METADATA_VERSION < (0, 9), reason='pyproject-metadata too old')
4443
@pytest.mark.skipif(MESON_VERSION < (1, 6, 0), reason='meson too old')
4544
@pytest.mark.filterwarnings('ignore:canonicalization and validation of license expression')
4645
def test_meson_build_metadata(tmp_path):
@@ -67,7 +66,6 @@ def test_meson_build_metadata(tmp_path):
6766
'''))
6867

6968

70-
@pytest.mark.skipif(PYPROJECT_METADATA_VERSION < (0, 9), reason='pyproject-metadata too old')
7169
@pytest.mark.skipif(MESON_VERSION < (1, 6, 0), reason='meson too old')
7270
@pytest.mark.filterwarnings('ignore:canonicalization and validation of license expression')
7371
def test_dynamic_license(tmp_path):
@@ -96,7 +94,6 @@ def test_dynamic_license(tmp_path):
9694
'''))
9795

9896

99-
@pytest.mark.skipif(PYPROJECT_METADATA_VERSION < (0, 9), reason='pyproject-metadata too old')
10097
@pytest.mark.skipif(MESON_VERSION < (1, 6, 0), reason='meson too old')
10198
@pytest.mark.filterwarnings('ignore:canonicalization and validation of license expression')
10299
def test_dynamic_license_list(tmp_path):

‎tests/test_sdist.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,9 @@ def test_pep621_metadata(sdist_full_metadata):
3232
sdist_pkg_info = sdist.extractfile('full_metadata-1.2.3/PKG-INFO').read()
3333

3434
meta = metadata(sdist_pkg_info)
35-
36-
# pyproject-metadata prior to 0.9.0 strips trailing newlines
35+
# Including the trailing newline in the expected value is inconvenient.
3736
meta['license'] = meta['license'].rstrip()
3837

39-
# pyproject-metadata 0.9.0 and later does not emit Home-Page
40-
meta.pop('home_page', None)
41-
# nor normalizes Project-URL keys
42-
meta['project_urls'] = {k.lower(): v for k, v in meta['project_urls'].items()}
43-
4438
assert meta == metadata(textwrap.dedent('''\
4539
Metadata-Version: 2.1
4640
Name: full-metadata

‎tests/test_wheel.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import mesonpy
1818

19-
from .conftest import MESON_VERSION, PYPROJECT_METADATA_VERSION, adjust_packaging_platform_tag, metadata
19+
from .conftest import MESON_VERSION, adjust_packaging_platform_tag, metadata
2020

2121

2222
EXT_SUFFIX = sysconfig.get_config_var('EXT_SUFFIX')
@@ -136,7 +136,6 @@ def test_contents_license_file(wheel_license_file):
136136
assert artifact.read('license_file-1.0.0.dist-info/LICENSE.custom').rstrip() == b'Hello!'
137137

138138

139-
@pytest.mark.xfail(PYPROJECT_METADATA_VERSION < (0, 9), reason='pyproject-metadata too old')
140139
@pytest.mark.filterwarnings('ignore:canonicalization and validation of license expression')
141140
def test_license_pep639(wheel_license_pep639):
142141
artifact = wheel.wheelfile.WheelFile(wheel_license_pep639)

0 commit comments

Comments
 (0)