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 #119

Merged
merged 21 commits into from
Nov 7, 2024
Merged

Conversation

hussain-jafari
Copy link
Contributor

drop python 3.9 support

Description

Changes and notes

Drop Python 3.9 support.
Use built in list, dicts, and tuples
Use pipe syntax instead of Union or Optional.

Testing

Built templates and compared to current templates.

@@ -4,7 +4,7 @@

Any manual changes will be lost.
"""
from typing import Tuple, Union
from __future__ import annotations
Copy link
Contributor

Choose a reason for hiding this comment

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

We still need these even when dropping 3.9 support? I can never remember when we need this...

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 its for all the pandas series and indices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I thought we wouldn't need this either, but for some reason it's necessary when we try to type hint a variable as a class in the definition of that class itself, e.g.

class Cause:
def init(self, parent_cause: Cause):
self.parent_cause: Cause = parent_cause

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind I am wrong and don't remember either.

@@ -21,16 +21,16 @@ def get_base_types():
("name", "str"),
("kind", "str"),
("gbd_id", ID_TYPES.C_ID),
("me_id", f"Union[{ID_TYPES.ME_ID}, Unknown]"),
("me_id", f"{ID_TYPES.ME_ID} | Unknown"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if changes like this are going to break the builders. Did you actually test that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I mentioned in the description, but to go into a bit more detail - I built all of the templates, ran isort (the templates don't adhere to linting), and did a git diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna go ahead and fix the isort issues actually since I need to add from future import annotations anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope, but do we have automated test coverage of the builder code? If not, we should create a JIRA ticket to create that.

@@ -1,3 +1,7 @@
**4.1.0 - 11/06/24**

- Drop support for Python 3.9
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also a line, e.g. "Modernize type hints"

@hussain-jafari hussain-jafari force-pushed the hjafari/MIC-5489_drop_python_3.9 branch from 82975c2 to 19e069e Compare November 6, 2024 22:54
@@ -21,16 +21,16 @@ def get_base_types():
("name", "str"),
("kind", "str"),
("gbd_id", ID_TYPES.C_ID),
("me_id", f"Union[{ID_TYPES.ME_ID}, Unknown]"),
("me_id", f"{ID_TYPES.ME_ID} | Unknown"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope, but do we have automated test coverage of the builder code? If not, we should create a JIRA ticket to create that.

Category: hotfix
JIRA issue: MIC-5526

Changes and notes
Update builders so that imports are isort compliant.

Testing
Built templates and checked git diff.
@hussain-jafari hussain-jafari merged commit acc736a into main Nov 7, 2024
6 checks passed
@hussain-jafari hussain-jafari deleted the hjafari/MIC-5489_drop_python_3.9 branch November 7, 2024 18:33
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.

4 participants