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

Run CI with two different uv resolution strategies: highest and lowest-direct #3852

Merged
merged 24 commits into from
Jun 3, 2024

Conversation

janosh
Copy link
Member

@janosh janosh commented May 31, 2024

this ensures pymatgen is compatible with both the oldest and newest dependency versions it allows in setup.py.
future CI runs will discover version clashes like the one for monty reported in #3752 (comment) before releasing to pypi

also fix typing_extensions ImportError reported in #3752 (comment) by @kavanase @Andrew-S-Rosen

@janosh janosh added fix Bug fix PRs imports Import changes and formatting core Pymatgen core labels May 31, 2024
@janosh janosh requested review from shyuep and mkhorton as code owners May 31, 2024 21:16
@janosh janosh requested a review from JaGeo as a code owner June 1, 2024 12:26
@@ -60,6 +59,7 @@
from ase.optimize.optimize import Optimizer
from matgl.ext.ase import TrajectoryObserver
from numpy.typing import ArrayLike, NDArray
from typing_extensions import Self
Copy link
Contributor

@ml-evs ml-evs Jun 3, 2024

Choose a reason for hiding this comment

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

So we can only type check on Python<=3.10? Is there no ruff rule that can be turned on that does

Suggested change
from typing_extensions import Self
try:
from typing_extensions import Self
except ImportError:
from typing import Self

or something similar?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think guarding from typing_extensions import Self with if TYPE_CHECKING: should suffice to prevent this (ideally automatically guard such TYPE_CHECKING only imports).

from typing import Self seems only available from Python 3.11 and afterwards

@janosh janosh changed the title Fix typing_extensions ImportError Run CI with two different uv resultion strategies: highest and lowest-direct Jun 3, 2024
@janosh janosh changed the title Run CI with two different uv resultion strategies: highest and lowest-direct Run CI with two different uv resolution strategies: highest and lowest-direct Jun 3, 2024
@janosh janosh merged commit eccf075 into master Jun 3, 2024
23 checks passed
@janosh janosh deleted the fix-type-ext-import-err branch June 3, 2024 16:09
@DanielYang59
Copy link
Contributor

@shyuep Sorry for the trouble caused surrounding import of Self. As it seems to be causing trouble in the v2024.5.31, can I ask for yanking this release and issue a new one? Apologize again for this oversight

# total number of jobs. We run all pytest splits with the oldest supported python
# version (currently 3.9) on windows (seems most likely to surface errors) and with
# newest version (currently 3.12) on ubuntu (to get complete coverage on unix). We
# ignore mac-os, which is assumed to be similar to ubuntu.
Copy link
Contributor

@DanielYang59 DanielYang59 Jun 4, 2024

Choose a reason for hiding this comment

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

I think this comment should be removed now that it's testing macos-latest now?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Pymatgen core fix Bug fix PRs imports Import changes and formatting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants