Skip to content

SQLAlchemy both obsolete and upstreamed to typeshed #276

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

Merged
merged 2 commits into from
May 25, 2023

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented May 8, 2023

With SQLAlchemy 2.0.0's release a while back, these stubs are conflicting with the official type annotations.
For legacy 1.4 support, python/typeshed#9597 finishes making the typeshed stubs on par with this one.

@Avasam Avasam changed the title Remove upstreamed SQLAlchemy stubs SQLAlchemy both obsolete and upstreamed to typeshed May 8, 2023
@debonte
Copy link
Contributor

debonte commented May 10, 2023

@Avasam, do you expect that python/typeshed#9597 will be merged soon?

Since Pylance bundles both these stubs and typeshed, won't SQLAlchemy 2.0 users continue to have stub conflicts if/when both of these PRs are merged?

@Avasam
Copy link
Contributor Author

Avasam commented May 10, 2023

Good point about pyright, but at least they won't have 3 different behaviours between runtime, cli and IDE. That'll resolve itself in July with python/typeshed#9607

No ETA on python/typeshed#9597, but I can say that typeshed maintainers are going through some of my bigger PRs right now. I'll mark this here PR as draft until that one is merged over at typeshed.

@debonte
Copy link
Contributor

debonte commented May 25, 2023

I'll mark this here PR as draft until that one is merged over at typeshed.

@Avasam, I don't understand why we would delay this PR. Isn't the goal to remove the stubs from both here and typeshed? Shouldn't we be encouraging SQLAlchemy users to upgrade to 2.0?

@Avasam
Copy link
Contributor Author

Avasam commented May 25, 2023

I don't think it would encourage users either way because of the pyright including Alchemy Stubs issue you mentioned. So I'm not weighting in SQLAlchemy 2.0 users in my reasoning.

The reasoning is just that if it's removed now, Pylance (not pyright) users on SQLAlchemy 1.4 will have a moment until python/typeshed#9597 where they'll loose some type information. It is imo very minor so if you don't care about that, I can mark as ready and feel free to merge.


Edit: Your suggestion at microsoft/pylance-release#3702 (comment) would resolve both minor concern too.

@debonte
Copy link
Contributor

debonte commented May 25, 2023

Despite the existence of the stubs in this repo, it turns out that Pylance stopped bundling these sqlalchemy stubs in 2022.3.3-pre.1 (March 16, 2022).

I'd like to delete them from here. Feel free to continue using them as a reference for changes in typeshed as needed.

Edit: Your suggestion at microsoft/pylance-release#3702 (comment) would resolve both minor concern too.

@rchiodo and I concluded that this wouldn't work because the stubs would be downloaded to a global (not workspace-specific) location and therefore anyone who had both SQLAlchemy 1.x and SQLAlchemy 2.0 projects would end up with the same problem -- stubs downloaded and causing issues in their 2.0 projects.

@Avasam Avasam marked this pull request as ready for review May 25, 2023 02:26
@Avasam
Copy link
Contributor Author

Avasam commented May 25, 2023

Despite the existence of the stubs in this repo, it turns out that Pylance stopped bundling these sqlalchemy stubs in 2022.3.3-pre.1 (March 16, 2022).

Oh awesome. Let's get this removed then.

@debonte debonte merged commit 676f45e into microsoft:main May 25, 2023
@Avasam Avasam deleted the remove-sqlalchemy branch May 25, 2023 17:36
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.

2 participants