Closed mitya57 closed 9 months ago
Can you check why Python 3.8 tests are failing?
Oh, it's because the _file_checksum
function is in different places in Sphinx 7.1 and Sphinx 7.2.
Maybe I should just inline the checksum calculation code instead of using the private API. Or ask Sphinx developers to make it public.
After removing the sanity checks that we don't need for tests, that function has only 6 lines. So I inlined it.
Oh, it's because the
_file_checksum
function is in different places in Sphinx 7.1 and Sphinx 7.2.
We have other places in the code where we check the Sphinx version and import different things, like:
if sphinx.version_info < (7, 1):
from ... import ...
else:
from ... import ...
I'd prefer if we import the correct function instead of in-lining it because if they change the logic, we will have the same problem that this PR is trying to solve: don't hardcode the hashes. If we hardcode the logic, we will have the same problem in the future.
Updated the PR. And I have opened issue sphinx-doc/sphinx#11743 asking to make that function public API.
Excellent! Thanks 👍🏼
These checksums are tied to a particular version of Sphinx, Alabaster or Pygments, and the tests may fail when a different version is used.
Instead, calculate the checksum dynamically during the test.