Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec pandas[excel] gets old version of Pandas #24

Closed
notatallshaw opened this issue Sep 28, 2023 · 6 comments
Closed

Spec pandas[excel] gets old version of Pandas #24

notatallshaw opened this issue Sep 28, 2023 · 6 comments

Comments

@notatallshaw
Copy link

notatallshaw commented Sep 28, 2023

Since 2.0 Pandas have added several optional extras: https://pandas.pydata.org/docs/getting_started/install.html#optional-dependencies

One common one is pandas[excel], but when I try and run rip against this spec I get Pandas 1.5.3 which is before this optional extra was added, no explanation is given:

$ cargo r -- pandas[excel]
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/rip 'pandas[excel]'`
Resolved environment:
- pandas[excel]

Name             Version
numpy            1.26.0
pandas[excel]    1.5.3
python-dateutil  2.8.2
pytz             2023.3.post1
six              1.16.0

Running pandas without the optional extra gets the expected Pandas version:

$ cargo r -- pandas
    Finished dev [unoptimized + debuginfo] target(s) in 0.07s
     Running `target/debug/rip pandas`
Resolved environment:
- pandas

Name             Version
numpy            1.26.0
pandas           2.1.1
python-dateutil  2.8.2
pytz             2023.3.post1
six              1.16.0
tzdata           2023.3
@notatallshaw notatallshaw changed the title Spec "pandas[excel]" gets old version of Pandas Spec pandas[excel] gets old version of Pandas Sep 28, 2023
@baszalmstra
Copy link
Contributor

Thats not good! Ill take a look!

@notatallshaw
Copy link
Author

Thanks, also I think the output message shoud highlight when it failed to get an extra:

The report gives:

pandas[excel]    1.5.3

But this extra did not exist for 1.5.3, I beleive the spec on this is extras are considered optional, so it's technically correct to be able to install pandas without the extra excel even when you specify it (which personally I wish all installers provided an option to override thie behavior and fail to install when the extra isn't present), but at the very least the user should be alerted.

@baszalmstra
Copy link
Contributor

After a little investigation, it turns out that this is the same result pip returns:

> pip install pandas[excel] --only-binary :all: --dry-run
...
Would install numpy-1.26.0 pandas-1.5.3 python-dateutil-2.8.2 pytz-2023.3.post1 six-1.16.0

We currently don't deal with sdists at all yet (that's why I use --only-binary :all:).

When we do consider sdists with pip we get the result you'd expect:

> pip install pandas[excel] --dry-run
...
Would install XlsxWriter-3.1.5 defusedxml-0.7.1 et-xmlfile-1.1.0 numpy-1.26.0 odfpy-1.4.1 openpyxl-3.1.2 pandas-2.1.1 python-dateutil-2.8.2 pytz-2023.3.post1 pyxlsb-1.0.10 six-1.16.0 tzdata-2023.3 xlrd-2.0.1

I see your point with regard to the report being incorrect. Pip indeed prints a warning:

WARNING: pandas 1.5.3 does not provide the extra 'excel'

I will add a warning to the resolution.

@notatallshaw
Copy link
Author

Thanks for the update, I will compare to Pip with --only-binary :all: from now on.

@wolfv
Copy link
Member

wolfv commented Sep 29, 2023

If you have hints on how we can make sdists work we would also gladly take them (#32)

@baszalmstra
Copy link
Contributor

Im going to close this issue in favor of #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants