File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MIT
44
55import pathlib
6+ import re
67
78import packaging .version
89import pyproject_metadata
@@ -48,5 +49,10 @@ def test_missing_version(package_missing_version):
4849 pyproject = {'project' : {
4950 'name' : 'missing-version' ,
5051 }}
51- with pytest .raises (pyproject_metadata .ConfigurationError , match = 'Required "project.version" field is missing' ):
52+ match = '|' .join ((
53+ re .escape ('Required "project.version" field is missing' ),
54+ # pyproject-metatadata 0.8.0 and later
55+ re .escape ('Field "project.version" missing and "version" not specified in "project.dynamic"' ),
56+ ))
57+ with pytest .raises (pyproject_metadata .ConfigurationError , match = match ):
5258 Metadata .from_pyproject (pyproject , pathlib .Path ())
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MIT
44
55import os
6+ import re
67import stat
78import sys
89import tarfile
@@ -30,7 +31,7 @@ def test_pep621(sdist_full_metadata):
3031 with tarfile .open (sdist_full_metadata , 'r:gz' ) as sdist :
3132 sdist_pkg_info = sdist .extractfile ('full_metadata-1.2.3/PKG-INFO' ).read ().decode ()
3233
33- assert sdist_pkg_info == textwrap .dedent ('''\
34+ metadata = re . escape ( textwrap .dedent ('''\
3435 Metadata-Version: 2.1
3536 Name: full-metadata
3637 Version: 1.2.3
@@ -65,7 +66,11 @@ def test_pep621(sdist_full_metadata):
6566 # full-metadata
6667
6768 An example package with all of the PEP 621 metadata!
68- ''' )
69+ ''' ))
70+
71+ # pyproject-metadata 0.8.0 and later uses a comma to separate keywords
72+ expr = metadata .replace (r'Keywords:\ full\ metadata' , r'Keywords:\ full[ ,]metadata' )
73+ assert re .fullmatch (expr , sdist_pkg_info )
6974
7075
7176def test_dynamic_version (sdist_dynamic_version ):
You can’t perform that action at this time.
0 commit comments