Skip to content

Commit

Permalink
Use pyre site-package feature (#589)
Browse files Browse the repository at this point in the history
* Use pyre site-package feature
* Update readme, remove example
  • Loading branch information
lpetre authored Jan 7, 2022
1 parent 2f75246 commit 9f6ff01
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 37 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install --upgrade --upgrade-strategy eager build -r requirements.txt -r requirements-dev.txt
- name: Get Python site-packages
id: python-info
run: |
echo "::set-output name=SITE_PACKAGES::$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')"
- name: Configure Pyre
id: pyre_template
uses: chuhlomin/render-template@v1.2
with:
template: .github/workflows/.pyre_configuration.template
vars: |
python_site_packages: ${{ steps.python-info.outputs.SITE_PACKAGES }}
- name: Write Pyre Config
run: echo '${{ steps.pyre_template.outputs.result }}' > .pyre_configuration
- name: Make sure Pyre uses the working copy
run: pip install -e .
- run: pyre --version
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ build/
libcst/_version.py
.coverage
.hypothesis/
.pyre_configuration
.python-version
target/
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"."
],
"search_path": [
"stubs", "{{ .python_site_packages }}"
"stubs", {"site-package": "setuptools_rust"}
],
"workers": 3,
"strict": true
Expand Down
12 changes: 0 additions & 12 deletions .pyre_configuration.example

This file was deleted.

15 changes: 5 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,18 @@ for more examples of how to run tests.

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-packages dir to "search_path". (e.g. add "/workspace/libcst-env/lib/python3.7/site-packages")
Note: venv dir must **not** be inside the libcst dir
3. Remove installed LibCST and install from the source code:
To verify types for the library, do the following in the root:

.. code-block:: shell
pip uninstall -y libcst
pip install -e .
pyre check
To verify types for the library, do the following in the root:
*Note*: You may need to remove installed LibCST and install from the source code prior to type checking:

.. code-block:: shell
pyre check
pip uninstall -y libcst
pip install -e .
To generate documents, do the following in the root:

Expand Down

0 comments on commit 9f6ff01

Please sign in to comment.