File tree Expand file tree Collapse file tree 5 files changed +28
-1
lines changed
repo2docker/buildpacks/python
tests/venv/py2-with-kernel-requirements Expand file tree Collapse file tree 5 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ def get_assemble_scripts(self):
5353 if os .path .exists (nb_requirements_file ):
5454 assemble_scripts .append ((
5555 '${NB_USER}' ,
56- '${NB_PYTHON_PREFIX}/bin/pip install --no-cache-dir -r "{}"' .format (nb_requirements_file )
56+ # want the $NB_PYHTON_PREFIX environment variable, not for
57+ # Python's string formatting to try and replace this
58+ '${{NB_PYTHON_PREFIX}}/bin/pip install --no-cache-dir -r "{}"' .format (nb_requirements_file )
5759 ))
5860
5961 # install requirements.txt in the kernel env
Original file line number Diff line number Diff line change 1+ # install this in the kernel's environment, the user wants Python 2 there
2+ numpy
Original file line number Diff line number Diff line change 1+ # install this in the environment in which the notebook server
2+ # is running nbgitpuller does not work with Python 2
3+ nbgitpuller==0.6.1
Original file line number Diff line number Diff line change 1+ python-2.7
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python2
2+ import os
3+ import sys
4+
5+ print (sys .version_info )
6+ assert sys .version_info [:2 ] == (2 , 7 )
7+
8+ import numpy
9+
10+ try :
11+ import nbgitpuller
12+ except ImportError :
13+ pass
14+ else :
15+ raise Exception ("'nbgitpuller' shouldn't have been installed from requirements3.txt" )
16+
17+ # Python 3 is the executable used for the notebook server, this should
18+ # have nbgitpuller installed
19+ os .system ("python3 -c 'import nbgitpuller'" )
You can’t perform that action at this time.
0 commit comments