Compare commits

...

10 Commits

Author SHA1 Message Date
Josh Cannon 46380786c5
Merge 0e4d9b9d6c into a15dd75d98 2023-11-29 15:16:42 -07:00
Tzu-ping Chung a15dd75d98
Merge pull request #12417 from xqm32/fix-outdated-pip-install 2023-11-28 16:08:29 +09:00
Tzu-ping Chung d8ab6dc6c1 Clarify news fragment 2023-11-28 15:06:25 +08:00
Qiming Xu fe10d368f6
Add end line 2023-11-28 14:25:56 +08:00
Qiming Xu 28250baffb
Fix line wrap length and add news entry 2023-11-28 14:17:51 +08:00
Qiming Xu 88ac529219
Fix outdated pip install argument description 2023-11-28 13:15:31 +08:00
Joshua 0e4d9b9d6c Add missing --dry-run 2023-09-06 10:33:59 -05:00
Tzu-ping Chung 7a16f19683
Merge branch 'main' into jcannon/issue12216 2023-09-06 15:28:55 +08:00
Joshua a9fa7eb1ca newline 2023-08-08 14:33:38 -05:00
Joshua 05bd8702f6 Fix resolution to respect ``--python-version`` when checking ``Requires-Python`` 2023-08-08 14:18:36 -05:00
6 changed files with 33 additions and 3 deletions

View File

@ -45,8 +45,8 @@ When looking at the items to be installed, pip checks what type of item
each is, in the following order:
1. Project or archive URL.
2. Local directory (which must contain a ``setup.py``, or pip will report
an error).
2. Local directory (which must contain a ``pyproject.toml`` or ``setup.py``,
otherwise pip will report an error).
3. Local file (a sdist or wheel format archive, following the naming
conventions for those formats).
4. A requirement, as specified in :pep:`440`.

1
news/12216.bugfix.rst Normal file
View File

@ -0,0 +1 @@
Fix resolution to respect ``--python-version`` when checking ``Requires-Python``.

1
news/12417.doc.rst Normal file
View File

@ -0,0 +1 @@
Fix outdated pip install argument description in documentation.

View File

@ -370,6 +370,7 @@ class InstallCommand(RequirementCommand):
force_reinstall=options.force_reinstall,
upgrade_strategy=upgrade_strategy,
use_pep517=options.use_pep517,
py_version_info=options.python_version,
)
self.trace_basic_info(finder)

View File

@ -376,7 +376,10 @@ def _common_wheel_editable_install(
tmpdir_factory: pytest.TempPathFactory, common_wheels: Path, package: str
) -> Path:
wheel_candidates = list(common_wheels.glob(f"{package}-*.whl"))
assert len(wheel_candidates) == 1, wheel_candidates
assert len(wheel_candidates) == 1, (
f"Missing wheels in {common_wheels}, expected 1 got '{wheel_candidates}'."
" Are you running the tests via nox? See https://pip.pypa.io/en/latest/development/getting-started/#running-tests"
)
install_dir = tmpdir_factory.mktemp(package) / "install"
lib_install_dir = install_dir / "lib"
bin_install_dir = install_dir / "bin"

View File

@ -416,6 +416,30 @@ def test_new_resolver_requires_python_error(script: PipTestEnvironment) -> None:
assert message in result.stderr, str(result)
def test_new_resolver_requires_python_ok_with_python_version_flag(
script: PipTestEnvironment,
) -> None:
create_basic_wheel_for_package(
script,
"base",
"0.1.0",
requires_python="<3",
)
result = script.pip(
"install",
"--no-cache-dir",
"--no-index",
"--find-links",
script.scratch_path,
"--dry-run",
"--python-version=2",
"--only-binary=:all:",
"base",
)
assert not result.stderr, str(result)
def test_new_resolver_installed(script: PipTestEnvironment) -> None:
create_basic_wheel_for_package(
script,