Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
5cfa2db1
Commit
5cfa2db1
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[scripts][rebuild] Improves error condition handling for conda-build API test()
parent
283fb134
No related branches found
No related tags found
No related merge requests found
Pipeline
#27705
passed
6 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/scripts/rebuild.py
+11
-4
11 additions, 4 deletions
bob/devtools/scripts/rebuild.py
with
11 additions
and
4 deletions
bob/devtools/scripts/rebuild.py
+
11
−
4
View file @
5cfa2db1
...
@@ -163,14 +163,21 @@ def rebuild(recipe_dir, python, condarc, config, append_file,
...
@@ -163,14 +163,21 @@ def rebuild(recipe_dir, python, condarc, config, append_file,
logger
.
info
(
'
Downloading %s -> %s
'
,
src
,
destpath
)
logger
.
info
(
'
Downloading %s -> %s
'
,
src
,
destpath
)
urllib
.
request
.
urlretrieve
(
src
,
destpath
)
urllib
.
request
.
urlretrieve
(
src
,
destpath
)
# conda_build may either raise an exception or return ``False`` in case
# the build fails, depending on the reason. This bit of code tries to
# accomodate both code paths and decides if we should rebuild the package
# or not
try
:
try
:
logger
.
info
(
'
Testing %s
'
,
src
)
logger
.
info
(
'
Testing %s
'
,
src
)
conda_build
.
api
.
test
(
destpath
,
config
=
conda_config
)
result
=
conda_build
.
api
.
test
(
destpath
,
config
=
conda_config
)
should_build
=
False
should_build
=
not
result
logger
.
info
(
'
Test for %s: SUCCESS (package is up-to-date)
'
,
src
)
except
Exception
as
error
:
except
Exception
as
error
:
logger
.
exception
(
error
)
logger
.
exception
(
error
)
logger
.
warn
(
'
Test for %s: FAILED. Building...
'
,
src
)
finally
:
if
should_build
:
logger
.
warn
(
'
Test for %s: FAILED. Building...
'
,
src
)
else
:
logger
.
info
(
'
Test for %s: SUCCESS (package is up-to-date)
'
,
src
)
if
should_build
:
#something wrong happened, run a full build
if
should_build
:
#something wrong happened, run a full build
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment