Skip to content

Instantly share code, notes, and snippets.

@GaretJax
Created September 30, 2015 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GaretJax/2a40588ad820ff5685de to your computer and use it in GitHub Desktop.
Save GaretJax/2a40588ad820ff5685de to your computer and use it in GitHub Desktop.
#!/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