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

Drop Python 3.9 support #4009

Merged
merged 23 commits into from
Aug 21, 2024
Merged

Conversation

DanielYang59
Copy link
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
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

@@ -106,8 +105,7 @@ optional = [
"h5py>=3.11.0",
"jarvis-tools>=2020.7.14",
"matgl>=1.1.1",
# TODO: track https://github.com/matplotlib/matplotlib/issues/28551
"matplotlib>=3.8,!=3.9.1",
"matplotlib>=3.8",
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

@@ -218,7 +218,9 @@ def gen_iupac_ordering():
] # At -> F

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
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
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
33 checks passed
@DanielYang59 DanielYang59 deleted the drop-python39 branch August 22, 2024 02:13
@DanielYang59
Copy link
Contributor Author

Thanks @janosh @shyuep

@QuantumChemist
Copy link
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
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