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
|
||||
"""
|
||||
))
|
||||
if os.path.exists('requirements.txt'):
|
||||
elif os.path.exists('requirements.txt'):
|
||||
assembly_scripts.append((
|
||||
'${NB_USER}',
|
||||
'pip install --no-cache-dir -r requirements.txt'
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
Python - Mixed Requirements
|
||||
---------------------------
|
||||
|
||||
You can specify both a ``requirements.txt`` and an ``environment.yml`` file,
|
||||
and both of these will be used to build your environment.
|
||||
An ``environment.yml`` takes precedence over ``requirements.txt``.
|
||||
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:
|
||||
- numpy
|
||||
- pip:
|
||||
- simplejson
|
||||
|
|
|
@ -4,4 +4,9 @@ import sys
|
|||
assert sys.version_info[:2] == (3, 6)
|
||||
|
||||
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