Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
18bf282a
Commit
18bf282a
authored
Mar 12, 2020
by
romainx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed _packages_from_json
parent
fbea8a6f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
Makefile
Makefile
+2
-0
test/helpers.py
test/helpers.py
+15
-4
test/test_packages.py
test/test_packages.py
+1
-2
No files found.
Makefile
View file @
18bf282a
...
...
@@ -94,3 +94,5 @@ tx-en: ## rebuild en locale strings and push to master (req: GH_TOKEN)
test/%
:
##
run tests against a stack (only common tests or common tests + specific tests)
@
if
[
!
-d
"
$(
notdir
$@
)
/test"
]
;
then
TEST_IMAGE
=
"
$(OWNER)
/
$(
notdir
$@
)
"
pytest
-m
"not info"
test
;
\
else
TEST_IMAGE
=
"
$(OWNER)
/
$(
notdir
$@
)
"
pytest
-m
"not info"
test
$(
notdir
$@
)
/test
;
fi
test-all
:
$(foreach I
,
$(ALL_IMAGES)
,
test/$(I))
##
test all stacks
\ No newline at end of file
test/helpers.py
View file @
18bf282a
...
...
@@ -88,10 +88,21 @@ class CondaPackageHelper:
def
_packages_from_json
(
env_export
):
"""Extract packages and versions from the lines returned by the list of specifications"""
dependencies
=
json
.
loads
(
env_export
)
.
get
(
"dependencies"
)
# FIXME: # shall be able to parse conda-forge::blas[build=openblas] without considering openblas as the version
packages_list
=
map
(
lambda
x
:
x
.
split
(
"="
,
1
),
dependencies
)
# TODO: could be improved
return
{
package
[
0
]:
set
(
package
[
1
:])
for
package
in
packages_list
}
packages_dict
=
dict
()
for
split
in
map
(
lambda
x
:
x
.
split
(
"="
,
1
),
dependencies
):
# default values
package
=
split
[
0
]
version
=
set
()
# cheking if it's a proper version by testing if the first char is a digit
if
len
(
split
)
>
1
:
if
split
[
1
][
0
]
.
isdigit
():
# package + version case
version
=
set
(
split
[
1
:])
else
:
# The split was incorrect and the package shall not be splitted
package
=
f
"{split[0]}={split[1]}"
packages_dict
[
package
]
=
version
return
packages_dict
def
available_packages
(
self
):
"""Return the available packages"""
...
...
test/test_packages.py
View file @
18bf282a
...
...
@@ -63,8 +63,7 @@ EXCLUDED_PACKAGES = [
"tini"
,
"python"
,
"hdf5"
,
# FIXME: shall be parsed as conda-forge::blas[build=openblas]
"conda-forge::blas[build"
,
"conda-forge::blas[build=openblas]"
,
"protobuf"
,
"r-irkernel"
,
"unixodbc"
,
...
...
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