Skip to content

Instantly share code, notes, and snippets.

@Abdelkrim
Last active April 26, 2020 17:23
Show Gist options
  • Save Abdelkrim/c1d7005feccbcfa66b198151dc1c4abd to your computer and use it in GitHub Desktop.
Save Abdelkrim/c1d7005feccbcfa66b198151dc1c4abd to your computer and use it in GitHub Desktop.
Sphinx: Read The Docs: git-lfs support. Add this piece of code at the beginning of the conf.py to support resources stored in git-lfs in readthedocs.org
# correct the issue : pdf generation fails after a 'libpng error: Not a PNG file'
# See https://github.com/readthedocs/readthedocs.org/issues/6770
# gist source: https://gist.github.com/Abdelkrim/c1d7005feccbcfa66b198151dc1c4abd
# -- manage git-lfs ----------------------------------------------------------
import os
if not os.path.exists('./git-lfs'):
os.system('wget https://github.com/git-lfs/git-lfs/releases/download/v2.7.1/git-lfs-linux-amd64-v2.7.1.tar.gz')
os.system('tar xvfz git-lfs-linux-amd64-v2.7.1.tar.gz')
os.system('./git-lfs install') # make lfs available in current repository
os.system('./git-lfs fetch') # download content from remote
os.system('./git-lfs checkout') # make local files to have the real content on them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment