Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Use the latest LibCST source code in Pyre check #262

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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