Remove unused req_description from wheel_dist_info_dir

This commit is contained in:
Chris Hunt 2019-12-31 13:44:20 -05:00
parent e1c7de8861
commit 6c56557fbe
2 changed files with 7 additions and 7 deletions

View File

@ -314,7 +314,7 @@ def install_unpacked_wheel(
source = wheeldir.rstrip(os.path.sep) + os.path.sep
try:
info_dir = wheel_dist_info_dir(source, req_description, name)
info_dir = wheel_dist_info_dir(source, name)
metadata = wheel_metadata(wheeldir)
version = wheel_version(metadata)
except UnsupportedWheel as e:
@ -624,8 +624,8 @@ def install_wheel(
)
def wheel_dist_info_dir(source, req_description, name):
# type: (str, str, str) -> str
def wheel_dist_info_dir(source, name):
# type: (str, str) -> str
"""Returns the name of the contained .dist-info directory.
Raises AssertionError or UnsupportedWheel if not found, >1 found, or

View File

@ -194,27 +194,27 @@ def test_get_csv_rows_for_installed__long_lines(tmpdir, caplog):
def test_wheel_dist_info_dir_found(tmpdir):
expected = "simple-0.1.dist-info"
tmpdir.joinpath(expected).mkdir()
assert wheel.wheel_dist_info_dir(str(tmpdir), "", "simple") == expected
assert wheel.wheel_dist_info_dir(str(tmpdir), "simple") == expected
def test_wheel_dist_info_dir_multiple(tmpdir):
tmpdir.joinpath("simple-0.1.dist-info").mkdir()
tmpdir.joinpath("unrelated-0.1.dist-info").mkdir()
with pytest.raises(UnsupportedWheel) as e:
wheel.wheel_dist_info_dir(str(tmpdir), "", "simple")
wheel.wheel_dist_info_dir(str(tmpdir), "simple")
assert "multiple .dist-info directories found" in str(e.value)
def test_wheel_dist_info_dir_none(tmpdir):
with pytest.raises(UnsupportedWheel) as e:
wheel.wheel_dist_info_dir(str(tmpdir), "", "simple")
wheel.wheel_dist_info_dir(str(tmpdir), "simple")
assert "directory not found" in str(e.value)
def test_wheel_dist_info_dir_wrong_name(tmpdir):
tmpdir.joinpath("unrelated-0.1.dist-info").mkdir()
with pytest.raises(UnsupportedWheel) as e:
wheel.wheel_dist_info_dir(str(tmpdir), "", "simple")
wheel.wheel_dist_info_dir(str(tmpdir), "simple")
assert "does not start with 'simple'" in str(e.value)