Skip to content

Tutorials timesstamps #2875

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

Closed
wants to merge 4 commits into from
Closed

Conversation

brcolli
Copy link

@brcolli brcolli commented May 17, 2024

Fixes #2848

Description

I wrote a script that goes to each .py and .rst file in beginner_source, intermediate_source, and advanced_source directories. It looks for the first line containing "Author: ..." or "Authors: ..." and then inserts "Updated: HH:MM AM/PM, mm dd, yyyy" format. If this line isn't found, it adds it to the end of the file.

The timestamp is generated by looking at git logs for the specific file and seeing when it was last committed.
Alternative solution was looking at last modified time for the file, but that isn't concrete or modular.
Another possible alternative is adding a check in the pipeline to ensure the user manually inserts the line before they commit. This is the safest but least user friendly.

I created a .sh script to get called during the build-tutorials workflow. It is placed at the very beginning of the manager job or right before running make docs in the worker job.
This does add a few seconds to the build time, but nothing major.

I was able to test this on my forked repo with a simple runner, but I obviously couldn't test this in your dedicated pipeline.

Checklist

  • The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER")
  • Only one issue is addressed in this pull request
  • Labels from the issue that this PR is fixing are added to this pull request
  • No unnecessary issues are included into this pull request.

Copy link

pytorch-bot bot commented May 17, 2024

🔗 Helpful Links

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

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

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

@brcolli brcolli marked this pull request as draft May 17, 2024 21:56
@brcolli brcolli closed this May 18, 2024
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.

💡 [REQUEST] - Add a Timestamp to Every Tutorial
2 participants