Add option to install requirements.txt file on install

Also add docs about --admin option

Refer #49
This commit is contained in:
yuvipanda
2018-07-18 01:00:48 -07:00
parent 07f85d4a47
commit 3d74ee71b3
4 changed files with 45 additions and 2 deletions

View File

@@ -66,3 +66,19 @@ def ensure_pip_packages(prefix, packages):
'install',
'--no-cache-dir',
] + packages)
def ensure_pip_requirements(prefix, requirements_path):
"""
Ensure pip packages from given requirements_path are installed in given conda prefix.
requirements_path can be a file or a URL.
"""
abspath = os.path.abspath(prefix)
pip_executable = [os.path.join(abspath, 'bin', 'python'), '-m', 'pip']
subprocess.check_output(pip_executable + [
'install',
'-r',
requirements_path
])