Created
September 30, 2015 19:19
-
-
Save GaretJax/2a40588ad820ff5685de to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import os | |
import sys | |
import subprocess | |
from piptools import CACHE_DIR | |
def main(requirements_in): | |
wheels_cache = os.path.join(CACHE_DIR, 'wheels') | |
packages_cache = os.path.join(CACHE_DIR, 'pkgs') | |
requirements_txt = requirements_in.rsplit('.', 1)[0] + '.txt' | |
subprocess.check_call([ | |
'pip-compile', | |
'--verbose', | |
'--find-links', '/wheels', | |
'--no-header', | |
'--no-annotate', | |
requirements_in, | |
]) | |
subprocess.check_call([ | |
'pip', 'install', | |
'--find-links', '/wheels', # TODO: Temporary hack | |
'--find-links', wheels_cache, | |
'--find-links', packages_cache, | |
'--requirements', requirements_txt, | |
]) | |
if __name__ == '__main__': | |
main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment