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

Allows use of typing_extensions.Annotated when python version is less than 3.9 #366

Merged

Conversation

jdoiro3
Copy link
Contributor

@jdoiro3 jdoiro3 commented May 22, 2023

Currently, the use of typing_extensions.Annotated doesn't work. This PR adds support for the type when the version of Python is less that 3.9 (i.e., the user can't use typing.Annotated).

@Tinche Tinche self-requested a review May 22, 2023 12:49
@Tinche
Copy link
Member

Tinche commented May 22, 2023

Cool! Can you add a changelog entry too? And maybe a line to the Annotated sections in the docs?

@jdoiro3
Copy link
Contributor Author

jdoiro3 commented May 22, 2023

Cool! Can you add a changelog entry too? And maybe a line to the Annotated sections in the docs?

@Tinche, I just added an entry under the current unreleased version. Let me know if any other changes are needed.

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

Merging #366 (cf97e3c) into main (dfa901e) will decrease coverage by 11.18%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##             main     #366       +/-   ##
===========================================
- Coverage   95.88%   84.71%   -11.18%     
===========================================
  Files          26       26               
  Lines        2139     2139               
===========================================
- Hits         2051     1812      -239     
- Misses         88      327      +239     
Impacted Files Coverage Δ
src/cattrs/_compat.py 57.20% <100.00%> (-38.85%) ⬇️

... and 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@Tinche Tinche left a comment

Choose a reason for hiding this comment

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

Please rebase and let's get this merged in.

src/cattrs/_compat.py Outdated Show resolved Hide resolved
@jdoiro3 jdoiro3 requested a review from Tinche May 22, 2023 17:20
@jdoiro3
Copy link
Contributor Author

jdoiro3 commented May 22, 2023

@Tinche, not sure why CI isn't running but this looks good to go.

@Tinche Tinche added this to the 23.1 milestone May 23, 2023
@Tinche
Copy link
Member

Tinche commented May 23, 2023

I reran the action, looks like there's a linting issue now.

@jdoiro3
Copy link
Contributor Author

jdoiro3 commented May 23, 2023

@Tinche, can you run CI again? I removed the get_origin import from typing_extensions since it seems to be the same implementation as typing. Wasn't sure it was. I need to confirm that function is part of pyhton 3.7 and 3.8. It was introduced in 3.8 so need to revert.

@jdoiro3
Copy link
Contributor Author

jdoiro3 commented May 23, 2023

Looks like everything passes except pre-commit.ci.

@Tinche
Copy link
Member

Tinche commented May 23, 2023

Sweet. I don't actually know where the pre-commit.ci is defined. Maybe the python-attrs organization?

@Tinche Tinche merged commit 67bc98e into python-attrs:main May 23, 2023
@jdoiro3 jdoiro3 deleted the feature/annotated_with_typing_extensions branch June 1, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants