Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.devtools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.devtools
Commits
4f636eb2
Commit
4f636eb2
authored
May 26, 2020
by
André Anjos
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[build] Fix base_build() with a proper support for multi-package-building through conda-build
parent
e8029310
Pipeline
#40140
failed with stage
in 1 minute and 8 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
59 deletions
+22
-59
bob/devtools/build.py
bob/devtools/build.py
+18
-45
bob/devtools/graph.py
bob/devtools/graph.py
+1
-1
bob/devtools/scripts/build.py
bob/devtools/scripts/build.py
+1
-1
bob/devtools/scripts/local.py
bob/devtools/scripts/local.py
+1
-11
bob/devtools/scripts/rebuild.py
bob/devtools/scripts/rebuild.py
+1
-1
No files found.
bob/devtools/build.py
View file @
4f636eb2
...
...
@@ -215,7 +215,7 @@ def make_conda_config(config, python, append_file, condarc_options):
def
get_output_path
(
metadata
,
config
):
"""Renders the recipe and returns the name of the output file."""
return
conda_build
.
api
.
get_output_file_paths
(
metadata
,
config
=
config
)
[
0
]
return
conda_build
.
api
.
get_output_file_paths
(
metadata
,
config
=
config
)
def
get_rendered_metadata
(
recipe_dir
,
config
):
...
...
@@ -565,7 +565,6 @@ def base_build(
group
,
recipe_dir
,
conda_build_config
,
python_version
,
condarc_options
,
):
"""Builds a non-beat/non-bob software dependence that doesn't exist on
...
...
@@ -590,11 +589,6 @@ def base_build(
our internal webserver. Currently, only "bob" or "beat" will work.
recipe_dir: The directory containing the recipe's ``meta.yaml`` file
conda_build_config: Path to the ``conda_build_config.yaml`` file to use
python_version: String with the python version to build for, in the format
``x.y`` (should be passed even if not building a python package). It
can also be set to ``noarch``, or ``None``. If set to ``None``, then we
don't assume there is a python-specific version being built. If set to
``noarch``, then it is a python package without a specific build.
condarc_options: Pre-parsed condarc options loaded from the respective YAML
file
...
...
@@ -619,54 +613,33 @@ def base_build(
"
\
n
- "
.
join
(
condarc_options
[
"channels"
]),
)
logger
.
info
(
"Merging conda configuration files..."
)
if
python_version
not
in
(
"noarch"
,
None
):
conda_config
=
make_conda_config
(
conda_build_config
,
python_version
,
None
,
condarc_options
)
else
:
conda_config
=
make_conda_config
(
conda_build_config
,
None
,
None
,
condarc_options
)
conda_config
=
make_conda_config
(
conda_build_config
,
None
,
None
,
condarc_options
)
metadata
=
get_rendered_metadata
(
recipe_dir
,
conda_config
)
# handles different cases as explained on the description of
# ``python_version``
py_ver
=
python_version
.
replace
(
"."
,
""
)
if
python_version
else
None
if
py_ver
==
"noarch"
:
py_ver
=
""
arch
=
conda_arch
()
# checks we should actually build this recipe
if
should_skip_build
(
metadata
):
if
py_ver
is
None
:
logger
.
warn
(
'Skipping UNSUPPORTED build of "%s" on %s'
,
recipe_dir
,
arch
)
elif
not
py_ver
:
logger
.
warn
(
'Skipping UNSUPPORTED build of "%s" for (noarch) python '
"on %s"
,
recipe_dir
,
arch
,
)
else
:
logger
.
warn
(
'Skipping UNSUPPORTED build of "%s" for python-%s '
"on %s"
,
recipe_dir
,
python_version
,
arch
,
)
logger
.
warn
(
'Skipping UNSUPPORTED build of "%s" on %s'
,
recipe_dir
,
arch
)
return
path
=
get_output_path
(
metadata
,
conda_config
)
paths
=
get_output_path
(
metadata
,
conda_config
)
urls
=
[
exists_on_channel
(
channels
[
0
],
os
.
path
.
basename
(
k
))
for
k
in
paths
]
if
all
(
urls
):
logger
.
info
(
"Skipping build for %s as packages with matching "
"characteristics exist (%s)"
,
path
,
', '
.
join
(
urls
))
return
url
=
exists_on_channel
(
channels
[
0
],
os
.
path
.
basename
(
path
))
if
url
is
not
None
:
logger
.
info
(
"Skipping build for %s as it exists (at %s)"
,
path
,
url
)
if
any
(
urls
):
logger
.
error
(
"One or more packages for %s already exist (%s). "
"Change the package build number to trigger a build."
,
path
,
', '
.
join
(
urls
))
return
# if you get to this point, just builds the package
# if you get to this point, just builds the package
(s)
logger
.
info
(
"Building %s"
,
path
)
return
conda_build
.
api
.
build
(
recipe_dir
,
config
=
conda_config
)
...
...
@@ -839,7 +812,7 @@ if __name__ == "__main__":
recipe_dir
=
os
.
path
.
join
(
args
.
work_dir
,
"conda"
)
metadata
=
get_rendered_metadata
(
recipe_dir
,
conda_config
)
path
=
get_output_path
(
metadata
,
conda_config
)
path
=
get_output_path
(
metadata
,
conda_config
)
[
0
]
# asserts we're building at the right location
assert
path
.
startswith
(
os
.
path
.
join
(
args
.
conda_root
,
"conda-bld"
)),
(
...
...
bob/devtools/graph.py
View file @
4f636eb2
...
...
@@ -124,7 +124,7 @@ def compute_adjencence_matrix(
# pre-renders the recipe - figures out the destination
metadata = get_rendered_metadata(recipe_dir, conda_config)
rendered_recipe = get_parsed_recipe(metadata)
path = get_output_path(metadata, conda_config)
path = get_output_path(metadata, conda_config)
[0]
# gets the next build number
build_number, _ = next_build_number(
...
...
bob/devtools/scripts/build.py
View file @
4f636eb2
...
...
@@ -266,7 +266,7 @@ def build(
continue
rendered_recipe
=
get_parsed_recipe
(
metadata
)
path
=
get_output_path
(
metadata
,
conda_config
)
path
=
get_output_path
(
metadata
,
conda_config
)
[
0
]
# gets the next build number
build_number
,
_
=
next_build_number
(
channels
[
0
],
os
.
path
.
basename
(
path
))
...
...
bob/devtools/scripts/local.py
View file @
4f636eb2
...
...
@@ -176,13 +176,6 @@ Examples:
"(combine with the verbosity flags - e.g. ``-vvv``) to enable "
"printing to help you understand what will be done"
,
)
@
click
.
option
(
"-p"
,
"--python"
,
multiple
=
True
,
help
=
'Versions of python in the format "x.y" we should build for. Pass '
"various times this option to build for multiple python versions"
,
)
@
click
.
option
(
"-g"
,
"--group"
,
...
...
@@ -196,7 +189,4 @@ Examples:
def
base_build
(
ctx
,
order
,
dry_run
,
python
,
group
):
"""Run the CI build step locally."""
set_up_environment_variables
(
python
=
python
,
name_space
=
group
)
ctx
.
invoke
(
ci
.
base_build
,
order
=
order
,
dry_run
=
dry_run
,
group
=
group
,
python
=
python
)
ctx
.
invoke
(
ci
.
base_build
,
order
=
order
,
dry_run
=
dry_run
,
group
=
group
)
bob/devtools/scripts/rebuild.py
View file @
4f636eb2
...
...
@@ -253,7 +253,7 @@ def rebuild(
continue
rendered_recipe
=
get_parsed_recipe
(
metadata
)
path
=
get_output_path
(
metadata
,
conda_config
)
path
=
get_output_path
(
metadata
,
conda_config
)
[
0
]
# Get the latest build number
build_number
,
existing
=
next_build_number
(
...
...
Write
Preview
Markdown
is supported
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