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

Update pyre-check.org/play to use Python 3.11 #816

Open
hauntsaninja opened this issue Jan 16, 2024 · 2 comments
Open

Update pyre-check.org/play to use Python 3.11 #816

hauntsaninja opened this issue Jan 16, 2024 · 2 comments

Comments

@hauntsaninja
Copy link

hauntsaninja commented Jan 16, 2024

It looks like it currently targets 3.10. Targeting 3.11 (or 3.12) makes use of assert_type just a tiny bit easier. The new conformance tests in https://github.com/python/typing make heavy use of this. Alternatively, allow specifying the target Python version in the playground.

@stroxler
Copy link
Contributor

Hmm. I can look into bumping the version (multi-version is probably trickier the way we currently have it set up)

That said, I don't think we actually support assert_type right now, so maybe there should be an issue for that too; I'm hoping we can start looking at getting conformance checks running on Pyre, but there's work probably needed to even start on that.

facebook-github-bot pushed a commit that referenced this issue Feb 16, 2024
Summary:
In response to Shantanu's request in
#816
plus general hygeine, I am redeploying the playground on a more
recent AMI and using Python 3.12.

This commit modifies the setup script to get 3.12 (which is not
the default Python version for Ubuntu) and use it; this recipe
should be pretty maintainable because the `deadsnakes` ppa maintains
a good-size set of python minor versions (both newer and older
than the main Ubuntu repositories do).

Reviewed By: connernilsen

Differential Revision: D53782860

fbshipit-source-id: 83d03e5c9901ad8fe6624fb1f3b746c0d39d08e8
@stroxler
Copy link
Contributor

The playground is now running on 3.12, but I'm going to leave this issue open because the current release of open-source Pyre still doesn't support assert_type.

I've fixed this on trunk (diffs finished landing today) but I need to do an open source release and a redeploy before it will show up in the playground.

facebook-github-bot pushed a commit that referenced this issue Apr 25, 2024
Summary:
**Pre-submission checklist**
- [ ] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install`
- [ ] `pre-commit run`

Related to:
* #827
* #821
* #816

PEP 604 – Allow writing union types as `X | Y` -- https://peps.python.org/pep-0604
```
   File "/home/runner/work/pyre-check/pyre-check/client/language_server/protocol.py", line 365, in Diagnostic
    code: Optional[int | str] = None
TypeError: unsupported operand type(s) for |: 'type' and 'type'
```
On Python < 3.10 the tests are failing on PEP 604 type annotations which will be enforced by `ruff rule UP007`.
* https://docs.astral.sh/ruff/rules/non-pep604-annotation/#pyupgrade-up

On Python < 3.10 the source file ***must*** start with `from __future__ import annotations` to be able to use PEP 604 syntax.

Pull Request resolved: #832

Reviewed By: stroxler

Differential Revision: D56535593

Pulled By: migeed-z

fbshipit-source-id: 27b470c5cd16752615a16f1665a8366891e4bcc3
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

No branches or pull requests

2 participants