Skip to content
Snippets Groups Projects
Commit dc0d4796 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Mitigate lack of pyyaml on the running environment; Instruct to activate base before running this

parent 06bfc894
No related branches found
No related tags found
No related merge requests found
......@@ -24,10 +24,11 @@ environment.
examples:
1. Creates an environment called `myenv' for developing the currently
checked-out package:
checked-out package (N.B.: first activate the base environment):
$ cd bob.package.foo
$ %(prog)s myenv
$ conda activate base
(base) $ %(prog)s myenv
The above command assumes the directory `conda' exists on the current
directory and that it contains a file called `meta.yaml' containing the
......@@ -40,20 +41,23 @@ examples:
the default python version to use for the newly created environment. You
may select a different one with `--python=X.Y':
$ %(prog)s --python=3.6 myenv
$ conda activate base
(base) $ %(prog)s --python=3.6 myenv
3. By default, we use bob.admin's condarc and `conda_build_config.yaml` files
that are used in creating packages for our CI/CD system. If you wish to
use your own, specify them on the command line:
$ %(prog)s --config=config.yaml --condarc=~/.condarc myenv
$ conda activate base
(base) $ %(prog)s --config=config.yaml --condarc=~/.condarc myenv
Notice the condarc file **must** end in `condarc', or conda will complain.
4. You may also specify the location of your conda installation, if it is not
available on $PATH:
$ %(prog)s --conda=/path/to/conda myenv
$ conda activate base
(base) $ %(prog)s --conda=/path/to/conda myenv
"""
......@@ -68,12 +72,6 @@ import tempfile
import argparse
import subprocess
try:
import yaml
except ImportError:
print('The package pyyaml must be installed alongside python')
sys.exit(1)
def which(env, program):
......@@ -95,6 +93,12 @@ def which(env, program):
def get_rendered_recipe(args):
try:
import yaml
except ImportError:
print('The package pyyaml must be installed alongside python')
sys.exit(1)
cmd = [
args.conda, 'render',
'--variant-config-files', args.config,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment