Closed atugushev closed 3 years ago
Thanks for filing this @atugushev! IIUC, records[pandas] should depend on tablib[pandas], instead of the plain tablib.
@pradyunsg shouldn't pip actually install pandas when records[pandas]
has tablib
in install_requires and tablib[pandas]
in extras_require (i.e. union of all extras provided by install_requires and any chosen extras_require)?
this combo, of tablib with and without [pandas]
should imo correctly result in pandas being installed:
$ pipgrip --tree --lock records[pandas]==0.5.3
records[pandas]==0.5.3 (0.5.3)
├── docopt (0.6.2)
├── openpyxl<2.5.0 (2.4.11)
│ ├── et-xmlfile (1.0.1)
│ └── jdcal (1.4.1)
├── sqlalchemy (1.3.16)
├── tablib>=0.11.4 (1.1.0)
└── tablib[pandas] (1.1.0)
└── pandas (1.0.3)
├── numpy>=1.13.3 (1.18.2)
├── python-dateutil>=2.6.1 (2.8.1)
│ └── six>=1.5 (1.14.0)
└── pytz>=2017.2 (2019.3)
$ cat ./pipgrip.lock
records==0.5.3
docopt==0.6.2
openpyxl==2.4.11
et-xmlfile==1.0.1
jdcal==1.4.1
sqlalchemy==1.3.16
tablib==1.1.0
pandas==1.0.3
numpy==1.18.2
python-dateutil==2.8.1
six==1.14.0
pytz==2019.3
It should, but it doesn't, because... the existing pip resolver doesn't actually do the right thing. :)
pip's resolver is seeing the tablib requirement before the tablib[pandas] requirement, and moving forward with the first one (because the name matches an already-made choice). That's how the old resolver works (it's a bug, yes), it's a really stupid bug but it's fairly tricky to solve correctly in the current approach of the resolver.
We'd fix this in the next-gen resolver for pip though, which is what we're collecting test cases like this here for!
Fixed in the new resolver 👍🏼
The
records[pandas]==0.5.3
depends ontablib>=0.11.4
(via install_requirements) andtablib[pandas]
(via extras_require=pandas). Thetablib[pandas]
depends onpandas
(via extras_require=pandas). Sopip install records[pandas]==0.5.3
should installpandas
, but it doesn't install it:Hope it helps someday.