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

chore: move python version compatibility to 3.10 #742

Merged
merged 8 commits into from
Jun 14, 2024

Conversation

cmatsuoka
Copy link
Collaborator

@cmatsuoka cmatsuoka commented May 23, 2024

  • Have you signed the CLA?

@cmatsuoka cmatsuoka added this to the 2.0 milestone May 23, 2024
@cmatsuoka cmatsuoka force-pushed the work/use-python-310 branch 8 times, most recently from 7257278 to d20f2b6 Compare May 27, 2024 20:49
@cmatsuoka
Copy link
Collaborator Author

Rebased on features/2.0

@cmatsuoka cmatsuoka requested review from lengau and mr-cal June 7, 2024 18:45
@cmatsuoka cmatsuoka marked this pull request as ready for review June 7, 2024 18:46
Copy link
Contributor

@mr-cal mr-cal left a comment

Choose a reason for hiding this comment

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

Looks good, a few non-blocking thoughts:

  1. Can you use from collections import namedtuple instead of from typing import NamedTuple?
  2. There's a leftover Optional here:
    cls, part: Part, *, previous_layer_hash: Optional["LayerHash"]
  3. There's a leftover Union here:
    path: Union[str, "os.PathLike[str]"], names: Iterable[str]

@lengau
Copy link
Contributor

lengau commented Jun 10, 2024

Re: @mr-cal 's #1: I don't like the location of typing.NamedTuple, but it's better to use when we're using strong typing. Ideally we'd replace most or all of these with dataclasses in a separate PR.

Copy link
Contributor

@lengau lengau left a comment

Choose a reason for hiding this comment

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

LGTM! The one thing I caught doesn't really need changing because it goes away with pydantic 2 anyway.

@@ -37,7 +37,7 @@
# see https://github.com/samuelcolvin/pydantic/issues/975#issuecomment-551147305
# The proper fix requires Python 3.9+ (needs `typing.Annotated`)
if TYPE_CHECKING:
Copy link
Contributor

Choose a reason for hiding this comment

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

GitHub's not letting me apply the suggestion to the full thing, but:

Suggested change
if TYPE_CHECKING:
UniqueStrList Annotated[liststr], conlist(str, unique_items=True)]

@cmatsuoka
Copy link
Collaborator Author

Removed remaining Optional and Union instances, typing adjustments to be handled separately.

Signed-off-by: Claudio Matsuoka <[email protected]>
@cmatsuoka cmatsuoka merged commit a80f9c2 into feature/2.0 Jun 14, 2024
8 checks passed
@cmatsuoka cmatsuoka deleted the work/use-python-310 branch June 14, 2024 14:57
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

Successfully merging this pull request may close these issues.

3 participants