mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-10 11:32:57 +00:00
Fix a bug in the helper method
and also make the code more readable.
This commit is contained in:
@@ -87,11 +87,13 @@ class CondaPackageHelper:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _packages_from_json(env_export):
|
def _packages_from_json(env_export):
|
||||||
"""Extract packages and versions from the lines returned by the list of specifications"""
|
"""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")
|
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()
|
packages_dict = dict()
|
||||||
for split in map(lambda x: x.split("=", 1) if isinstance(x, str) else None, dependencies):
|
for split in map(lambda x: x.split("=", 1), dependencies):
|
||||||
if split is None:
|
|
||||||
break
|
|
||||||
# default values
|
# default values
|
||||||
package = split[0]
|
package = split[0]
|
||||||
version = set()
|
version = set()
|
||||||
|
Reference in New Issue
Block a user