Last active
April 26, 2020 17:23
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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