-
Notifications
You must be signed in to change notification settings - Fork 24.2k
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
zklaus
wants to merge
7
commits into
gh/zklaus/4/base
Choose a base branch
from
gh/zklaus/4/head
base: gh/zklaus/4/base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔗 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. ❌ 2 New FailuresAs of commit 359f02d with merge base d2f6c6d ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @zklaus could you please add pep517 build as additional source code packaging ? Keeping current tar.gz file as is for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.Issues
sdist name
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 calledpytorch-{...}.tar.gz
, but the generated wheels and python package are calledtorch-{...}
.Symbolic Links
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, but also because of a problem in setuptools. Particularly unfortunate is a circular symlink in the third party
ittapi
module, which can not be resolved by replacing it with a copy.PEP 721 (now integrated in the Source Distribution Format Specification) allows for symbolic links, but only if they don't point outside the destination directory and if they don't contain
../
in their target.The list of symbolic links currently is as follows:
.dockerignore
.gitignore
docs/requirements.txt
../.ci/docker/requirements-docs.txt
..
in targetfunctorch/docs/source/notebooks
../../notebooks/
..
in target.github/ci_commit_pins/triton.txt
../../.ci/docker/ci_commit_pins/triton.txt
third_party/flatbuffers/docs/source/CONTRIBUTING.md
../../CONTRIBUTING.md
..
in targetthird_party/flatbuffers/java/src/test/java/DictionaryLookup
../../../../tests/DictionaryLookup
..
in targetthird_party/flatbuffers/java/src/test/java/MyGame
../../../../tests/MyGame
..
in targetthird_party/flatbuffers/java/src/test/java/NamespaceA
../../../../tests/namespace_test/NamespaceA
..
in targetthird_party/flatbuffers/java/src/test/java/NamespaceC
../../../../tests/namespace_test/NamespaceC
..
in targetthird_party/flatbuffers/java/src/test/java/optional_scalars
../../../../tests/optional_scalars
..
in targetthird_party/flatbuffers/java/src/test/java/union_vector
../../../../tests/union_vector
..
in targetthird_party/flatbuffers/kotlin/benchmark/src/jvmMain/java
../../../../java/src/main/java
..
in targetthird_party/ittapi/rust/ittapi-sys/c-library
../../
..
in targetthird_party/ittapi/rust/ittapi-sys/LICENSES
../../LICENSES
..
in targetthird_party/opentelemetry-cpp/buildscripts/pre-merge-commit
./pre-commit
third_party/opentelemetry-cpp/third_party/prometheus-cpp/cmake/project-import-cmake/sample_client.cc
../../push/tests/integration/sample_client.cc
..
in targetthird_party/opentelemetry-cpp/third_party/prometheus-cpp/cmake/project-import-cmake/sample_server.cc
../../pull/tests/integration/sample_server.cc
..
in targetthird_party/opentelemetry-cpp/third_party/prometheus-cpp/cmake/project-import-pkgconfig/sample_client.cc
../../push/tests/integration/sample_client.cc
..
in targetthird_party/opentelemetry-cpp/third_party/prometheus-cpp/cmake/project-import-pkgconfig/sample_server.cc
../../pull/tests/integration/sample_server.cc
..
in targetthird_party/XNNPACK/tools/xngen
xngen.py
The introduction of symbolic links inside the
.ci/docker
folder creates a new problem, however, because Docker'sCOPY
command does not allow symlinks in this way. We work around that by usingtar ch
to dereference the symlinks before handing them over todocker build
.Nccl
Nccl used to be included as a submodule. However, with #146073 (first released in v2.7.0-rc1), the submodule was removed and replaced with a build time checkout procedure in
tools/build_pytorch_libs.py
, which checks out the required version of nccl from the upstream repository based on a commit pin recorded in.ci/docker/ci_commit_pins/nccl-cu{11,12}.txt
.This means that a crucial third party dependency is missing from the source distribution.
This issue is still under investigation.
Stack from ghstack (oldest at bottom):
Footnotes
These resources can be naturally considered to be part of the docs, so moving the actual files into the place of the current symlinks and replacing them with (unproblematic) symlinks can be said to improve semantics as well. ↩ ↩2
The flatbuffers docs already actually use the original file, not the symlink and in the most recent releases, starting from flatbuffers-25.1.21 the symlink is replaced by the actual file thanks to a documentation overhaul. ↩
These resources are flatbuffers tests for java and kotlin and can be omitted from our sdist. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
We don't need to ship the rust bindings for ittapi. ↩ ↩2
These are demonstration examples for how to link to prometheus-cpp using cmake and can be omitted. ↩ ↩2 ↩3 ↩4