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
Min RK 2017-09-07 13:03:11 +02:00
rodzic d97eee9a6a
commit b20ee4adb9
4 zmienionych plików z 18 dodań i 4 usunięć

Wyświetl plik

@ -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'

Wyświetl plik

@ -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

Wyświetl plik

@ -1,2 +1,4 @@
dependencies:
- numpy
- pip:
- simplejson

Wyświetl plik

@ -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")