Skip to content

Formally drop python 3.8 support #2234

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

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Formally drop python 3.8 support #2234

wants to merge 27 commits into from

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Apr 28, 2025

Python 3.8 has reached EOL.

Fix #2233

Copy link

codecov bot commented Apr 28, 2025

❌ 35 Tests Failed:

Tests completed Failed Passed Skipped
15020 35 14985 2703
View the top 3 failed test(s) by shortest run time
::onnxscript.function_libs.torch_lib.graph_building.__init__
Stack Traces | 0s run time
.../torch_lib/graph_building/__init__.py:44: in <module>
    from ._graph_building_torch import (
.../torch_lib/graph_building/_graph_building_torch.py:28: in <module>
    from onnxscript.function_libs.torch_lib.ops import common as common_ops
.../torch_lib/ops/__init__.py:16: in <module>
    from . import (
.../torch_lib/ops/core.py:961: in <module>
    def aten_atleast_1d_sequence(self: Sequence[TTensor]) -> TTensor:
.../function_libs/torch_lib/registration.py:131: in wrapper
    processed_func = onnxscript.script(opset=custom_opset)(func)
onnxscript/main.py:95: in transform
    result = script_check(f_ast, opset, env, src, default_opset=default_opset)
onnxscript/main.py:39: in script_check
    return convert.translate_function_def(f)
onnxscript/converter.py:1437: in translate_function_def
    fn_ir = self._translate_function_def_common(stmt)
onnxscript/converter.py:1422: in _translate_function_def_common
    _ = self._translate_function_signature_common(fn)
onnxscript/converter.py:1375: in _translate_function_signature_common
    if not ta.is_valid_type(typeinfo):
onnxscript/type_annotation.py:187: in is_valid_type
    return is_value_type(typeinfo) in {True, False}
onnxscript/type_annotation.py:145: in is_value_type
    if _is_tensor_type(typeinfo):
onnxscript/type_annotation.py:135: in _is_tensor_type
    if inspect.isclass(typeinfo) and issubclass(typeinfo, onnx_types.TensorType):
.../Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/abc.py:123: in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
E   TypeError: issubclass() arg 1 must be a class
::onnxscript.function_libs.torch_lib.ops.special
Stack Traces | 0s run time
....../Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
.../torch_lib/ops/__init__.py:16: in <module>
    from . import (
.../torch_lib/ops/core.py:40: in <module>
    from onnxscript.function_libs.torch_lib.ops import common as common_ops
.../torch_lib/ops/__init__.py:16: in <module>
    from . import (
.../torch_lib/ops/core.py:961: in <module>
    def aten_atleast_1d_sequence(self: Sequence[TTensor]) -> TTensor:
.../function_libs/torch_lib/registration.py:131: in wrapper
    processed_func = onnxscript.script(opset=custom_opset)(func)
onnxscript/main.py:95: in transform
    result = script_check(f_ast, opset, env, src, default_opset=default_opset)
onnxscript/main.py:39: in script_check
    return convert.translate_function_def(f)
onnxscript/converter.py:1437: in translate_function_def
    fn_ir = self._translate_function_def_common(stmt)
onnxscript/converter.py:1422: in _translate_function_def_common
    _ = self._translate_function_signature_common(fn)
onnxscript/converter.py:1375: in _translate_function_signature_common
    if not ta.is_valid_type(typeinfo):
onnxscript/type_annotation.py:187: in is_valid_type
    return is_value_type(typeinfo) in {True, False}
onnxscript/type_annotation.py:145: in is_value_type
    if _is_tensor_type(typeinfo):
onnxscript/type_annotation.py:135: in _is_tensor_type
    if inspect.isclass(typeinfo) and issubclass(typeinfo, onnx_types.TensorType):
....../Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/abc.py:123: in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
E   TypeError: issubclass() arg 1 must be a class
::onnxscript.function_libs.torch_lib.ops.vision
Stack Traces | 0s run time
....../Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
.../torch_lib/ops/__init__.py:16: in <module>
    from . import (
.../torch_lib/ops/core.py:40: in <module>
    from onnxscript.function_libs.torch_lib.ops import common as common_ops
.../torch_lib/ops/__init__.py:16: in <module>
    from . import (
.../torch_lib/ops/core.py:961: in <module>
    def aten_atleast_1d_sequence(self: Sequence[TTensor]) -> TTensor:
.../function_libs/torch_lib/registration.py:131: in wrapper
    processed_func = onnxscript.script(opset=custom_opset)(func)
onnxscript/main.py:95: in transform
    result = script_check(f_ast, opset, env, src, default_opset=default_opset)
onnxscript/main.py:39: in script_check
    return convert.translate_function_def(f)
onnxscript/converter.py:1437: in translate_function_def
    fn_ir = self._translate_function_def_common(stmt)
onnxscript/converter.py:1422: in _translate_function_def_common
    _ = self._translate_function_signature_common(fn)
onnxscript/converter.py:1375: in _translate_function_signature_common
    if not ta.is_valid_type(typeinfo):
onnxscript/type_annotation.py:187: in is_valid_type
    return is_value_type(typeinfo) in {True, False}
onnxscript/type_annotation.py:145: in is_value_type
    if _is_tensor_type(typeinfo):
onnxscript/type_annotation.py:135: in _is_tensor_type
    if inspect.isclass(typeinfo) and issubclass(typeinfo, onnx_types.TensorType):
....../Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/abc.py:123: in __subclasscheck__
    return _abc_subclasscheck(cls, subclass)
E   TypeError: issubclass() arg 1 must be a class

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@justinchuby justinchuby requested a review from xadupre April 28, 2025 01:51
@justinchuby justinchuby disabled auto-merge April 28, 2025 01:57
@justinchuby justinchuby marked this pull request as draft April 28, 2025 17:15
@justinchuby justinchuby marked this pull request as ready for review April 28, 2025 19:02
@justinchuby justinchuby marked this pull request as draft April 28, 2025 19:14
@justinchuby justinchuby requested a review from Copilot April 28, 2025 20:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR formally drops Python 3.8 support by updating type annotations to use built‐in generic types and related modern idioms. Key changes include:

  • Replacing Legacy typing generics (e.g. Tuple, List, Dict) with built‐in alternatives (e.g. tuple, list, dict) and updated imports from collections.abc.
  • Consistent conversion of type hints across multiple files in the codebase to align with Python 3.9+ standards.

Reviewed Changes

Copilot reviewed 79 out of 79 changed files in this pull request and generated no comments.

File Description
onnxscript/function_libs/torch_lib/ops/core.py Updated type hint return types from Tuple[...] to tuple[...]
onnxscript/function_libs/torch_lib/graph_building/_graph_building_torch.py Converted multiple type hints (Tuple, Dict, List) to built‐in generics and adjusted import sources
onnxscript/function_libs/tools/torch_lib/*.py Changed usage of legacy typing generics to their built‐in versions (e.g. list, dict, etc.)
onnxscript/_internal/*.py and others Updated type annotations and related imports to reflect modern Python syntax

@justinchuby justinchuby marked this pull request as ready for review April 28, 2025 23:05
@justinchuby justinchuby marked this pull request as draft April 28, 2025 23:05
@justinchuby justinchuby added this to the 0.3 milestone Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

python3.8 support
1 participant