When actively developing Atomistica, use these scripts to quickly rebuild and reinstall:
./rebuild.sh./rebuild-uv.shBoth scripts will:
- Build a new wheel with
python -m build --no-isolation -w - Force-reinstall it with
pip install --force-reinstall - Show a test command to verify the installation
Meson's editable install mode (pip install -e .) can have caching issues, especially with the factory code generation and Fortran module dependencies. The wheel rebuild workflow is more reliable for development.
Do not use uv run python after running rebuild-uv.sh!
uv run automatically syncs the project and will reinstall atomistica as an editable install (from source), which will fail due to stale build caches. Instead, always use .venv/bin/python directly:
# Wrong - will break
uv run python -c "import atomistica"
# Correct - uses the wheel install
.venv/bin/python -c "import atomistica"If you accidentally run uv run, clean up and rebuild:
uv pip uninstall atomistica
rm -rf .venv/lib/python3.12/site-packages/__pycache__/_atomistica*
./rebuild-uv.sh# Clone the repository
git clone https://github.com/Atomistica/atomistica.git
cd atomistica
# Create a virtual environment (using venv or uv)
python -m venv .venv
source .venv/bin/activate
# OR
uv venv
source .venv/bin/activate
# Install build dependencies
pip install meson-python meson ninja numpy ase build
# OR
uv pip install meson-python meson ninja numpy ase build
# Build and install
./rebuild.sh
# OR
./rebuild-uv.sh
# Run tests
cd tests
python run_tests.py- Edit source files (Fortran, C, C++, or Python)
- Run
./rebuild.shor./rebuild-uv.sh - Test your changes
- Repeat
cd tests
python bulk_properties.pypython -m build --no-isolation -w -vrm -rf .mesonpy-* build dist *.egg-infomeson setup builddir
meson compile -C builddirpyproject.toml- Python package metadata and build backend configurationmeson.build- Meson build configuration (Fortran/C/C++ compilation)build_helpers/generate_factories.py- Factory code generation scriptsrc/gen_versioninfo.sh- Version info generation script