Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pypa/twine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10bc88d6828a3782da806919fe759c35717b2464
Choose a base ref
..
head repository: pypa/twine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 71addd78f675758fd4859fe101e33365da27220a
Choose a head ref
Showing with 47 additions and 6 deletions.
  1. +41 −0 tests/fixtures/everything.metadata23
  2. 0 tests/fixtures/{everything.metadata → everything.metadata24}
  3. +6 −6 tests/test_repository.py
41 changes: 41 additions & 0 deletions tests/fixtures/everything.metadata23
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Metadata-Version: 2.3
Name: BeagleVote
Version: 1.0a2
Platform: ObscureUnix
Platform: RareDOS
Supported-Platform: RedHat 7.2
Supported-Platform: i386-win32-2791
Summary: A module for collecting votes from beagles.
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Keywords: dog,puppy,voting,election
Home-page: http://www.example.com/~cschultz/bvote/
Download-URL: …/BeagleVote-0.45.tgz
Author: C. Schultz, Universal Features Syndicate,
Los Angeles, CA <cschultz@peanuts.example.com>
Author-email: "C. Schultz" <cschultz@example.com>
Maintainer: C. Schultz, Universal Features Syndicate,
Los Angeles, CA <cschultz@peanuts.example.com>
Maintainer-email: "C. Schultz" <cschultz@example.com>
License: This software may only be obtained by sending the
author a postcard, and then the user promises not
to redistribute it.
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console (Text Based)
Provides-Extra: pdf
Requires-Dist: reportlab; extra == 'pdf'
Requires-Dist: pkginfo
Requires-Dist: PasteDeploy
Requires-Dist: zope.interface (>3.5.0)
Requires-Dist: pywin32 >1.0; sys_platform == 'win32'
Requires-Python: >=3
Requires-External: C
Requires-External: libpng (>=1.5)
Requires-External: make; sys_platform != "win32"
Project-URL: Bug Tracker, http://bitbucket.org/tarek/distribute/issues/
Project-URL: Documentation, https://example.com/BeagleVote
Provides-Dist: OtherProject
Provides-Dist: AnotherProject (3.4)
Provides-Dist: virtual_package; python_version >= "3.4"
Dynamic: Obsoletes-Dist

This description intentionally left blank.
File renamed without changes.
12 changes: 6 additions & 6 deletions tests/test_repository.py
Original file line number Diff line number Diff line change
@@ -61,14 +61,14 @@ def test_iterables_are_flattened():
assert tuples == [("platform", "UNKNOWN"), ("platform", "ANOTHERPLATFORM")]


@pytest.mark.skipif(
version.Version(packaging.__version__) < version.Version("24.1"),
reason="packaging is too old",
)
def test_all_metadata_fields_are_flattened(monkeypatch):
"""Verify that package metadata fields are correctly flattened."""
# This file contains all metadata fields known up to metadata version 2.4.
metadata = open("tests/fixtures/everything.metadata")
if version.Version(packaging.__version__) < version.Version("24.1"):
# All metadata fields up to metadata version 2.3
metadata = open("tests/fixtures/everything.metadata23")
else:
# All metadata fields up to metadata version 2.4
metadata = open("tests/fixtures/everything.metadata24")
monkeypatch.setattr(package.wheel.Wheel, "read", metadata.read)
filename = "tests/fixtures/twine-1.5.0-py2.py3-none-any.whl"
data = package.PackageFile.from_filename(