From a16cec0b431911f525413f967c89e73972172d47 Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 15 Nov 2023 15:11:29 -0800 Subject: [PATCH] Doc update for scip-python (#389) Summary: Pull Request resolved: https://github.com/facebookincubator/Glean/pull/389 Reviewed By: LivewareIssue Differential Revision: D51246608 Pulled By: donsbot fbshipit-source-id: bd85921aa62753abb2f22d3f3eccecfd3703337b --- README.md | 9 +++-- glean/website/docs/indexer/python-scip.md | 45 +++++++++++++++++++++++ glean/website/sidebars.js | 1 + 3 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 glean/website/docs/indexer/python-scip.md diff --git a/README.md b/README.md index 1fffaba27..806e576fd 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,18 @@ We also support the [SCIP](https://github.com/sourcegraph/scip) or [LSIF](https: * [Go](https://glean.software/docs/indexer/lsif-go) * [TypeScript](https://glean.software/docs/indexer/lsif-typescript) * [Java](https://glean.software/docs/indexer/lsif-java) +* [Python](https://glean.software/docs/indexer/scip-python) -Indexers for these languages exist but aren't in the open source -release yet; we hope to make these available in the future: +Custom indexers for these languages exist but aren't in the open source release +yet; we hope to make these available in the future: * Python -* Objective-C * Java * Kotlin * Erlang * Thrift -* Buck +* Buck and Bazel +* C# ## License diff --git a/glean/website/docs/indexer/python-scip.md b/glean/website/docs/indexer/python-scip.md new file mode 100644 index 000000000..c1216fd9d --- /dev/null +++ b/glean/website/docs/indexer/python-scip.md @@ -0,0 +1,45 @@ +--- +id: scip-python +title: Python +sidebar_label: Python +--- + +import {OssOnly, FbInternalOnly} from 'internaldocs-fb-helpers'; +import {SrcFile,SrcFileLink} from '@site/utils'; + +To index [Python](https://www.python.org) we use SourceGraph's [SCIP indexer for python](https://github.com/sourcegraph/scip-python). [SCIP](https://about.sourcegraph.com/blog/announcing-scip) is a new format for tools to share information about code. Releases of [scip-python](https://github.com/sourcegraph/scip-python) can be installed with `yarn` or `npm` and used as indexers for SCIP, which Glean will accept. The indexer itself requires a [python](https://www.python.org) runtime. + +## Run the indexer + +The indexer is run via the main `glean` CLI tool. + +``` +> cabal build exe:glean +``` + +And index your Python repository with: +``` +glean index scip-python DIR --db NAME/INSTANCE +``` + +where + +* `DIR` is the root directory containing the Python project +* `name/hash` is the name of the repository to create + +Provide the usual `--db-root` and `--schema` or `--service` arguments +to `glean` + +## In the shell + +Python source can also be indexed directly from the Glean shell: + +``` +:index scip-python DIR +``` + +The shell will pick a DB name and hash for you based on `DIR`. + +## Schema + +The schema is in diff --git a/glean/website/sidebars.js b/glean/website/sidebars.js index 84007ec08..98a817ecd 100644 --- a/glean/website/sidebars.js +++ b/glean/website/sidebars.js @@ -80,6 +80,7 @@ module.exports = { 'indexer/lsif-go', 'indexer/lsif-rust', 'indexer/lsif-java', + 'indexer/scip-python', ], },