1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Use more kwargs for install_req_from_line

For better readability
This commit is contained in:
Stéphane Bidoul 2023-03-19 15:23:56 +01:00
parent efe9d4b762
commit 5ea358122a
2 changed files with 12 additions and 12 deletions

View file

@ -411,7 +411,7 @@ class RequirementCommand(IndexGroupCommand):
for req in args:
req_to_add = install_req_from_line(
req,
None,
comes_from=None,
isolated=options.isolated_mode,
use_pep517=options.use_pep517,
user_supplied=True,

View file

@ -63,7 +63,7 @@ def test_duplicates_sort_ok(data: TestData) -> None:
def test_finder_detects_latest_find_links(data: TestData) -> None:
"""Test PackageFinder detects latest using find-links"""
req = install_req_from_line("simple", None)
req = install_req_from_line("simple")
finder = make_test_finder(find_links=[data.find_links])
found = finder.find_requirement(req, False)
assert found is not None
@ -72,7 +72,7 @@ def test_finder_detects_latest_find_links(data: TestData) -> None:
def test_incorrect_case_file_index(data: TestData) -> None:
"""Test PackageFinder detects latest using wrong case"""
req = install_req_from_line("dinner", None)
req = install_req_from_line("dinner")
finder = make_test_finder(index_urls=[data.find_links3])
found = finder.find_requirement(req, False)
assert found is not None
@ -82,7 +82,7 @@ def test_incorrect_case_file_index(data: TestData) -> None:
@pytest.mark.network
def test_finder_detects_latest_already_satisfied_find_links(data: TestData) -> None:
"""Test PackageFinder detects latest already satisfied using find-links"""
req = install_req_from_line("simple", None)
req = install_req_from_line("simple")
# the latest simple in local pkgs is 3.0
latest_version = "3.0"
satisfied_by = Mock(
@ -99,7 +99,7 @@ def test_finder_detects_latest_already_satisfied_find_links(data: TestData) -> N
@pytest.mark.network
def test_finder_detects_latest_already_satisfied_pypi_links() -> None:
"""Test PackageFinder detects latest already satisfied using pypi links"""
req = install_req_from_line("initools", None)
req = install_req_from_line("initools")
# the latest initools on PyPI is 0.3.1
latest_version = "0.3.1"
satisfied_by = Mock(
@ -180,7 +180,7 @@ class TestWheel:
Test existing install has priority over wheels.
`test_link_sorting` also covers this at a lower level
"""
req = install_req_from_line("priority", None)
req = install_req_from_line("priority")
latest_version = "1.0"
satisfied_by = Mock(
location="/path",
@ -309,7 +309,7 @@ class TestCandidateEvaluator:
def test_finder_priority_file_over_page(data: TestData) -> None:
"""Test PackageFinder prefers file links over equivalent page links"""
req = install_req_from_line("gmpy==1.15", None)
req = install_req_from_line("gmpy==1.15")
finder = make_test_finder(
find_links=[data.find_links],
index_urls=["http://pypi.org/simple/"],
@ -328,7 +328,7 @@ def test_finder_priority_file_over_page(data: TestData) -> None:
def test_finder_priority_nonegg_over_eggfragments() -> None:
"""Test PackageFinder prefers non-egg links over "#egg=" links"""
req = install_req_from_line("bar==1.0", None)
req = install_req_from_line("bar==1.0")
links = ["http://foo/bar.py#egg=bar-1.0", "http://foo/bar-1.0.tar.gz"]
finder = make_test_finder(links)
@ -358,7 +358,7 @@ def test_finder_only_installs_stable_releases(data: TestData) -> None:
Test PackageFinder only accepts stable versioned releases by default.
"""
req = install_req_from_line("bar", None)
req = install_req_from_line("bar")
# using a local index (that has pre & dev releases)
finder = make_test_finder(index_urls=[data.index_url("pre")])
@ -404,7 +404,7 @@ def test_finder_installs_pre_releases(data: TestData) -> None:
Test PackageFinder finds pre-releases if asked to.
"""
req = install_req_from_line("bar", None)
req = install_req_from_line("bar")
# using a local index (that has pre & dev releases)
finder = make_test_finder(
@ -436,7 +436,7 @@ def test_finder_installs_dev_releases(data: TestData) -> None:
Test PackageFinder finds dev releases if asked to.
"""
req = install_req_from_line("bar", None)
req = install_req_from_line("bar")
# using a local index (that has dev releases)
finder = make_test_finder(
@ -452,7 +452,7 @@ def test_finder_installs_pre_releases_with_version_spec() -> None:
"""
Test PackageFinder only accepts stable versioned releases by default.
"""
req = install_req_from_line("bar>=0.0.dev0", None)
req = install_req_from_line("bar>=0.0.dev0")
links = ["https://foo/bar-1.0.tar.gz", "https://foo/bar-2.0b1.tar.gz"]
finder = make_test_finder(links)