The public LillyMol Python modules are built from the nanobind bindings. During
local development, build them with Bazel and stage the shared objects into the
repository lib directory used by run_python.sh.
Use a recent Python 3. Development has been exercised with Python 3.13, and the bindings are expected to work with other supported Python 3 versions.
python -m pip install nanobind absl-py protobuf numpyAt system level, make sure the Python headers and BLAS development libraries are installed. Package names vary by distribution; on Debian/Ubuntu systems this is typically:
sudo apt install python3-dev libblas-devnumpy is needed for the array-returning fingerprint, descriptor, and coordinate
helpers. protobuf is needed for proto-backed configuration objects and tests.
If you use the xgboost QSAR model building tools in LillyMol:
python -m pip install xgboost scikit-learn matplotlib pandasIf you use the molecular property profile tool:
python -m pip install scipy numpyVirtual environments and uv both work well. For example:
uv venv /path/to/lillymol_venv
uv pip install --python /path/to/lillymol_venv/bin/python numpy protobufFrom the source checkout:
cd ${LILLYMOL_HOME}/src
bazel build -c opt //nanobind:all
./copy_shared_libraries.sh ../libThen run Python through the top-level wrapper, which sets PYTHONPATH and
LD_LIBRARY_PATH for the staged extension modules and LillyMol shared libraries:
${LILLYMOL_HOME}/run_python.sh my_script.pyUse -c opt for normal testing and timing. Bazel's default fastbuild is much
slower and can produce tiny floating point differences from the optimised command
line tools.
The wheel infrastructure lives in ${LILLYMOL_HOME}/python. It packages
Bazel-built extension modules and private LillyMol shared libraries; setuptools
does not compile the C++ code.
cd ${LILLYMOL_HOME}/src
bazel build -c opt //nanobind:all
./copy_shared_libraries.sh ../lib
cd ${LILLYMOL_HOME}/python
./scripts/stage_wheel_files.sh
python -m pip install build wheel setuptools
python -m build --wheelThe wheel is written to ${LILLYMOL_HOME}/python/dist. The generated
python/prebuilt, python/build, and python/dist directories are build
artifacts. Commit only the wheel-building infrastructure, not staged binaries or
generated wheels.
The wheel should install the nanobind-backed lillymol module, the
lillymol_bdb BerkeleyDB helper module when BDB support is built, and small
compatibility modules such as lillymol_io and lillymol_tools that re-export
from lillymol.