Skip to content

For sdists, replace symlink with copy for docs requirements #157811

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/14/base
Choose a base branch
from

Conversation

zklaus
Copy link
Collaborator

@zklaus zklaus commented Jul 8, 2025

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, we end up with a broken symlink, that additionally is invalid in a Python source distribution.

The broken symlink can be confirmed in the rc sources.

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.

Stack from ghstack (oldest at bottom):

[ghstack-poisoned]
@zklaus zklaus requested a review from jeffdaily as a code owner July 8, 2025 16:22
Copy link

pytorch-bot bot commented Jul 8, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit cdbc3a0 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.

zklaus added 5 commits July 29, 2025 14:15
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@zklaus zklaus marked this pull request as ready for review August 11, 2025 10:11
@zklaus zklaus requested a review from a team as a code owner August 11, 2025 10:11
@zklaus zklaus changed the title Fix broken docs requirements symlink For sdists, replace symlink with copy for docs requirements Aug 11, 2025
@zklaus zklaus requested review from malfet and atalman August 12, 2025 10:17
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #157813

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