Skip to content

Improve modern packaging compatibility for local source builds#2037

Open
han-xudong wants to merge 2 commits into
facebookresearch:mainfrom
han-xudong:packaging/pep517-editable-compat
Open

Improve modern packaging compatibility for local source builds#2037
han-xudong wants to merge 2 commits into
facebookresearch:mainfrom
han-xudong:packaging/pep517-editable-compat

Conversation

@han-xudong
Copy link
Copy Markdown

@han-xudong han-xudong commented Apr 10, 2026

Fixes #2036

Summary

This PR improves PyTorch3D compatibility with modern Python packaging workflows.

Changes

  • add a minimal pyproject.toml using setuptools.build_meta
  • declare core static project metadata in pyproject.toml
  • declare authors, optional-dependencies, and scripts as dynamic
  • change extension source paths in setup.py from absolute paths to paths relative to the project root

Why

Modern build frontends are stricter than legacy setup.py install flows.

In particular:

  • setuptools local/editable builds reject absolute extension source paths
  • modern frontends work better when minimal project metadata is available through pyproject.toml

These changes improve packaging compatibility without changing the runtime API.

Validation

Validated with a local source install through uv using a matching PyTorch / CUDA combination:

tmpdir=$(mktemp -d)
uv venv "$tmpdir/venv"

UV_HTTP_TIMEOUT=300 uv pip install --python "$tmpdir/venv/bin/python" \
  --index-strategy unsafe-best-match \
  setuptools wheel numpy iopath torch==2.10.0+cu128 \
  --index-url https://pypi.org/simple \
  --extra-index-url https://download.pytorch.org/whl/cu128

UV_HTTP_TIMEOUT=300 CUDA_HOME=/usr/local/cuda-12.8 \
PATH="/usr/local/cuda-12.8/bin:$PATH" \
uv pip install --python "$tmpdir/venv/bin/python" \
  /path/to/pytorch3d \
  --no-build-isolation

This completed successfully and built pytorch3d from local source.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 10, 2026
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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modern PEP 517/660 local builds fail due to packaging metadata and absolute extension source paths

1 participant