Python
To index Python we use SourceGraph's SCIP indexer for Python. SCIP is a format for tools to share information about code.
Prerequisitesβ
You will need:
- scip-python, installable with
npm install -g @sourcegraph/scip-python - scip-to-glean, the SCIP-to-Glean converter
Run the indexerβ
Ensure that you have built and installed Glean and
the glean executable is on your PATH.
You can index a Python repository with:
glean index python-scip DIR --db-root DB --db NAME/INSTANCE
where
DBis the directory where you want to store your Glean DBsDIRis the root directory containing the Python projectNAME/INSTANCEis the name of the repository to create
In the shellβ
Python source can also be indexed directly from the Glean shell:
:index python-scip DIR
The shell will pick a DB name and hash for you based on DIR.
Installing scip-to-gleanβ
All SCIP-based indexers require the scip-to-glean converter, which
converts SCIP protobuf output into Glean facts. Install it with:
cargo install --git https://github.com/facebookincubator/Glean \
--path glean/lang/scip/indexer/scip_to_glean/cli
This installs the scip-to-glean binary into ~/.cargo/bin. Make
sure this is on your PATH.
Schemaβ
The schema is in glean/schema/source/scip.angle