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
67f90cb5
Commit
67f90cb5
authored
Aug 08, 2019
by
André Anjos
💬
Browse files
[build] Add functions to parse order files
parent
75882c0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/devtools/build.py
View file @
67f90cb5
...
...
@@ -22,6 +22,20 @@ import distutils.version
import
conda_build.api
def
comment_cleanup
(
lines
):
"""Cleans-up comments and empty lines from textual data read from files"""
no_comments
=
[
k
.
partition
(
"#"
)[
0
].
strip
()
for
k
in
lines
]
return
[
k
for
k
in
no_comments
if
k
]
def
load_order_file
(
path
):
"""Loads an order.txt style file, removes empty lines and comments"""
with
open
(
path
,
"rt"
)
as
f
:
return
comment_cleanup
(
f
.
readlines
())
def
conda_arch
():
"""Returns the current OS name and architecture as recognized by conda"""
...
...
@@ -741,7 +755,9 @@ if __name__ == "__main__":
# builds all dependencies in the 'deps' subdirectory - or at least checks
# these dependencies are already available; these dependencies go directly to
# the public channel once built
for
recipe
in
glob
.
glob
(
os
.
path
.
join
(
"deps"
,
"*"
)):
recipes
=
load_order_file
(
os
.
path
.
join
(
"deps"
,
"order.txt"
))
for
k
,
recipe
in
enumerate
([
os
.
path
.
join
(
"deps"
,
k
)
for
k
in
recipes
]):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
recipe
,
"meta.yaml"
)):
# ignore - not a conda package
continue
...
...
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