mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Use pyre site-package feature (#589)
* Use pyre site-package feature * Update readme, remove example
This commit is contained in:
parent
2f75246c3a
commit
9f6ff017f2
5 changed files with 8 additions and 39 deletions
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -15,6 +15,5 @@ build/
|
|||
libcst/_version.py
|
||||
.coverage
|
||||
.hypothesis/
|
||||
.pyre_configuration
|
||||
.python-version
|
||||
target/
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"."
|
||||
],
|
||||
"search_path": [
|
||||
"stubs", "{{ .python_site_packages }}"
|
||||
"stubs", {"site-package": "setuptools_rust"}
|
||||
],
|
||||
"workers": 3,
|
||||
"strict": true
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"source_directories": [
|
||||
"."
|
||||
],
|
||||
"search_path": [
|
||||
"stubs"
|
||||
],
|
||||
"exclude": [
|
||||
".*/native/.*"
|
||||
],
|
||||
"strict": true
|
||||
}
|
||||
19
README.rst
19
README.rst
|
|
@ -175,24 +175,19 @@ 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:
|
||||
|
||||
.. 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 check
|
||||
|
||||
*Note*: You may need to remove installed LibCST and install from the source code prior to type checking:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
pip uninstall -y libcst
|
||||
pip install -e .
|
||||
|
||||
To generate documents, do the following in the root:
|
||||
|
||||
.. code-block:: shell
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue