Open erinfry6 opened 4 years ago
Hey erinfry6,
I know this is not really a fix, but I struggled with the same problem and took a look into the bootstrap.py
.
pip_flags = ['--upgrade']
if os.environ.get('TLJH_BOOTSTRAP_DEV', 'no') == 'yes':
pip_flags.append('--editable')
tljh_repo_path = os.environ.get(
'TLJH_BOOTSTRAP_PIP_SPEC',
'git+https://github.com/jupyterhub/the-littlest-jupyterhub.git'
)
run_subprocess([
os.path.join(hub_prefix, 'bin', 'pip'),
'install'
] + pip_flags + [tljh_repo_path])
If you look at it, you could change the ENVIRONMENT variable TLJH_BOOTSTRAP_PIP_SPEC
to your dependencies (don't forgot to include the original dependencies) and it should install your requirements as well.
Did not test it yet, but I'm going to try to modify this or the bootstrap.py
to get it to work. Will update if I have a proper way
*edit: I found out that the TLJH_BOOTSTRAP_PIP_SPEC
can also be set to a folder
@erinfry6 are you referring to the user requirements specified via --user-requirements-txt-url
?
If so then it should already be supported, since the option is passed to pip
directly:
Note that TLJH_BOOTSTRAP_PIP_SPEC
is about locating the place to install the tljh
package for use in the host systems root python environment that is installed via a setup.py within this repo, not additional packages for the user environment etc.
There is the --user-requirements-txt-url
flag as documented here: https://tljh.jupyter.org/en/latest/topic/customizing-installer.html#installing-python-packages-in-the-user-environment
There is not a --user-requirements-txt-path
or similar though to point to a local requirements.txt file. But, perhaps there should be?
For reference, these are the supported flags by the bootstrap.py script / tljh.installer, where the bootstrap.py script will just pass them onwards to the tljh.installer.
It would be really great if you could pip install packages from a .txt file on the VM, not necessarily from a URL .txt file.
I'm deploying on Google Cloud, so I have access to my requirements.txt in GCS easily using gcsfuse, but the URL of the file is much less reliable.
Thanks for everything!