Skip to content

Declare numpy runtime dependency#71

Merged
yutingye merged 1 commit into
mainfrom
fix-numpy-runtime-dep
Jun 25, 2026
Merged

Declare numpy runtime dependency#71
yutingye merged 1 commit into
mainfrom
fix-numpy-runtime-dep

Conversation

@jeongseok-meta

@jeongseok-meta jeongseok-meta commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Declare numpy as a runtime dependency in pyproject.toml.
  • Update the editable package metadata in pixi.lock so locked CI installs stay consistent.

Motivation

MHR imports NumPy at runtime in mhr/io.py and mhr/mhr.py, for example for np.ndarray data handling and np.load(...) when loading blendshape and corrective activation data. However, the wheel metadata currently only declares torch and trimesh, so a clean install can install mhr without NumPy even though importing and using the package requires it.

This also forces downstream packagers, such as the conda-forge feedstock, to carry a patch that adds numpy to the generated package metadata. Declaring the dependency upstream keeps PyPI/wheel metadata accurate and lets downstream packaging drop that patch after the next release.

The ideal downstream end state is to remove recipe/pyproject-runtime-deps.patch from conda-forge entirely once a release includes this metadata fix. The patch still has to stay for the already-published 1.0.1 artifact because that source distribution is immutable.

Relevant links

Details

This is a package metadata-only change. NumPy is already present in the development/test environment through other dependencies, but it should be declared directly because MHR itself imports it. The lockfile change is intentionally minimal: it adds numpy to the editable mhr package metadata without converting the lockfile format.

Test plan

  • pixi run wheel-build
  • unzip -p dist/*.whl "*/METADATA" | rg -n "^Requires-Dist: "
  • pixi install -e py312 --locked
  • pixi install -e py313 --locked
  • pixi run -e py312 test
  • pixi run -e py313 test

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 23, 2026
@jeongseok-meta jeongseok-meta force-pushed the fix-numpy-runtime-dep branch from 724aaca to c97817e Compare June 23, 2026 19:10
@yutingye yutingye merged commit 5663330 into main Jun 25, 2026
8 checks passed
@jeongseok-meta jeongseok-meta deleted the fix-numpy-runtime-dep branch June 25, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants