numpy¶
This example shows how to use foga to build, test, and document NumPy, the
core array-computing library for Python. It keeps the Meson native build,
Python packaging, pytest, and Sphinx docs in one working configuration.
The example pins NumPy to tag v2.4.4 to keep the demo reproducible.
Typical workflow¶
Start the example container:
examples/numpy/run-in-docker.py
Once inside the container:
Validate the configuration before running any workflow:
foga validateBuild the native and Python artifacts:
foga build cpp foga build python
Run the tests:
foga test
Build the documentation:
foga docs
What this example demonstrates¶
a clear separation between the native build workflow and the Python packaging workflow
build.cppusing themesonbackend independently frombuild.pythonpre-hooks installing the test and docs environments before pytest or Sphinx runs
foga build also works because this example sets build.default: all.