diff --git a/conda/conda-bootstrap.py b/conda/conda-bootstrap.py index a5a4a10de785a6531f5b097ec7628ef9696d9825..f1426f77fe41d4195aba9a7be644352df8a60743 100755 --- a/conda/conda-bootstrap.py +++ b/conda/conda-bootstrap.py @@ -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,