Skip to content

Drop Python 3.9 support#4009

Merged
shyuep merged 23 commits intomaterialsproject:masterfrom
DanielYang59:drop-python39
Aug 21, 2024
Merged

Drop Python 3.9 support#4009
shyuep merged 23 commits intomaterialsproject:masterfrom
DanielYang59:drop-python39

Conversation

@DanielYang59
Copy link
Copy Markdown
Contributor

@DanielYang59 DanielYang59 commented Aug 21, 2024

Summary

TODOs

Future PR

  • Looks like Python 3.13 rc1 is not supported by micromamba (perhaps I did it incorrectly), let's wait until the stable release Oct 2024?
  • Fix ignore of RUF017 rules

@DanielYang59 DanielYang59 changed the title Drop Python 3.9 support and add Python 3.13 support Drop Python 3.9 support Aug 21, 2024
@DanielYang59 DanielYang59 marked this pull request as ready for review August 21, 2024 02:55
Copy link
Copy Markdown
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

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

we should bump

target-version = "py39"
to py310 and apply resulting ruff fixes in this PR

"matgl>=1.1.1",
# TODO: track https://github.com/matplotlib/matplotlib/issues/28551
"matplotlib>=3.8,!=3.9.1",
"matplotlib>=3.8",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just to confirm, reading matplotlib/matplotlib#28551 the entire faulty 3.9.1 release was yanked?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

order = sum((list(product(x, y)) for x, y in order), []) # noqa: RUF017
iupac_ordering_dict = dict(zip([Element.from_row_and_group(row, group) for group, row in order], range(len(order))))
iupac_ordering_dict = dict(
zip([Element.from_row_and_group(row, group) for group, row in order], range(len(order)), strict=False)
Copy link
Copy Markdown
Member

@janosh janosh Aug 21, 2024

Choose a reason for hiding this comment

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

ideally, most of these auto-inserted zip(strict=False) should be changed to strict=True for increased safety. a few cases will rely on strict=False for correct behavior though so it's a lot of work to identify which ones need to stay to keep the prior behavior of strict=False. pinging @mkhorton in case he wants to weigh in

Copy link
Copy Markdown
Contributor Author

@DanielYang59 DanielYang59 Aug 21, 2024

Choose a reason for hiding this comment

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

Yes I wouldn't expect people to zip two unequal length sequences in most cases and not getting a warning when their lengths don't match (could potentially be more hidden bugs). Might worth opening an issue to track this (this PR is already crazily huge).

@janosh janosh added compatability Concerning pymatgen compatibility with different OS, Python versions, numpy versions, etc. pkg Package health and distribution related stuff ecosystem Concerning the larger pymatgen ecosystem labels Aug 21, 2024
@DanielYang59 DanielYang59 marked this pull request as draft August 21, 2024 08:19
@DanielYang59 DanielYang59 marked this pull request as ready for review August 21, 2024 09:04
DanielYang59 and others added 3 commits August 21, 2024 17:07
…]) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead
@shyuep shyuep merged commit b684865 into materialsproject:master Aug 21, 2024
@DanielYang59 DanielYang59 deleted the drop-python39 branch August 22, 2024 02:13
@DanielYang59
Copy link
Copy Markdown
Contributor Author

Thanks @janosh @shyuep

@QuantumChemist
Copy link
Copy Markdown
Contributor

Hey 👋🏻

I know it's just a minor thing, but I guess this Requires Python 3.9+ should also be adjusted to Requires Python 3.10+ in the README file then?

@DanielYang59
Copy link
Copy Markdown
Contributor Author

@QuantumChemist Thanks a ton for catching this! I missed this one.

janosh added a commit to CederGroupHub/chgnet that referenced this pull request Sep 16, 2024
janosh added a commit to CederGroupHub/chgnet that referenced this pull request Sep 16, 2024
* bump min supported python to 3.10

following numpy and pymatgen
numpy/numpy#26222
materialsproject/pymatgen#4009

* pass strict=True to zip() added in python 3.10

safer, since it errors if iterables have different lengths

* fix UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
matthewkuner added a commit to materialsproject/pymatgen-io-validation that referenced this pull request Oct 7, 2024
drop support for Python 3.9, add support for Python 3.12 following materialsproject/pymatgen#4009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatability Concerning pymatgen compatibility with different OS, Python versions, numpy versions, etc. ecosystem Concerning the larger pymatgen ecosystem pkg Package health and distribution related stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants