File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ def test_missing_version(package_missing_version):
5353 re .escape ('Required "project.version" field is missing' ),
5454 # pyproject-metatadata 0.8.0 and later
5555 re .escape ('Field "project.version" missing and "version" not specified in "project.dynamic"' ),
56+ # pyproject-metatadata 0.9.0 and later
57+ re .escape ('Field "project.version" missing and \' version\' not specified in "project.dynamic"' ),
5658 ))
5759 with pytest .raises (pyproject_metadata .ConfigurationError , match = match ):
5860 Metadata .from_pyproject (pyproject , pathlib .Path ())
Original file line number Diff line number Diff line change 1717
1818from .conftest import in_git_repo_context
1919
20+ import packaging
21+ import pyproject_metatada
22+
23+ if packaging .version .Version (pyproject_metadata .__version__ ) < packaging .version .Version ('0.9a0' ):
24+ _normalize = lambda x : x
25+ else :
26+ _normalize = lambda x : x .replace ('\n \n ' , '\n ' )
27+
2028
2129def test_no_pep621 (sdist_library ):
2230 with tarfile .open (sdist_library , 'r:gz' ) as sdist :
2331 sdist_pkg_info = sdist .extractfile ('library-1.0.0/PKG-INFO' ).read ().decode ()
2432
25- assert sdist_pkg_info == textwrap . dedent ('''\
33+ assert _normalize ( sdist_pkg_info ) == _metadata ('''\
2634 Metadata-Version: 2.1
2735 Name: library
2836 Version: 1.0.0
@@ -79,7 +87,7 @@ def test_dynamic_version(sdist_dynamic_version):
7987 with tarfile .open (sdist_dynamic_version , 'r:gz' ) as sdist :
8088 sdist_pkg_info = sdist .extractfile ('dynamic_version-1.0.0/PKG-INFO' ).read ().decode ()
8189
82- assert sdist_pkg_info == textwrap .dedent ('''\
90+ assert _normalize ( sdist_pkg_info ) == textwrap .dedent ('''\
8391 Metadata-Version: 2.1
8492 Name: dynamic-version
8593 Version: 1.0.0
You can’t perform that action at this time.
0 commit comments