mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
For sdists, replace symlink with copy for docs requirements (#157811)
Before this change, there was the requirements file `.ci/docker/requirements-docs.txt` which was symlinked as `../.ci/docker/requirements-docs.txt` from `docs/requirements.txt` since #151796.
In this situation, [because `.ci` is excluded from the source tarball](3173616532/.github/workflows/create_release.yml (L67)), we end up with a broken symlink, that additionally is [invalid in a Python source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/#unpacking-without-the-data-filter).
The broken symlink can be confirmed in [the rc sources](https://github.com/pytorch/pytorch/actions/runs/15892205745).
~After this change, there is still a single source of truth, which now is `docs/requirements.txt`, symlinked as `../docs/requirements.txt` from `.ci/docker/requirements-docs.txt`, which would also be invalid in a Python source distribution, but is not included in the tarball (see above). Additionally, the docs requirements that were missing from the previous tarball, are now actually included, allowing users to build the documentation again.~
@malfet clarified offline that there is a problem with the docs workflows because they use a cache with a key that includes the hash of the requirements document in the `.ci` folder, which now does no longer change when the requirements change. Hence, a different solution is needed~, though for now the problem remains~.
The solution in this PR is simply to copy the actual document to replace the symlink just prior to creating the source distribution. This way, a single document needs to be maintained, git checkouts remain as they are, and the source distributions contain the before-missing document.
A better solution may be implemented at a later stage with a better build system.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/157811
Approved by: https://github.com/atalman
This commit is contained in:
parent
d910cb3b2d
commit
c27d6df1ea
5
.github/workflows/create_release.yml
vendored
5
.github/workflows/create_release.yml
vendored
|
|
@ -57,6 +57,11 @@ jobs:
|
|||
echo "PT_RELEASE_FILE=pytorch-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
|
||||
- name: Checkout optional submodules
|
||||
run: python3 tools/optional_submodules.py
|
||||
- name: Copy docs requirements for inclusion
|
||||
run: |
|
||||
# Replace symlink with actual file
|
||||
rm docs/requirements.txt || true
|
||||
cp .ci/docker/requirements-docs.txt docs/requirements.txt
|
||||
- name: Create source distribution
|
||||
run: |
|
||||
# Create new folder with specified name so extracting the archive yields that
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user