Skip to content

Fix version incompatibilities of py-pandas and py-openpyxl#40472

Merged
adamjstewart merged 13 commits intospack:developfrom
climbfuji:feature/bugfix_pandas_openpyxl
Oct 16, 2023
Merged

Fix version incompatibilities of py-pandas and py-openpyxl#40472
adamjstewart merged 13 commits intospack:developfrom
climbfuji:feature/bugfix_pandas_openpyxl

Conversation

@climbfuji
Copy link
Copy Markdown
Contributor

@climbfuji climbfuji commented Oct 12, 2023

This PR fixes the issue reported in #40452.

To fix that, based on @adamjstewart's suggestions, I added an excel variant that adds five optional dependencies to py-pandas. I checked the pandas releases 1.4, 1.5, 2.0, 2.1 and defined those optional dependencies for Excel in the package. I defined the variant excel only for those versions of py-pandas, because it's likely a waste of my time to code this up for ancient versions. I checked the five dependencies, two didn't exist yet (py-pyxlsb, py-odfpy), which I added, and one needed additional versions to satisfy the requirements (py-xlsxwriter).

I tested this for version 1.5.3 on my macOS, and it all installed fine.

Closes #40452

Copy link
Copy Markdown
Member

@adamjstewart adamjstewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openpyxl isn't a required dep of pandas. You could add an +excel variant that installs the 5 other deps needed, or you could just allow the user to install it afterwards.

@climbfuji
Copy link
Copy Markdown
Contributor Author

openpyxl isn't a required dep of pandas. You could add an +excel variant that installs the 5 other deps needed, or you could just allow the user to install it afterwards.

We need to make sure that openpyxl is recent enough, whichever way gets us there and is the easiest. Happy to create a excel variant if you think this is the easiest solution.

@adamjstewart
Copy link
Copy Markdown
Member

I think a variant that defaults to False is the appropriate way.

@climbfuji
Copy link
Copy Markdown
Contributor Author

I think a variant that defaults to False is the appropriate way.

Done, please check. Thanks!

adamjstewart
adamjstewart previously approved these changes Oct 16, 2023
@adamjstewart
Copy link
Copy Markdown
Member

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Oct 16, 2023

Let me see if I can fix that for you!

@adamjstewart adamjstewart enabled auto-merge (squash) October 16, 2023 12:59
@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Oct 16, 2023

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: isort, black, flake8, mypy
==> Modified files
  var/spack/repos/builtin/packages/py-odfpy/package.py
  var/spack/repos/builtin/packages/py-pandas/package.py
  var/spack/repos/builtin/packages/py-pyxlsb/package.py
  var/spack/repos/builtin/packages/py-xlsxwriter/package.py
==> Running isort checks
  isort checks were clean
==> Running black checks
All done! ✨ 🍰 ✨
4 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
Success: no issues found in 588 source files
  mypy checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I wasn't able to make any further changes, but please see the message above for remaining issues you can fix locally!

@adamjstewart adamjstewart merged commit 22405fb into spack:develop Oct 16, 2023
mtaillefumier pushed a commit to mtaillefumier/spack that referenced this pull request Oct 23, 2023
* Fix version incompatibilities of py-pandas and py-openpyxl

* Add variant excel for py-pandas

* Add package py-pyxlsb

* Add versios for py-xlsxwriter

* Define excel dependencies for py-pandas 1.4, 1.5, 2.0, 2.1

* Fix variant excel in py-pandas

* Add package py-odfpy, which is also a dependency for [email protected]:

* Rearrange excel dependencies for py-pandas

* Change url to pypi

* Add missing newline to fix style in py-odfpy
victoria-cherkas pushed a commit to victoria-cherkas/spack that referenced this pull request Oct 30, 2023
* Fix version incompatibilities of py-pandas and py-openpyxl

* Add variant excel for py-pandas

* Add package py-pyxlsb

* Add versios for py-xlsxwriter

* Define excel dependencies for py-pandas 1.4, 1.5, 2.0, 2.1

* Fix variant excel in py-pandas

* Add package py-odfpy, which is also a dependency for [email protected]:

* Rearrange excel dependencies for py-pandas

* Change url to pypi

* Add missing newline to fix style in py-odfpy
RikkiButler20 pushed a commit to RikkiButler20/spack that referenced this pull request Nov 2, 2023
* Fix version incompatibilities of py-pandas and py-openpyxl

* Add variant excel for py-pandas

* Add package py-pyxlsb

* Add versios for py-xlsxwriter

* Define excel dependencies for py-pandas 1.4, 1.5, 2.0, 2.1

* Fix variant excel in py-pandas

* Add package py-odfpy, which is also a dependency for [email protected]:

* Rearrange excel dependencies for py-pandas

* Change url to pypi

* Add missing newline to fix style in py-odfpy
gabrielctn pushed a commit to gabrielctn/spack that referenced this pull request Nov 24, 2023
* Fix version incompatibilities of py-pandas and py-openpyxl

* Add variant excel for py-pandas

* Add package py-pyxlsb

* Add versios for py-xlsxwriter

* Define excel dependencies for py-pandas 1.4, 1.5, 2.0, 2.1

* Fix variant excel in py-pandas

* Add package py-odfpy, which is also a dependency for [email protected]:

* Rearrange excel dependencies for py-pandas

* Change url to pypi

* Add missing newline to fix style in py-odfpy
mtaillefumier pushed a commit to mtaillefumier/spack that referenced this pull request Dec 14, 2023
* Fix version incompatibilities of py-pandas and py-openpyxl

* Add variant excel for py-pandas

* Add package py-pyxlsb

* Add versios for py-xlsxwriter

* Define excel dependencies for py-pandas 1.4, 1.5, 2.0, 2.1

* Fix variant excel in py-pandas

* Add package py-odfpy, which is also a dependency for [email protected]:

* Rearrange excel dependencies for py-pandas

* Change url to pypi

* Add missing newline to fix style in py-odfpy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version conflict of py-pandas and py-openpyxl

3 participants