Install#
Prebuilt Conda packages are available. For development, we recommend installing from source.
Install via Conda#
conda install Numbast
From source (recommended for development)#
Numbast depends on LLVM’s libClangTooling. For an easy development setup, we recommend
installing clangdev via Conda. A recommended clangdev entry is already included in conda/environment.yaml,
so developing inside this Conda environment saves you from installing LLVM manually.
# from repo root
conda env create -f conda/environment.yaml
conda activate numbast
# build the C++ header parser
bash ast_canopy/build.sh
# install the Numbast Python package
pip install numbast/
Validate the installation (optional)#
pytest ast_canopy/ numbast/
Note
If you see errors like “cannot find header ‘cuda.h’”, please refer to FAQ for more details.
Building Documentation#
Dependencies#
Use Conda to ensure consistent versions. From conda/environment.yaml, the doc-related dependencies are:
sphinx
sphinx-copybutton
You also need Python and a working environment to import numbast if you want versioned builds to reflect the
installed package version (optional).
Build Steps#
Build all versions listed in
docs/versions.json:cd docs ./build_docs.sh
Build only the latest version:
cd docs ./build_docs.sh latest-only
Artifacts are generated under:
docs/build/html/latestdocs/build/html/<version>where<version>comes fromSPHINX_NUMBAST_VERor detected package/version files.
Notes#
The build script sets
SPHINX_NUMBAST_VERautomatically from the installednumbastpackage version,numbast/VERSION, or top-levelVERSION. If none is found, it useslatest.Output also copies
versions.jsonand creates a redirectindex.htmlfor convenience.