kopia lustrzana https://github.com/jupyterhub/repo2docker
don't install requirements.txt if environment.yml is present
The most likely cause of both being present is equivalent dependencies for two use cases, not a single multi-stage conda environment. If deps should be installed in conda with pip, they will be in `environment.yml` under `pip`.pull/74/head
rodzic
d97eee9a6a
commit
b20ee4adb9
|
@ -554,7 +554,7 @@ class CondaBuildPack(BuildPack):
|
||||||
conda clean -tipsy
|
conda clean -tipsy
|
||||||
"""
|
"""
|
||||||
))
|
))
|
||||||
if os.path.exists('requirements.txt'):
|
elif os.path.exists('requirements.txt'):
|
||||||
assembly_scripts.append((
|
assembly_scripts.append((
|
||||||
'${NB_USER}',
|
'${NB_USER}',
|
||||||
'pip install --no-cache-dir -r requirements.txt'
|
'pip install --no-cache-dir -r requirements.txt'
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
Python - Mixed Requirements
|
Python - Mixed Requirements
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
You can specify both a ``requirements.txt`` and an ``environment.yml`` file,
|
An ``environment.yml`` takes precedence over ``requirements.txt``.
|
||||||
and both of these will be used to build your environment.
|
To install files into a conda environment with pip, use the ``pip`` key in ``environment.yml``:
|
||||||
|
|
||||||
|
.. sourcecode:: yaml
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- numpy
|
||||||
|
- pip:
|
||||||
|
- tornado
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
- numpy
|
- numpy
|
||||||
|
- pip:
|
||||||
|
- simplejson
|
||||||
|
|
|
@ -4,4 +4,9 @@ import sys
|
||||||
assert sys.version_info[:2] == (3, 6)
|
assert sys.version_info[:2] == (3, 6)
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
import there
|
try:
|
||||||
|
import there
|
||||||
|
except ImportError:
|
||||||
|
print('ok')
|
||||||
|
else:
|
||||||
|
raise Exception("'there' shouldn't have been installed from requirements.txt")
|
||||||
|
|
Ładowanie…
Reference in New Issue