Repository: pypa/pipenv

Issue:
pipenv not obeying python version requirement of dependencies
### Issue description

When locking a package, which has a dependency, pipenv is not checking the dependency's python version compatibility causing locking to fail

### Expected result

pipenv should filter out versions of sub-dependency that are not compatible with target python version.  Note in the following the Pipfile specifies python3.8, yet it's trying to install numpy 1.25.2 which is not compatible with python3.8: https://github.com/numpy/numpy/blob/v1.25.2/pyproject.toml#L43

### Actual result

<details>
<summary>verbose locking output</summary
root@4ec0901c5530:/tmp/test# pipenv lock -v -v -v
Using python: 3.8
Path to python: /usr/local/bin/python3.8
Creating a virtualenv for this project...
Pipfile: /tmp/test/Pipfile
Using /usr/local/bin/python3.8 (3.8.17) to create virtualenv...
⠙ Creating virtual environment...created virtual environment CPython3.8.17.final.0-64 in 113ms
  creator CPython3Posix(dest=/root/.local/share/virtualenvs/test-hxkKlP5o, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.1.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/test-hxkKlP5o
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting()
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('scikit-learn==1.3.0'), None)
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting scikit-learn==1.3.0 (from -r /tmp/pipenv-3qh2ptr5-requirements/pipenv-kho1kjh1-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining dependency information for scikit-learn==1.3.0 from https://files.pythonhosted.org/packages/f0/dc/898e462497fcbaf8ab2e744c58acf463f74e542f71956fc364bf156c262c/scikit_learn-1.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
INFO:pipenv.patched.pip._internal.network.download:Using cached scikit_learn-1.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (11 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(0)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('numpy>=1.17.3'), LinkCandidate('https://files.pythonhosted.org/packages/f0/dc/898e462497fcbaf8ab2e744c58acf463f74e542f71956fc364bf156c262c/scikit_learn-1.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl 
(from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting numpy>=1.17.3 (from scikit-learn==1.3.0->-r /tmp/pipenv-3qh2ptr5-requirements/pipenv-kho1kjh1-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.network.download:Downloading numpy-1.25.2.tar.gz (10.8 MB)
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: started
INFO:pipenv.patched.pip._internal.cli.spinners:Installing build dependencies: finished with status 'done'
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: started
INFO:pipenv.patched.pip._internal.cli.spinners:Getting requirements to build wheel: finished with status 'error'
ERROR:pip.subprocessor: Getting requirements to build wheel exited with 1
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 445, in resolve
    results = resolver.resolve(constraints, check_supported_wheels=False)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 230, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
    return any(self)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
    self._link_candidate_cache = LinkCandidate(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/candidates.py", line 297, in __init__
    super().__init__(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/candidates.py", line 157, in __init__
    self.dist = self._prepare()
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/candidates.py", line 226, in _prepare
    dist = self._prepare_distribution()
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolution/resolvelib/candidates.py", line 308, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/operations/prepare.py", line 538, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/operations/prepare.py", line 653, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/distributions/sdist.py", line 48, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/distributions/sdist.py", line 118, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/distributions/sdist.py", line 95, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/utils/misc.py", line 697, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/pyproject_hooks/_impl.py", line 311, in _call_hook
    self._subprocess_runner(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/utils/subprocess.py", line 252, in runner
    call_subprocess(
  File "/usr/local/lib/python3.8/site-packages/pipenv/patched/pip/_internal/utils/subprocess.py", line 224, in call_subprocess
    raise error
pipenv.patched.pip._internal.exceptions.InstallationSubprocessError: Getting requirements to build wheel exited with 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pipenv/resolver.py", line 675, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/pipenv/resolver.py", line 661, in main
    _main(
  File "/usr/local/lib/python3.8/site-packages/pipenv/resolver.py", line 645, in _main
    resolve_packages(
  File "/usr/local/lib/python3.8/site-packages/pipenv/resolver.py", line 612, in resolve_packages
    results, resolver = resolve(
  File "/usr/local/lib/python3.8/site-packages/pipenv/resolver.py", line 592, in resolve
    return resolve_deps(
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 897, in resolve_deps
    results, hashes, internal_resolver = actually_resolve_deps(
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 670, in actually_resolve_deps
    resolver.resolve()
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 447, in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: [31m[1mERROR[0m: [33mGetting requirements to build wheel exited with 1[0m
✘ Locking Failed!
⠧ Locking...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pipenv/cli/command.py", line 340, in lock
    do_lock(
  File "/usr/local/lib/python3.8/site-packages/pipenv/routines/lock.py", line 65, in do_lock
    venv_resolve_deps(
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 838, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
  File "/usr/local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 707, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!
</details

### Steps to replicate

```
[[source]]
name = "public_pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
scikit-learn = "==1.3.0"

[requires]
python_version = "3.8"
```

-------------------------------------------------------------------------------

<details><summary>$ pipenv --support</summary>

Pipenv version: `'2023.9.7'`

Pipenv location: `'/usr/local/lib/python3.8/site-packages/pipenv'`

Python location: `'/usr/local/bin/python3'`

OS Name: `'posix'`

User pip version: `'23.2.1'`

user Python installations found:


PEP 508 Information:

```
{'implementation_name': 'cpython',
 'implementation_version': '3.8.17',
 'os_name': 'posix',
 'platform_machine': 'aarch64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.49-linuxkit-pr',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023',
 'python_full_version': '3.8.17',
 'python_version': '3.8',
 'sys_platform': 'linux'}
```

System environment variables:

  - `DUMB_INIT_SETSID`
  - `HOSTNAME`
  - `AWS_DEFAULT_REGION`
  - `PWD`
  - `TZ`
  - `HOME`
  - `LANG`
  - `VIRTUALENV_NO_DOWNLOAD`
  - `TERM`
  - `SHLVL`
  - `REQUESTS_CA_BUNDLE`
  - `PATH`
  - `DEBIAN_FRONTEND`
  - `_`
  - `OLDPWD`
  - `PIP_DISABLE_PIP_VERSION_CHECK`
  - `PYTHONDONTWRITEBYTECODE`
  - `PYTHONFINDER_IGNORE_UNSUPPORTED`

Pipenv–specific environment variables:


Debug–specific environment variables:

  - `PATH`: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`
  - `LANG`: `en_US.utf8`
  - `PWD`: `/tmp/test`


---------------------------

Contents of `Pipfile` ('/tmp/test/Pipfile'):

```toml
[[source]]
name = "public_pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
scikit-learn = "==1.3.0"

[requires]
python_version = "3.8"

```

</details>




Discussion:
@thehesiod that is because the wheel you are specifying of sci-kit learn does not include markers on the numpy dependency -- the pip resolver only knows about these things via markers, and the METADATA file of that wheel simply states:
`Requires-Dist: numpy (>=1.17.3)` 

I am curious though if this worked for you on `2023.9.1` or not -- we did restore the ignore compatibility finder pipenv patch in `2023.9.7` that has usually be present until semi-recently and was added back because it affects hash collection from google artifact registry when we removed it.   If it worked in 9.1 then that could be to blame, otherwise its what I said originally.
wow thanks for being so responsive. ok so basically just not supported by pip. one would imagine though that after pipenv pulls the dep it could do a second phase check and then exclude the version. probably feature enhancement.
@thehesiod the good news that I forgot to mention is you can override that in your Pipfile by adding a numpy specifier that works for your python version or adding a marker to it, and I think  that should override the inputs to the pip resolver to ensure the other specifier doesn't cause lock failure.
ya we fixed it by pinning the numpy version
Actually I found the issue -- one second.
```
matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv-triage/issue-5924
$ cat Pipfile
[[source]]
name = "public_pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
scikit-learn = "==1.3.0"

[requires]
python_version = "3.8"

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv-triage/issue-5924
$ pipenv lock -v
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting()
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('scikit-learn==1.3.0'), None)
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting scikit-learn==1.3.0 (from -r C:\Users\matte\AppData\Local\Temp\pipenv-q6si6es1-requirements\pipenv-zk0r1pdb-constraints.txt (line 2))
INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining dependency information for scikit-learn==1.3.0 from
https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl.metadata
INFO:pipenv.patched.pip._internal.network.download:Using cached scikit_learn-1.3.0-cp38-cp38-win_amd64.whl.metadata (11 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(0)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('numpy>=1.17.3'),
LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/)
(requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting numpy>=1.17.3 (from scikit-learn==1.3.0->-r C:\Users\matte\AppData\Local\Temp\pipenv-q6si6es1-requirements\pipenv-zk0r1pdb-constraints.txt (line
2))
INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining dependency information for numpy>=1.17.3 from
https://files.pythonhosted.org/packages/69/65/0d47953afa0ad569d12de5f65d964321c208492064c38fe3b0b9744f8d44/numpy-1.24.4-cp38-cp38-win_amd64.whl.metadata
INFO:pipenv.patched.pip._internal.network.download:Downloading numpy-1.24.4-cp38-cp38-win_amd64.whl.metadata (5.6 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('scipy>=1.5.0'),
LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/)
(requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting scipy>=1.5.0 (from scikit-learn==1.3.0->-r C:\Users\matte\AppData\Local\Temp\pipenv-q6si6es1-requirements\pipenv-zk0r1pdb-constraints.txt (line
2))
INFO:pipenv.patched.pip._internal.network.download:Downloading scipy-1.10.1-cp38-cp38-win_amd64.whl (42.2 MB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('joblib>=1.1.1'),
LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/)
(requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting joblib>=1.1.1 (from scikit-learn==1.3.0->-r C:\Users\matte\AppData\Local\Temp\pipenv-q6si6es1-requirements\pipenv-zk0r1pdb-constraints.txt (line
2))
INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining dependency information for joblib>=1.1.1 from
https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl.metadata
INFO:pipenv.patched.pip._internal.network.download:Downloading joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('threadpoolctl>=2.0.0'),
LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/)
(requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.operations.prepare:Collecting threadpoolctl>=2.0.0 (from scikit-learn==1.3.0->-r C:\Users\matte\AppData\Local\Temp\pipenv-q6si6es1-requirements\pipenv-zk0r1pdb-constraints.txt
(line 2))
INFO:pipenv.patched.pip._internal.operations.prepare:Obtaining dependency information for threadpoolctl>=2.0.0 from
https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threadpoolctl-3.2.0-py3-none-any.whl.metadata
INFO:pipenv.patched.pip._internal.network.download:Downloading threadpoolctl-3.2.0-py3-none-any.whl.metadata (10.0 kB)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/sciki
t_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(0, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(1)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/jobli
b-1.3.2-py3-none-any.whl (from https://pypi.org/simple/joblib/) (requires-python:>=3.7)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(1, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(2)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/69/65/0d47953afa0ad569d12de5f65d964321c208492064c38fe3b0b9744f8d44/numpy
-1.24.4-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/numpy/) (requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(2, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(3)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('numpy<1.27.0,>=1.19.5'),
LinkCandidate('https://files.pythonhosted.org/packages/32/8e/7f403535ddf826348c9b8417791e28712019962f7e90ff845896d6325d09/scipy-1.10.1-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scipy/)
(requires-python:<3.12,>=3.8)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/32/8e/7f403535ddf826348c9b8417791e28712019962f7e90ff845896d6325d09/scipy
-1.10.1-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scipy/) (requires-python:<3.12,>=3.8)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(3, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(4)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.pinning(LinkCandidate('https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threa
dpoolctl-3.2.0-py3-none-any.whl (from https://pypi.org/simple/threadpoolctl/) (requires-python:>=3.8)'))
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending_round(4, state)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.starting_round(5)
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.ending(State(mapping=OrderedDict([('scikit-learn',
LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scikit-learn/)
(requires-python:>=3.8)')), ('joblib', LinkCandidate('https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl (from
https://pypi.org/simple/joblib/) (requires-python:>=3.7)')), ('numpy',
LinkCandidate('https://files.pythonhosted.org/packages/69/65/0d47953afa0ad569d12de5f65d964321c208492064c38fe3b0b9744f8d44/numpy-1.24.4-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/numpy/)
(requires-python:>=3.8)')), ('scipy', LinkCandidate('https://files.pythonhosted.org/packages/32/8e/7f403535ddf826348c9b8417791e28712019962f7e90ff845896d6325d09/scipy-1.10.1-cp38-cp38-win_amd64.whl (from
https://pypi.org/simple/scipy/) (requires-python:<3.12,>=3.8)')), ('threadpoolctl',
LinkCandidate('https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threadpoolctl-3.2.0-py3-none-any.whl (from https://pypi.org/simple/threadpoolctl/)
(requires-python:>=3.8)'))]), criteria={'scikit-learn': Criterion((SpecifierRequirement('scikit-learn==1.3.0'), via=None)), 'numpy': Criterion((SpecifierRequirement('numpy>=1.17.3'),
via=LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from
https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)')), (SpecifierRequirement('numpy<1.27.0,>=1.19.5'),
via=LinkCandidate('https://files.pythonhosted.org/packages/32/8e/7f403535ddf826348c9b8417791e28712019962f7e90ff845896d6325d09/scipy-1.10.1-cp38-cp38-win_amd64.whl (from https://pypi.org/simple/scipy/)
(requires-python:<3.12,>=3.8)'))), 'scipy': Criterion((SpecifierRequirement('scipy>=1.5.0'),
via=LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from
https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)'))), 'joblib': Criterion((SpecifierRequirement('joblib>=1.1.1'),
via=LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from
https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)'))), 'threadpoolctl': Criterion((SpecifierRequirement('threadpoolctl>=2.0.0'),
via=LinkCandidate('https://files.pythonhosted.org/packages/5f/08/c66e99f06fb73f727c870172f0962c103262ac68839cc05234709b7b45c2/scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (from
https://pypi.org/simple/scikit-learn/) (requires-python:>=3.8)')))}, backtrack_causes=[]))
INFO:pipenv.patched.pip._internal.network.download:Downloading scikit_learn-1.3.0-cp38-cp38-win_amd64.whl (9.2 MB)
INFO:pipenv.patched.pip._internal.network.download:Downloading joblib-1.3.2-py3-none-any.whl (302 kB)
INFO:pipenv.patched.pip._internal.network.download:Downloading numpy-1.24.4-cp38-cp38-win_amd64.whl (14.9 MB)
INFO:pipenv.patched.pip._internal.network.download:Using cached threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
[  ==] Locking...
Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (fc740250d269bdc0894c73f6b179d0639a635dd74e0ed3ec8279910e659f74e9)!
```

Resolving patch:
diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py
--- a/pipenv/utils/resolver.py
+++ b/pipenv/utils/resolver.py
@@ -337,7 +337,7 @@ def package_finder(self):
         )
         return finder
 
-    def finder(self, ignore_compatibility=True):
+    def finder(self, ignore_compatibility=False):
         finder = self.package_finder
         index_lookup = self.prepare_index_lookup()
         finder._link_collector.index_lookup = index_lookup


Test patch: