Skip to content

pip-reqs broken by pip 25.1 #17

@Scotchester

Description

@Scotchester

I couldn't find a dedicated repo for pip-reqs, which appears to be a Divio project (based on its PyPI page), so this seemed like the next best place to report this.

Today when I tried to rebuild my app image which is based on divio/base:1.2-py3.12-slim-bookworm and includes RUN pip install --upgrade pip in its Dockerfile, I got this error on the pip-reqs step:

 => ERROR [web 7/9] RUN pip-reqs compile &&     pip-reqs resolve &&     pip install         --n  0.8s 
------                                                                                                
 > [web 7/9] RUN pip-reqs compile &&     pip-reqs resolve &&     pip install         --no-index --no-deps         --no-build-isolation         --requirement requirements.urls:                             
0.702 Traceback (most recent call last):                                                              
0.702   File "/usr/local/bin/pip-reqs", line 8, in <module>                                           
0.702     sys.exit(main())
0.703              ^^^^^^
0.703   File "/usr/local/lib/python3.12/site-packages/pip_reqs/__main__.py", line 50, in main
0.703     args.func(client, args)
0.703   File "/usr/local/lib/python3.12/site-packages/pip_reqs/__main__.py", line 55, in compile
0.703     parser = RequirementsParser(req_tracker=req_tracker, index_url=client.index_url)
0.703              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.703   File "/usr/local/lib/python3.12/site-packages/pip_reqs/parser.py", line 26, in __init__
0.703     self.preparer = get_requirement_preparer(self.finder, self.session, req_tracker)
0.703                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0.703   File "/usr/local/lib/python3.12/site-packages/pip_reqs/compat.py", line 119, in get_requirement_preparer
0.703     preparer = RequirementPreparer(
0.703                ^^^^^^^^^^^^^^^^^^^^
0.704 TypeError: RequirementPreparer.__init__() missing 1 required positional argument: 'resume_retries'
------
failed to solve: process "/bin/sh -c pip-reqs compile &&     pip-reqs resolve &&     pip install         --no-index --no-deps         --no-build-isolation         --requirement requirements.urls" did not complete successfully: exit code: 1

A little searching around led me to realize that:

  • The RequirementPreparer class comes from pip itself
  • pip 25.1 was released about a week ago
  • This change was introduced:

    Add support to enable resuming incomplete downloads. Control the number of retry attempts using the --resume-retries flag. (#12991)

  • That is a new required argument when initializing a RequirementPreparer

So I think that something in pip-reqs needs updating to include that new required argument? Seems they didn't consider that third-party projects like pip-reqs might be using RequirementPreparer directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions