Installation

We recommend that you use our binary distribution through pypi inside of a virtual environment, which supports both MacOs and Linux. On Windows we have successfully gotten pyre to work through WSL, but do not officially support it.

Binary Distribution

You can get Pyre through pypi by running:

$ (venv) $ pip install pyre-check

See our Getting Started section for a more detailed example, including setup for a virtual environment.

IDE Integration

Pyre supports the Language Server Protocol. We provide an extension for VSCode that will automatically try to connect to a running server. You can also directly interact with the LSP by piping the appropriate JSON into pyre persistent.

Building from Source

These instructions are known to work on Mac OS X (tested on High Sierra through OSX 10.13 - even though binaries are compatible with versions as old as 10.11) and Linux (tested on Ubuntu 16.04 LTS and CentOS 7).

Requirements

In addition to Python and watchman, we need a working OCaml compiler. We use Opam to manage our compiler and libraries. You can get Opam via various package management systems. Please follow their instructions for your particular operating system.

Once you have Opam on your system, switch to a current compiler with

$ opam switch 4.08.0

This will compile the compiler from scratch and is likely going to take some time on your system.

Getting the Source

With a working OCaml, you can clone the source from GitHub with

$ git clone https://github.com/facebook/pyre-check

You can complete the setup of your development environment with

$ cd pyre-check
$ ./scripts/setup.sh --local

This will generate a Makefile in your checkout directory. You can subsequently build and test pyre with

$ make
$ make test
$ make python_tests

Windows Subsystem for Linux (WSL) Install

On x86_64 Windows pyre can run via Linux using WSL. A brief summary to get this running on Ubuntu please follow:

  • Install WSL (external Microsoft Documentation)
  • Once you have a login to your Linux of choice:
    • Optionally: Install build environment (some dependencies of pyre might need to be built)
    • Use pip as described above or via a Python Virtual Environment
  • Here is an example using Ubuntu with a venv:
$ sudo apt install python3-venv build-essential python3-dev libpython3-dev
$ python3 -m venv /tmp/tp
$ /tmp/tp/bin/pip install --update pip setuptools wheel
$ /tmp/tp/bin/pip install pyre-check
$ source /tmp/tp/bin/activate
$ cd /mnt/c/path/to/repo
$ pyre --source-directory . check
$ (tp) [email protected]:/mnt/c/path/to/repo$ pyre --source-directory . check
ƛ Setting up a `.pyre_configuration` with `pyre init` may reduce overhead.
ƛ No type errors found