Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
666dc032
Commit
666dc032
authored
Oct 20, 2021
by
Amir MOHAMMADI
Browse files
Merge branch 'separate-channels' into 'master'
Do not mix stable and beta channels Closes
#72
See merge request
!264
parents
f1607889
3ba679f0
Pipeline
#55404
passed with stages
in 28 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/devtools/bootstrap.py
View file @
666dc032
...
...
@@ -294,21 +294,18 @@ def get_channels(
The subset of channels to be returned depends on the visibility and
stability of the package being built. Here are the rules:
* public and stable:
only
returns the public stable channel
(s)
* public and not stable: returns
bo
th public
stable and
beta channel
s
* public and stable: returns the public stable channel
* public and not stable: returns th
e
public beta channel
* not public and stable: returns both public and private stable channels
* not public and not stable: returns all channels
Beta channels have priority over stable channels, if returned. Public
channels have priority over private channles, if turned.
* not public and not stable: returns both public and private beta channels
Public channels have priority over private channles, if turned.
Args:
public: Boolean indicating if we're supposed to include only public
channels
stable: Boolean indicating if we're supposed to include only stable
channels
stable: Boolean indicating if we're supposed to include stable channels
server: The base address of the server containing our conda channels
intranet: Boolean indicating if we should add "private"/"public" prefixes
on the conda paths
...
...
@@ -316,8 +313,7 @@ def get_channels(
compiling is part of. Values should match URL namespaces currently
available on our internal webserver. Currently, only "bob" or "beat"
will work.
add_dependent_channels: If True, will add the defaults and conda-forge
channels to the list
add_dependent_channels: If True, will add the conda-forge channel to the list
Returns: a list of channels that need to be considered.
...
...
@@ -335,20 +331,21 @@ def get_channels(
# do not use '/public' urls for public channels
prefix
=
"/software/"
+
group
if
not
stable
:
if
stable
:
channels
+=
[
server
+
prefix
+
"/conda"
]
channels_dict
[
"public/stable"
]
=
channels
[
-
1
]
else
:
channels
+=
[
server
+
prefix
+
"/conda/label/beta"
]
# allowed betas
channels_dict
[
"public/beta"
]
=
channels
[
-
1
]
channels
+=
[
server
+
prefix
+
"/conda"
]
channels_dict
[
"public/stable"
]
=
channels
[
-
1
]
if
not
public
:
prefix
=
"/private"
if
not
stable
:
# allowed private channels
if
stable
:
# allowed private channels
channels
+=
[
server
+
prefix
+
"/conda"
]
channels_dict
[
"private/stable"
]
=
channels
[
-
1
]
else
:
channels
+=
[
server
+
prefix
+
"/conda/label/beta"
]
# allowed betas
channels_dict
[
"private/beta"
]
=
channels
[
-
1
]
channels
+=
[
server
+
prefix
+
"/conda"
]
channels_dict
[
"private/stable"
]
=
channels
[
-
1
]
upload_channel
=
channels_dict
[
"{}/{}"
.
format
(
...
...
bob/devtools/test_bootstrap.py
0 → 100644
View file @
666dc032
#!/usr/bin/env python
from
.bootstrap
import
get_channels
def
test_get_channels
():
server
,
group
=
"idiap.ch"
,
"bob"
# test when building public beta packages
public
,
stable
=
True
,
False
channels
,
upload_channel
=
get_channels
(
public
=
public
,
stable
=
stable
,
server
=
server
,
intranet
=
not
public
,
group
=
group
,
)
assert
channels
==
[
f
"
{
server
}
/software/
{
group
}
/conda/label/beta"
]
assert
upload_channel
==
channels
[
0
]
# test with add_dependent_channels
channels
,
upload_channel
=
get_channels
(
public
=
public
,
stable
=
stable
,
server
=
server
,
intranet
=
not
public
,
group
=
group
,
add_dependent_channels
=
True
,
)
assert
channels
==
[
f
"
{
server
}
/software/
{
group
}
/conda/label/beta"
,
"conda-forge"
,
]
assert
upload_channel
==
channels
[
0
]
# test when building public stable packages
public
,
stable
=
True
,
True
channels
,
upload_channel
=
get_channels
(
public
=
public
,
stable
=
stable
,
server
=
server
,
intranet
=
not
public
,
group
=
group
,
)
assert
channels
==
[
f
"
{
server
}
/software/
{
group
}
/conda"
]
assert
upload_channel
==
channels
[
0
]
# test when building private beta packages
public
,
stable
=
False
,
False
channels
,
upload_channel
=
get_channels
(
public
=
public
,
stable
=
stable
,
server
=
server
,
intranet
=
not
public
,
group
=
group
,
)
assert
channels
==
[
f
"
{
server
}
/software/
{
group
}
/conda/label/beta"
,
f
"
{
server
}
/private/conda/label/beta"
,
]
assert
upload_channel
==
channels
[
1
]
# test when building private stable packages
public
,
stable
=
False
,
True
channels
,
upload_channel
=
get_channels
(
public
=
public
,
stable
=
stable
,
server
=
server
,
intranet
=
not
public
,
group
=
group
,
)
assert
channels
==
[
f
"
{
server
}
/software/
{
group
}
/conda"
,
f
"
{
server
}
/private/conda"
,
]
assert
upload_channel
==
channels
[
1
]
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