Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Performant type-checking for python.

License

NotificationsYou must be signed in to change notification settings

facebook/pyre-check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testsLicense: MITGitter

Pyre is a performant type checker for Python compliant withPEP 484. Pyre can analyze codebases with millions of lines of code incrementally – providing instantaneous feedback to developers as they write code. You can try it out on examples inthe Pyre Playground.

Pyre ships withPysa, a security focused static analysis tool we've built on top of Pyre that reasons about data flows in Python applications. Please refer to ourdocumentation to get started with our security analysis.

Pysa is also available on theGitHub Marketplace as a Github Action

Requirements

To get started, you needPython 3.8 or later andwatchman working on your system. OnMacOS you can get everything withhomebrew:

$ brew install python3 watchman

OnUbuntu,Mint, orDebian; useapt-get andhomebrew:

$ sudo apt-get install python3 python3-pip python3-venv$ brew install watchman

We tested Pyre onUbuntu 18.04.5 LTS,CentOS 7, as well asOSX 10.11 and later.

Setting up a Project

We start by creating an empty project directory and setting up a virtual environment:

$ mkdir my_project&&cd my_project$ python3 -m venv~/.venvs/venv$source~/.venvs/venv/bin/activate(venv) $ pip install pyre-check

Next, we teach Pyre about our new project:

(venv) $ pyre init

This command will set up a configuration for Pyre (.pyre_configuration) as well as watchman (.watchmanconfig) in your project's directory. Accept the defaults for now – you can change them later if necessary.

Running Pyre

We are now ready to run Pyre:

(venv) $echo"i: int = 'string'"> test.py(venv) $ pyre ƛ Found 1type error!test.py:1:0 Incompatible variabletype [9]: i is declared to havetype`int` but is used astype`str`.

This first invocation will start a daemon listening for filesystem changes – type checking your project incrementally as you make edits to the code. You will notice that subsequent invocations ofpyre will be faster than the first one.

For more detailed documentation, seehttps://pyre-check.org.

Join the Pyre community

SeeCONTRIBUTING.md for how to help out.

License

Pyre is licensed under the MIT license.


[8]ページ先頭

©2009-2025 Movatter.jp