1

I installed pyre-check on my Mac via pip install:

> pip3 install pyre-check                                                                                                                 ✘ 127 
Collecting pyre-check
  Downloading pyre-check-0.9.18.tar.gz (18.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 11.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: click>=8.0 in /opt/homebrew/lib/python3.10/site-packages (from pyre-check) (8.1.3)
Collecting dataclasses-json
  Using cached dataclasses_json-0.5.7-py3-none-any.whl (25 kB)
Collecting intervaltree
  Using cached intervaltree-3.1.0.tar.gz (32 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: libcst in /opt/homebrew/lib/python3.10/site-packages (from pyre-check) (0.4.9)
Collecting psutil
  Downloading psutil-5.9.4-cp38-abi3-macosx_11_0_arm64.whl (244 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 244.2/244.2 kB 5.9 MB/s eta 0:00:00
Collecting pyre-extensions>=0.0.29
  Downloading pyre_extensions-0.0.30-py3-none-any.whl (12 kB)
Requirement already satisfied: tabulate in /opt/homebrew/lib/python3.10/site-packages (from pyre-check) (0.9.0)
Collecting testslide>=2.7.0
  Downloading TestSlide-2.7.1.tar.gz (50 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.3/50.3 kB 1.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: typing_extensions in /opt/homebrew/lib/python3.10/site-packages (from pyre-check) (4.5.0)
Requirement already satisfied: typing-inspect in /opt/homebrew/lib/python3.10/site-packages (from pyre-extensions>=0.0.29->pyre-check) (0.8.0)
Requirement already satisfied: Pygments>=2.2.0 in /opt/homebrew/lib/python3.10/site-packages (from testslide>=2.7.0->pyre-check) (2.14.0)
Collecting typeguard<3.0
  Using cached typeguard-2.13.3-py3-none-any.whl (17 kB)
Collecting marshmallow<4.0.0,>=3.3.0
  Downloading marshmallow-3.19.0-py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.1/49.1 kB 1.7 MB/s eta 0:00:00
Collecting marshmallow-enum<2.0.0,>=1.5.1
  Using cached marshmallow_enum-1.5.1-py2.py3-none-any.whl (4.2 kB)
Collecting sortedcontainers<3.0,>=2.0
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Requirement already satisfied: pyyaml>=5.2 in /opt/homebrew/lib/python3.10/site-packages (from libcst->pyre-check) (6.0)
Collecting packaging>=17.0
  Downloading packaging-23.0-py3-none-any.whl (42 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 kB 1.3 MB/s eta 0:00:00
Requirement already satisfied: mypy-extensions>=0.3.0 in /opt/homebrew/lib/python3.10/site-packages (from typing-inspect->pyre-extensions>=0.0.29->pyre-check) (1.0.0)
Building wheels for collected packages: pyre-check, testslide, intervaltree
  Building wheel for pyre-check (setup.py) ... done
  Created wheel for pyre-check: filename=pyre_check-0.9.18-py3-none-any.whl size=19378418 sha256=6a22961a137fb73d1673dda3058f8671246fee6ccc8e1e9631b9c34af7f89810
  Stored in directory: /Users/derekbrown/Library/Caches/pip/wheels/ab/96/d0/489ab89163cf9c83b2dd4f61192b6a12203fefddda3a3ff663
  Building wheel for testslide (setup.py) ... done
  Created wheel for testslide: filename=TestSlide-2.7.1-py3-none-any.whl size=54669 sha256=8781de43ad005e9aded178536ca1a382a4a5346f98b088c6346a806895000ba1
  Stored in directory: /Users/derekbrown/Library/Caches/pip/wheels/09/36/92/3312ef5da8123f2fff7c9111f78b65ac9cecb990ec1c13fe68
  Building wheel for intervaltree (setup.py) ... done
  Created wheel for intervaltree: filename=intervaltree-3.1.0-py2.py3-none-any.whl size=26098 sha256=eba5e52219b4d57f5f478074230b585b332ac8abb212ef66a97fb203740a0e4a
  Stored in directory: /Users/derekbrown/Library/Caches/pip/wheels/f1/52/97/0884d240db33fb0bbc0c2c9549ff13f6a81ec91bf0c1807615
Successfully built pyre-check testslide intervaltree
Installing collected packages: sortedcontainers, typeguard, psutil, packaging, intervaltree, testslide, pyre-extensions, marshmallow, marshmallow-enum, dataclasses-json, pyre-check
Successfully installed dataclasses-json-0.5.7 intervaltree-3.1.0 marshmallow-3.19.0 marshmallow-enum-1.5.1 packaging-23.0 psutil-5.9.4 pyre-check-0.9.18 pyre-extensions-0.0.30 sortedcontainers-2.4.0 testslide-2.7.1 typeguard-2.13.3

However, when running pyre init, pyre-check can't find the typeshed:

> pyre init
ƛ Also initialize watchman in the current directory? [Y/n] n
ƛ Unable to locate typeshed, please enter its root: 

Why might this be the case?

Derek Brown
  • 4,232
  • 4
  • 27
  • 44

1 Answers1

1

Pyre doesn't bundle typeshed with the PyPI package. You must install typeshed separately. You can install typeshed in two fairly easy ways:

  • Git (Recommended)
    You can clone the git repository, and point to the directory.

    $ pushd ..
    $ git clone https://github.com/python/typeshed.git
    $ popd
    $ realpath ../typeshed
    /data/programming/typeshed
    $ vim .pyre_configuration
    $ cat .pyre_configuration
    {
      "site_package_search_strategy": "pep561",
      "source_directories": [
        "src"
      ],
      "site_roots": [
        "./venv/lib/python3.10/site-packages"
      ],
      "typeshed": "/data/programming/typeshed"
    }
    
  • mypy
    You can instead install a linter which bundles typeshed.

    $ python -m pip install mypy
    $ python -m pip show mypy
    Version: 1.1.1
    Summary: Optional static typing for Python
    Home-page: http://www.mypy-lang.org/
    Author: Jukka Lehtosalo
    Author-email: jukka.lehtosalo@iki.fi
    License: MIT License
    Location: /usr/lib/python3.10/site-packages
    Requires: mypy-extensions, tomli, typing-extensions
    Required-by: 
    $ vim .pyre_configuration
    $ cat .pyre_configuration
    {
      "site_package_search_strategy": "pep561",
      "source_directories": [
        "src"
      ],
      "site_roots": [
        "./venv/lib/python3.10/site-packages"
      ],
      "typeshed": "/usr/lib/python3.10/site-packages/mypy/typeshed"
    }
    
Peilonrayz
  • 3,129
  • 1
  • 25
  • 37