Skip to content

Installation report does not include requested_extras if pkg referenced by path #11946

@phaer

Description

@phaer

Description

Hello,

While trying out the fantastic new installation report feature, I've noticed different behavior when installing packages with extras by name (i.e. Jinja2[i18n]) compared to installing them by Path (i.e. .[i18n] or /tmp/Jinja2.tar.gz[i18n].

requested_extras in the installation reports gets correctly set to [i18n] in the first case, but missing in the latter.
This seems only to affect extras in the report, the packages are installed correctly in both cases. requested: true on Jinaj2 is also set correctly in both cases.

Expected behavior

I'd expect the installation report the same w.r.t. requested_extras if the effective output, the installed packages, are the same.
i.e. the two pip install commands below should yield the same output.

pip version

23.0.1

Python version

3.10

OS

NixOS 22.11

How to Reproduce

  1. Create a fresh venv
  2. Do a dry-run install of Jinja2[i18n] by name
  3. Do a dry-run install of Jinja2-3.1.2.tar.gz[i18n] as downloaded from pypi
  4. Notice that the report generated by the first does correctly include requested_extras: ["i18n"] while the latter does not.

Output

$ mkdir -p /tmp/venv; python -m venv /tmp/venv

$ /tmp/venv/bin/pip install --dry-run --report /tmp/venv/report-with-name.json Jinja2[i18n] ; jq '.["install"][] | select(.metadata.name == "Jinja2") | .requested_extras' /tmp/venv/report-with-name.json                                                                                                                   
Collecting Jinja2[i18n]                                                                                                                                                     
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)                                                                                                                       
Collecting MarkupSafe>=2.0                                                                                                                                                  
  Using cached MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)                                                                          
Collecting Babel>=2.7                                                                                                                                                       
  Using cached Babel-2.12.1-py3-none-any.whl (10.1 MB)                                                                                                                      
Would install Babel-2.12.1 Jinja2-3.1.2 MarkupSafe-2.1.1                                                                                                                    
[                                                                                                                                                                           
  "i18n"                                                                                                                                                                    
]                                                                                                                                                                           
                                                                                                                                                                            
$ /tmp/venv/bin/pip install --dry-run --report /tmp/venv/report-with-path.json ~/Downloads/Jinja2-3.1.2.tar.gz[i18n] ; jq '.["install"][] | select(.metadata.name == "Jinja2") | .requested_extras' /tmp/venv/report-with-path.json                                                                                          
Processing /home/phaer/Downloads/Jinja2-3.1.2.tar.gz                                                                                                                        
  Preparing metadata (setup.py) ... done                                                                                                                                    
Collecting MarkupSafe>=2.0                                                                                                                                                  
  Using cached MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)                                                                          
Collecting Babel>=2.7                                                                                                                                                       
  Using cached Babel-2.12.1-py3-none-any.whl (10.1 MB)                                                                                                                      
Would install Babel-2.12.1 Jinja2-3.1.2 MarkupSafe-2.1.1                                                                                                                    
null                                                                             

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions