Skip to content

Improve MANIFEST.in for source distribution #157814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: gh/zklaus/17/base
Choose a base branch
from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jul 8, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157814

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a4cab4b with merge base 334b38c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Contributor

github-actions bot commented Jul 8, 2025

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

zklaus added 3 commits July 29, 2025 14:15
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@XuehaiPan
Copy link
Collaborator

Will need to add a test for the SDist:

$ uv pip install -v torch-*.tar.gz
DEBUG uv 0.8.3 (Homebrew 2025-07-24)
DEBUG Searching for default Python interpreter in virtual environments
DEBUG Found `cpython-3.13.5-macos-aarch64-none` at `/Users/PanXuehai/Projects/pytorch/dist/venv/bin/python3` (active virtual environment)
Using Python 3.13.5 environment at: venv
DEBUG Acquired lock for `venv`
DEBUG At least one requirement is not satisfied: file:///Users/PanXuehai/Projects/pytorch/dist/torch-2.9.0a0+gite955d76.tar.gz
...
DEBUG adding 'torchgen/selective_build/selector.py'
DEBUG adding 'torchgen/static_runtime/__init__.py'
DEBUG adding 'torchgen/static_runtime/config.py'
DEBUG adding 'torchgen/static_runtime/gen_static_runtime_ops.py'
DEBUG adding 'torchgen/static_runtime/generator.py'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/METADATA'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/WHEEL'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/entry_points.txt'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/top_level.txt'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/RECORD'
DEBUG removing build/bdist.macosx-15.0-arm64/wheel
DEBUG Released lock at `/var/folders/9r/g38s_wqs3kg0cy0n0mcdq92h0000gn/T/uv-setuptools-b139a3b1e08b9b31.lock`
DEBUG Released lock at `/Users/PanXuehai/.cache/uv/sdists-v9/path/da64d06ad13a9430/.lock`
  × Failed to build `torch @ file:///Users/PanXuehai/Projects/pytorch/dist/torch-2.9.0a0+gite955d76.tar.gz`
  ╰─▶ Package metadata version `2.9.0a0+gitunknown` does not match given version `2.9.0a0+gite955d76`
DEBUG Released lock at `/Users/PanXuehai/Projects/pytorch/dist/venv/.lock`

zklaus added 2 commits August 8, 2025 16:03
[ghstack-poisoned]
[ghstack-poisoned]
@zklaus
Copy link
Collaborator Author

zklaus commented Aug 11, 2025

Will need to add a test for the SDist:

$ uv pip install -v torch-*.tar.gz
DEBUG uv 0.8.3 (Homebrew 2025-07-24)
DEBUG Searching for default Python interpreter in virtual environments
DEBUG Found `cpython-3.13.5-macos-aarch64-none` at `/Users/PanXuehai/Projects/pytorch/dist/venv/bin/python3` (active virtual environment)
Using Python 3.13.5 environment at: venv
DEBUG Acquired lock for `venv`
DEBUG At least one requirement is not satisfied: file:///Users/PanXuehai/Projects/pytorch/dist/torch-2.9.0a0+gite955d76.tar.gz
...
DEBUG adding 'torchgen/selective_build/selector.py'
DEBUG adding 'torchgen/static_runtime/__init__.py'
DEBUG adding 'torchgen/static_runtime/config.py'
DEBUG adding 'torchgen/static_runtime/gen_static_runtime_ops.py'
DEBUG adding 'torchgen/static_runtime/generator.py'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/METADATA'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/WHEEL'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/entry_points.txt'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/top_level.txt'
DEBUG adding 'torch-2.9.0a0+gitunknown.dist-info/RECORD'
DEBUG removing build/bdist.macosx-15.0-arm64/wheel
DEBUG Released lock at `/var/folders/9r/g38s_wqs3kg0cy0n0mcdq92h0000gn/T/uv-setuptools-b139a3b1e08b9b31.lock`
DEBUG Released lock at `/Users/PanXuehai/.cache/uv/sdists-v9/path/da64d06ad13a9430/.lock`
  × Failed to build `torch @ file:///Users/PanXuehai/Projects/pytorch/dist/torch-2.9.0a0+gite955d76.tar.gz`
  ╰─▶ Package metadata version `2.9.0a0+gitunknown` does not match given version `2.9.0a0+gite955d76`
DEBUG Released lock at `/Users/PanXuehai/Projects/pytorch/dist/venv/.lock`

Good catch about the version number. This happens because the version is (should be) fixed at the time of building the sdist, but is recalculated by setup.py when building the wheel from the sdist, now with the git information missing. The solution is to take the version information from the sdist at wheel-build time, which I implemented in #160315.

@zklaus zklaus requested a review from XuehaiPan August 11, 2025 11:59
@zklaus zklaus added the topic: not user facing topic category label Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants