pip: [pip 25.1] `assert req.source_dir` fails with the legacy resolver enabled
Description
Seeing build failures because of this function, my guess is this function was supposed to check whether the stuff needs to be built, but the commit https://github.com/pypa/pip/commit/5b20593ef6c3719d5f33785476ed9fff36890006 is causing assertion failures, we will need to pin pip till this is resolved.
Expected behavior
The assertion should not be there, a check was fine.
pip version
25.1
Python version
3.9
OS
Al2023
How to Reproduce
Try installing certifi,
I will add more details soon.
Output
File "/usr/local/lib/python3.9/site-packages/pip/_internal
/wheel_builder.py", line 53, in _should_build
2025-04-27 12:03:18,230:INFO:__main__:deploy_model: 24.64
assert req.source_dir
Code of Conduct
- I agree to follow the PSF Code of Conduct.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 24 (17 by maintainers)
Commits related to this issue
- Bump pip from 25.1 to 25.1.1 (PR #9028) Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/b... — committed to inmanta/inmanta-core by dependabot[bot] 2 years ago
- Bump pip from 25.1 to 25.1.1 (PR #9029) Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/b... — committed to inmanta/inmanta-core by dependabot[bot] 2 years ago
- Bump pip from 25.1 to 25.1.1 (#10822) Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/blo... — committed to aio-libs/aiohttp by dependabot[bot] 2 years ago
- Bump pip from 25.1 to 25.1.1 (#10819) Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/pip/blo... — committed to aio-libs/aiohttp by dependabot[bot] 2 years ago
- ci: bump the ci group in /.github/workflows with 2 updates (#199) Bumps the ci group in /.github/workflows with 2 updates: [pip](https://github.com/pypa/pip) and [poetry](https://github.com/python-po... — committed to MeltanoLabs/target-csv by dependabot[bot] 2 years ago
- ci: bump the ci group in /.github/workflows with 2 updates (#252) Bumps the ci group in /.github/workflows with 2 updates: [pip](https://github.com/pypa/pip) and [poetry](https://github.com/python-po... — committed to MeltanoLabs/tap-pulumi-cloud by dependabot[bot] 2 years ago
- chore(deps-dev): Bump pip from 25.1 to 25.1.1 in /packages/jsii-pacmak/test/generated-code (#4823) Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1. <details> <summary>Changelog</summary>... — committed to aws/jsii by dependabot[bot] 2 years ago
- chore(deps): bump the runtime-dependencies group with 4 updates (#9243) Bumps the runtime-dependencies group with 4 updates: [pip](https://github.com/pypa/pip), [uv](https://github.com/astral-sh/uv),... — committed to meltano/meltano by dependabot[bot] 2 years ago
- ci: bump the ci group in /.github/workflows with 2 updates (#261) Bumps the ci group in /.github/workflows with 2 updates: [pip](https://github.com/pypa/pip) and [poetry](https://github.com/python-po... — committed to meltano/tap-smoke-test by dependabot[bot] 2 years ago
- Bump the dependabot group across 1 directory with 7 updates (#168) Bumps the dependabot group with 7 updates in the / directory: | Package | From | To | | --- | --- | --- | | [click](https://github.... — committed to google/sedpack by dependabot[bot] a year ago
- ci: bump pip from 25.1 to 25.1.1 in /.github/workflows in the ci group (#243) Bumps the ci group in /.github/workflows with 1 update: [pip](https://github.com/pypa/pip). Updates `pip` from 25.1 to 2... — committed to MeltanoLabs/tap-circle-ci by dependabot[bot] a year ago
@ramannanda9 Unfortunately, that’s not a good reason for pip to retain the legacy resolver. Being able to install a set of requirements that are incompatible was a bug in the legacy resolver, and supporting people who rely on that bug has never been a goal.
If projects want to continue using that capability, then at some point they will have to pin their version of pip.
By log output, I mean the normal output (I didn’t realise pip even wrote logs to a file for successful builds?).
The answer of why it fails with the legacy resolver is that we don’t really support the legacy resolver anymore. We have some tests, but we haven’t added any legacy resolver tests since well… it was NOT legacy. We’ve kept it around because its removal would’ve been quite disruptive. I’m not sure how disruptive it would be today, but in general, it hasn’t been a burden either so it’s been left alone.
@Rahlir thanks! I tried this but it does not reproduce:
Can you provide additional information? Maybe
pip config debug.Edit: same with python 3.11.12, and 3.11.9.
One particular thing that could shed light on this issue - are the people experiencing this bug just using pip as a command line tool, or are they using code that imports pip in some way? Because we changed the test to an assert because pip should never be passing a requirement without a
source_dirto_should_build. If it is, we need a reproducer to find out where that is occurring (and fix that, rather than just remove the check and accept that we don’t know what pip is doing internally 🙁).If the issue is triggered by importing pip and using internals somehow, then such usage is not supported, as people will be aware. We may still be able to help, but not without understanding what people are trying to do (and of course, as it’s unsupported usage, there are no guarantees).
Either way, we can do nothing without a description of how to trigger the issue.