Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Switch to standard pep517 sdist generation #152098

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

Draft
wants to merge 4 commits into
base: gh/zklaus/4/base
Choose a base branch
from

Conversation

zklaus
Copy link
Collaborator

@zklaus zklaus commented Apr 24, 2025

Generate source tarball with PEP 517 conform build tools instead of the custom routine in place right now.

Closes #150461.

The current procedure for generating the source tarball consists in creation of a source tree by manual copying and pruning of source files.

This PR replaces that with a call to the standard build tool, which works with the build backend to produce an sdist. For that to work correctly, the build backend also needs to be configured. In the case of Pytorch, the backend currently is (the legacy version of) the setuptools backend, the source dist part of which is mostly configured via the MANIFEST.in file.

At the moment, this is still a draft due to two issues:

  • According to PEP 517, the name of the source distribution file must coincide with the project name, or more precisely, the source distribution of a project that generates {NAME}-{...}.whl wheels are required to be named {NAME}-{...}.tar.gz. Currently, the source tarball is called pytorch-{...}.tar.gz, but the generated wheels and python package are called torch-{...}.
  • The source tree at the moment contains a small number of symbolic links. This has been seen as problematic largely because of lack of support on Windows. Particularly unfortunate is a circular symlink in the third party ittapi module, which can not be resolved by replacing it with a copy.

For the first issue, the proposed solution is to distribute the source tarball as torch-{...}.tar.gz.

For the second issue, the best solution would be to eliminate all symbolic links in the source tree. If that is not possible, further investigation is needed. PEP 721 (now integrated in the Source Distribution Format Specification) clarified which kinds of symbolic links are permissible. Possible solutions must be evaluated on a case-by-case basis for every existing symbolic link.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Apr 24, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Pending

As of commit 030992c with merge base 3849fd1 (image):

NEW FAILURE - The following job has failed:

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

@pytorch-bot pytorch-bot bot added the release notes: releng release notes category label Apr 24, 2025
zklaus added a commit that referenced this pull request Apr 24, 2025
ghstack-source-id: b9d2257
Pull Request resolved: #152098
@zklaus zklaus marked this pull request as draft April 24, 2025 10:29
[ghstack-poisoned]
zklaus added a commit that referenced this pull request Apr 24, 2025
ghstack-source-id: 7b67212
Pull Request resolved: #152098
@atalman
Copy link
Contributor

atalman commented Apr 28, 2025

Hi @zklaus could you please add pep517 build as additional source code packaging ? Keeping current tar.gz file as is for now.

[ghstack-poisoned]
zklaus added a commit that referenced this pull request Apr 30, 2025
ghstack-source-id: b33c3b6
Pull Request resolved: #152098
[ghstack-poisoned]
zklaus added a commit that referenced this pull request May 1, 2025
ghstack-source-id: a299d4a
Pull Request resolved: #152098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants