diff --git a/.circleci/.pyre_configuration b/.circleci/.pyre_configuration new file mode 100644 index 000000000..c0d9d22eb --- /dev/null +++ b/.circleci/.pyre_configuration @@ -0,0 +1,11 @@ +{ + "source_directories": [ + "." + ], + "search_path": [ + "stubs", "/tmp/libcst-env/lib/python3.7/site-packages" + ], + "exclude": [ + ".*/\\.tox/.*" + ] +} diff --git a/.circleci/config.yml b/.circleci/config.yml index a4b340814..1ae8cce74 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,10 @@ jobs: source /tmp/libcst-env/bin/activate pip install --upgrade pip pip install -r requirements.txt -r requirements-dev.txt - pyre --preserve-pythonpath check + pip uninstall -y libcst + pip install -e . + cp .circleci/.pyre_configuration . + pyre check PYTHONPATH=`pwd` python libcst/tests/test_pyre_integration.py git diff --exit-code # verify no generated changes - save_cache: diff --git a/.gitignore b/.gitignore index 7cbc1ab67..85fb5573a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ docs/source/.ipynb_checkpoints/ build/ .coverage .hypothesis/ +.pyre_configuration diff --git a/.pyre_configuration b/.pyre_configuration.example similarity index 100% rename from .pyre_configuration rename to .pyre_configuration.example diff --git a/README.rst b/README.rst index 3ce5f01a5..10ea29663 100644 --- a/README.rst +++ b/README.rst @@ -176,12 +176,23 @@ this: See the `unittest documentation `_ for more examples of how to run tests. -We use `Pyre `_ for type-checking. To -verify types for the library, do the following in the root: +We use `Pyre `_ for type-checking. + +To set up pyre check environment: + +1. Copy the example Pyre config: ``cp .pyre_configuration.example .pyre_configuration``. +2. In the config file, add your venv site-pacakges dir to "search_path". (e.g. add "/workspace/libcst-env/lib/python3.7/site-packages") +2. Remove installed LibCST and install from the source code: + +.. code-block:: shell + pip uninstall -y libcst + pip install -e . + +To verify types for the library, do the following in the root: .. code-block:: shell - pyre --preserve-pythonpath check + pyre check To generate documents, do the following in the root: