-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
test_html_multi_line_copyright fails when SOURCE_DATE_EPOCH is set for 2024 #13223
Comments
Thank you @hrnciar - and my apologies, this was related to a change in #12516; I had not (but should have) anticipated the scenario of unit tests running with I'm thinking about what to do here; a subsequent release is naturally going to be in Y2025 or beyond, and so your PS: I think @AA-Turner may have been the intended @-mention recipient. |
I think the specific upstream fix here in Sphinx for the As mentioned, unfortunately applying that fix will only be possible for a release that takes place in Y2025 or beyond at this point -- so it's something like closing the barn door after the horse has bolted. Even so, it'd be a correctness improvement and may safeguard the test case against any future edits to those years. Unless someone else gets to it first, I'll plan to offer a fix with that soon, including testing and checking for any similarly-affected other test cases. None of that rules out applying a workaround in the interim - sorry about that though, it's not ideal. As an aside, it makes me wonder whether there is best-practice advice about whether |
@hrnciar I'm worried that my patch duplicates an existing one proposed in a Debian bugthread that I had read. I didn't intentionally copy that, but it's possible that I did subconsciously. I don't want to risk copyright contamination here, so perhaps it is best not to use/include that patch until this is figured out. Apologies again. |
The thing is we haven't merged the PR with update in Fedora yet, hence my plan was just to update the commit date to today to make the problem go away. Even though I started to work on updating Sphinx in November, there were (and still are) packages incompatible with Sphinx 8. I gave maintainers time to fix the issues before I break their stuff. Having the current date in the commit message is fine, because that's the actual date when the update was delivered. I am gonna test your patch to see if it fixes the issue properly. |
Yup, the patch works, thank you for a quick response! |
Describe the bug
While updating sphinx to 8.1.3 in Fedora, we noticed the test
test_html_multi_line_copyright
started to fail at the beginning of the new year 2025. Upon further inspection we find out that SOURCE_DATE_EPOCH in Fedora is based on the last commit date (in our case November 2024). This causes problems because this condition is not met and sphinx then tries to replacecurrent_year
(2025) withreplace_yr
(2024 - taken from source epoch date) which leads to a test failure, because the test expects 2025.This can be workarounded on our side, by bumping the commit date, but if somebody updates the hardcoded year in tests, it can hit us again in the future.
cc @jayaddison @A
How to Reproduce
SOURCE_DATE_EPOCH = 1731456000
(that's 13 Nov 2024) to [testenv], setenv part of tox.initox -e py313 -- tests/test_builders/test_build_html_copyright.py -vvv
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: