sphinxcontrib-programoutput icon indicating copy to clipboard operation
sphinxcontrib-programoutput copied to clipboard

Caching to disk - PR suggestion

Open oz123 opened this issue 4 years ago • 0 comments

First, thank you for creating this extension and publishing it. I found it very useful! The current cache mechanism is only in memory, and it's no so straight how to add on disk caching. Further, if you try adding a cache mechanism trough conf.py you will bump into pickle errors. Hence, I forked this extension and created a JSONCache class which saved the commands and output to disk. It's useful in cases you do 'make clean' but don't want your commands to run again for a couple of possible reasons:

  • long execution time - more commands means longer build process
  • expensive execution time, for example: your command create cloud infrastructure ...

My code works, but it still lacks tests. However, if you are interested in it, I will open a PR and we can discuss what is the best approach to create effective tests.

oz123 avatar Dec 04 '21 20:12 oz123