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
8de52359
Commit
8de52359
authored
Apr 06, 2020
by
romainx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug in the helper method
and also make the code more readable.
parent
d458afff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
test/helpers.py
test/helpers.py
+5
-3
No files found.
test/helpers.py
View file @
8de52359
...
...
@@ -87,11 +87,13 @@ class CondaPackageHelper:
@
staticmethod
def
_packages_from_json
(
env_export
):
"""Extract packages and versions from the lines returned by the list of specifications"""
#dependencies = filter(lambda x: isinstance(x, str), json.loads(env_export).get("dependencies"))
dependencies
=
json
.
loads
(
env_export
)
.
get
(
"dependencies"
)
# Filtering packages installed through pip in this case it's a dict {'pip': ['toree==0.3.0']}
# Since we only manage packages installed through conda here
dependencies
=
filter
(
lambda
x
:
isinstance
(
x
,
str
),
dependencies
)
packages_dict
=
dict
()
for
split
in
map
(
lambda
x
:
x
.
split
(
"="
,
1
)
if
isinstance
(
x
,
str
)
else
None
,
dependencies
):
if
split
is
None
:
break
for
split
in
map
(
lambda
x
:
x
.
split
(
"="
,
1
),
dependencies
):
# default values
package
=
split
[
0
]
version
=
set
()
...
...
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