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

Add support for PyRight #922

Merged
merged 26 commits into from
Sep 10, 2021
Merged

Add support for PyRight #922

merged 26 commits into from
Sep 10, 2021

Conversation

patrick91
Copy link
Member

@patrick91 patrick91 commented May 8, 2021

Description

This PR adds support for pyright following the specification outlined here:

https://github.com/microsoft/pyright/blob/master/specs/dataclass_transforms.md and here: microsoft/pyright#1782

The specification is still work in progress, but there's no harm in supporting it.

As you see from our discussion here we might never get full support for pyright:
microsoft/pyright#1782 (comment)

I've implemented the suggested init parameter workaround, maybe in future we can get rid of it :) We got support for not having to pass init! 😊

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

@codecov
Copy link

codecov bot commented May 8, 2021

Codecov Report

Merging #922 (97601e3) into main (dfd1e0f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #922      +/-   ##
==========================================
+ Coverage   97.55%   97.57%   +0.01%     
==========================================
  Files          88       88              
  Lines        3319     3335      +16     
  Branches      477      478       +1     
==========================================
+ Hits         3238     3254      +16     
  Misses         45       45              
  Partials       36       36              

@github-actions
Copy link

github-actions bot commented Sep 1, 2021

Hi 👋 You can find a preview of the docs here:

strawberry/field.py Outdated Show resolved Hide resolved
federation=FederationFieldParams(
provides=provides or [], requires=requires or [], external=external
),
)
) # type: ignore
Copy link
Member Author

Choose a reason for hiding this comment

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

sadly, both mypy and pyright fail here :(

@patrick91 patrick91 requested review from jkimbo and removed request for jkimbo September 1, 2021 21:37
@patrick91 patrick91 marked this pull request as ready for review September 1, 2021 21:37
@botberry
Copy link
Member

botberry commented Sep 1, 2021

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release adds support for Pyright and Pylance, improving the
integration with Visual Studio Code!


Here's the preview release card for twitter:

Here's the tweet text:

Strawberry (next) is out! This time with improved support for Pyright and
Pylance, @code's default language server for Python!

docs/README.md Outdated Show resolved Hide resolved
docs/editors/vscode.md Outdated Show resolved Hide resolved
docs/editors/vscode.md Outdated Show resolved Hide resolved
patrick91 and others added 5 commits September 2, 2021 10:05
Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
PyRight might implement implicit init support: microsoft/pyright#2256

🥳🥳🥳
@patrick91
Copy link
Member Author

Going to wait for this issue to be solved before merging this PR 😊 microsoft/pyright#2256

@patrick91 patrick91 merged commit 1ec7421 into main Sep 10, 2021
@patrick91 patrick91 deleted the feature/pylance branch September 10, 2021 09:09
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