Skip to content

Add typing_extensions for backwards compatibility - #23180

Closed
Matt Huisman (matthuisman) wants to merge 1 commit into
microsoft:mainfrom
matthuisman:23179
Closed

Add typing_extensions for backwards compatibility#23180
Matt Huisman (matthuisman) wants to merge 1 commit into
microsoft:mainfrom
matthuisman:23179

Conversation

@matthuisman

@matthuisman Matt Huisman (matthuisman) commented Apr 4, 2024

Copy link
Copy Markdown

PR: #22741 switched to importing TypedDict and Literal in two different files which has broken Python 3.7 (they added to typing in 3.8)

This PR reverts those changes back to using typing_extensions

related issue:
#23179

@matthuisman Matt Huisman (matthuisman) changed the title revert back to using typing_extensions [Pytest] revert back to using typing_extensions Apr 4, 2024
@matthuisman

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@matthuisman Matt Huisman (matthuisman) changed the title [Pytest] revert back to using typing_extensions [Pytest] revert back to using typing_extensions (fixes python 3.7) Apr 4, 2024
sys.path.append(os.fspath(script_dir / "lib" / "python"))

from typing_extensions import Literal, TypedDict # noqa: E402
from testing_tools import socket_manager # noqa: E402

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

suspect this import here may also have failed without the sys.path change?

@matthuisman Matt Huisman (matthuisman) changed the title [Pytest] revert back to using typing_extensions (fixes python 3.7) [Pytest] revert back to using typing_extensions (Fixes v2024.4.0 Py3.7 Regression) Apr 4, 2024
@karthiknadig

Copy link
Copy Markdown
Member

Matt Huisman (@matthuisman) Thanks for the PR. We need to discuss internally about supporting 3.7 as it is no longer in support upstream.

@matthuisman

Matt Huisman (matthuisman) commented Apr 4, 2024

Copy link
Copy Markdown
Author

was breaking 3.7 intentional?
I see the PR that made this change didn't remove other typing_extensions so looks to me like a mistake
Also nothing in the release notes etc :)

Be nice if there could be warning about it and some time for users to migrate etc

@karthiknadig

Copy link
Copy Markdown
Member

Matt Huisman (@matthuisman) We have announced this in our release notes and blogs:

pytest dropped support as well:
image

We typically leave things as is until there is a change in underlying tools that we depend on. In this case, pytest dropped support for 3.7 we no longer need to preserve support for it in the testing features. For anyone who want to use python extension with 3.7 can pin the python extension version to the one where we still had support.

Python versions will drop on schedule and it is published here: https://devguide.python.org/versions/

@karthiknadig Karthik Nadig (karthiknadig) changed the title [Pytest] revert back to using typing_extensions (Fixes v2024.4.0 Py3.7 Regression) Add typing_extensions for backwards compatibility Apr 5, 2024
@luabud

Luciana Abud (luabud) commented Apr 8, 2024

Copy link
Copy Markdown
Member

Hey Matt Huisman (@matthuisman), first of all, thank you so much for being interested in contributing to our extension! However, based on the comments above, we'll close this PR. In our contributing guide we specify that we may reject a PR for issues that don't have the "needs PR" label, like the issue linked in this PR. I apologize for this frustration but I hope this doesn't discourage you from submitting more contributions!

@oleksandr-yatsuk

Copy link
Copy Markdown

PySpark extensively uses Python 3.7 for example.
This change breaks all testing functionality on many dev machines

@karthiknadig

Karthik Nadig (karthiknadig) commented Apr 9, 2024

Copy link
Copy Markdown
Member

You can pin python extension to older version.

pyspark has also dropped 3.7 support:
image

@karthiknadig

Copy link
Copy Markdown
Member

Please use "Install another Version" from the extension view to pin the extension to previous version.
image

Python 3.7 has been out of support for over 6 months. We don't plan on restoring support for out of service version of python.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants