Skip to content

Commit

Permalink
[CI] Use the latest LibCST source code in Pyre check
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmylai committed Mar 12, 2020
1 parent c7d2679 commit 993e211
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .circleci/.pyre_configuration
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"source_directories": [
"."
],
"search_path": [
"stubs", "/tmp/libcst-env/lib/python3.7/site-packages"
],
"exclude": [
".*/\\.tox/.*"
]
}
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ docs/source/.ipynb_checkpoints/
build/
.coverage
.hypothesis/
.pyre_configuration
File renamed without changes.
17 changes: 14 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,23 @@ this:
See the `unittest documentation <https://docs.python.org/3/library/unittest.html>`_
for more examples of how to run tests.

We use `Pyre <https://github.com/facebook/pyre-check>`_ for type-checking. To
verify types for the library, do the following in the root:
We use `Pyre <https://github.com/facebook/pyre-check>`_ 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:

Expand Down

0 comments on commit 993e211

Please sign in to comment.