Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
c4a61c7a
Commit
c4a61c7a
authored
Jan 10, 2019
by
André Anjos
💬
Browse files
Merge branch 'use_local_channel' into 'master'
Add option to use local channel to bootstrap See merge request
!1
parents
57cb7c8c
eb8924ee
Pipeline
#25816
failed with stages
in 3 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/devtools/bootstrap.py
View file @
c4a61c7a
...
...
@@ -80,7 +80,7 @@ def get_env_directory(conda, name):
return
None
def
conda_create
(
conda
,
name
,
overwrite
,
condarc
,
packages
,
dry_run
):
def
conda_create
(
conda
,
name
,
overwrite
,
condarc
,
packages
,
dry_run
,
use_local
):
specs
=
[]
for
k
in
packages
:
...
...
@@ -104,9 +104,12 @@ def conda_create(conda, name, overwrite, condarc, packages, dry_run):
raise
RuntimeError
(
'environment `%s
\'
exists in `%s
\'
- use '
'--overwrite to overwrite'
%
(
name
,
envdir
))
cmd
=
[
conda
,
'create'
,
'--yes'
,
'--name'
,
name
]
+
sorted
(
specs
)
cmd
=
[
conda
,
'create'
,
'--yes'
,
'--name'
,
name
]
if
dry_run
:
cmd
.
insert
(
2
,
'--dry-run'
)
cmd
.
append
(
'--dry-run'
)
if
use_local
:
cmd
.
append
(
'--use-local'
)
cmd
.
extend
(
sorted
(
specs
))
logger
.
debug
(
'$ '
+
' '
.
join
(
cmd
))
status
=
subprocess
.
call
(
cmd
)
if
status
!=
0
:
...
...
bob/devtools/scripts/bootstrap.py
View file @
c4a61c7a
...
...
@@ -76,10 +76,12 @@ Examples:
help
=
'Only goes through the actions, but does not execute them '
\
'(combine with the verbosity flags - e.g. ``-vvv``) to enable '
\
'printing to help you understand what will be done'
)
@
click
.
option
(
'--use-local'
,
default
=
False
,
help
=
'Allow the use of local channels for package retrieval'
)
@
verbosity_option
()
@
bdt
.
raise_on_error
def
bootstrap
(
name
,
recipe_dir
,
python
,
overwrite
,
condarc
,
config
,
append_file
,
docserver
,
dry_run
):
append_file
,
docserver
,
dry_run
,
use_local
):
"""Creates a development environment for a recipe
It uses the conda render API to render a recipe and install an environment
...
...
@@ -117,5 +119,5 @@ def bootstrap(name, recipe_dir, python, overwrite, condarc, config,
conda_config
=
make_conda_config
(
config
,
python
,
append_file
,
condarc
)
deps
=
parse_dependencies
(
recipe_dir
,
conda_config
)
status
=
conda_create
(
conda
,
name
,
overwrite
,
condarc
,
deps
,
dry_run
)
status
=
conda_create
(
conda
,
name
,
overwrite
,
condarc
,
deps
,
dry_run
,
use_local
)
click
.
echo
(
'Execute on your shell: "conda activate %s"'
%
name
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment