diff options
| author | Benoit Pierre <benoit.pierre@gmail.com> | 2018-09-24 23:03:32 +0200 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2018-09-25 00:03:32 +0300 |
| commit | 22a311a3baa200ec983dfdc7f100878866649fa2 (patch) | |
| tree | eb2138a8359dc6e8164da222959045a042dfac3f /tests/test_metadata.py | |
| parent | 6f26efa13ed6ec4dfe5e1d4645ba86e26c458241 (diff) | |
| download | wheel-git-22a311a3baa200ec983dfdc7f100878866649fa2.tar.gz | |
Fixed handling of extras (#252)
Ensure extras are properly canonicalized, so corresponding `Provides-Dist` markers will match with the list of extras returned by pkg_resources.
Diffstat (limited to 'tests/test_metadata.py')
| -rw-r--r-- | tests/test_metadata.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 78fe40d..5e69603 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -6,14 +6,18 @@ def test_pkginfo_to_metadata(tmpdir): ('Metadata-Version', '2.1'), ('Name', 'spam'), ('Version', '0.1'), - ('Provides-Extra', 'test'), + ('Requires-Dist', "pip @ https://github.com/pypa/pip/archive/1.3.1.zip"), + ('Requires-Dist', 'pywin32; sys_platform=="win32"'), ('Provides-Extra', 'signatures'), + ('Requires-Dist', 'pyxdg; (sys_platform!="win32") and extra == \'signatures\''), + ('Provides-Extra', 'empty_extra'), ('Provides-Extra', 'faster-signatures'), - ('Requires-Dist', "pip @ https://github.com/pypa/pip/archive/1.3.1.zip"), ('Requires-Dist', "ed25519ll; extra == 'faster-signatures'"), + ('Provides-Extra', 'rest'), + ('Requires-Dist', "docutils (>=0.8); extra == 'rest'"), ('Requires-Dist', "keyring; extra == 'signatures'"), ('Requires-Dist', "keyrings.alt; extra == 'signatures'"), - ('Requires-Dist', 'pyxdg; (sys_platform!="win32") and extra == \'signatures\''), + ('Provides-Extra', 'test'), ('Requires-Dist', "pytest (>=3.0.0); extra == 'test'"), ('Requires-Dist', "pytest-cov; extra == 'test'"), ] @@ -23,22 +27,33 @@ def test_pkginfo_to_metadata(tmpdir): Metadata-Version: 0.0 Name: spam Version: 0.1 +Provides-Extra: empty+extra Provides-Extra: test +Provides-Extra: reST Provides-Extra: signatures +Provides-Extra: Signatures Provides-Extra: faster-signatures""") egg_info_dir = tmpdir.ensure_dir('test.egg-info') egg_info_dir.join('requires.txt').write("""\ pip@https://github.com/pypa/pip/archive/1.3.1.zip +[empty+extra] + +[:sys_platform=="win32"] +pywin32 + [faster-signatures] ed25519ll +[reST] +docutils>=0.8 + [signatures] keyring keyrings.alt -[signatures:sys_platform!="win32"] +[Signatures:sys_platform!="win32"] pyxdg [test] |
