jaraco / pytest-checkdocs

MIT License
6 stars 5 forks source link

Checking docs is slow, cache result? #7

Closed jaraco closed 3 years ago

jaraco commented 3 years ago

Since the adoption of pep 517, getting project metadata, while more reliable, is now slow, taking several seconds. The reliability is probably worth the cost as long as it's providing value. But on repeated runs of the tests, this slowness is aggravating and unnecessary. Other projects like pytest-flake8 and pytest-black will not check a file if it was checked in a prior run and nothing has changed. Let's borrow from their work and do the same here.

jaraco commented 3 years ago

Now that I think about it, PEP 517 doesn't provide any mechanism to know how stale the package metadata, and thus the long-description is. I don't believe this project could reliably detect if the result would be the same as the last time metadata was generated. This project could have a heuristic, like checking if README.* has changed, but there's nothing requiring that file to be the sole input to the long description, and in fact many projects pull in content from other files as well.

Maybe the best thing to do here is bear the cost and work to improve the performance of metadata generation.