Skip to content

Commit

Permalink
fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
skoulouzis committed Mar 22, 2022
1 parent bd26bf0 commit b65f0d4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions jupyterlab_vre/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)

deprecated_modules = {'pathlib': 'pathlib2'}

################################################################################

Expand Down Expand Up @@ -190,21 +191,22 @@ async def post(self, *args, **kwargs):
for dep in current_cell.dependencies:
if 'module' in dep and dep['module']:
if '.' in dep['module']:
set_deps.add((dep['module'].split('.')[0]))
module_name = dep['module'].split('.')[0]
else:
set_deps.add(dep['module'])
module_name = dep['module']
elif 'name' in dep and dep['name']:
set_deps.add(dep['name'])
module_name = dep['name']
if module_name:
if module_name in deprecated_modules.keys():
module_name = deprecated_modules[module_name]
set_deps.add(module_name)

# set_deps = set([dep['module'].split('.')[0] for dep in current_cell.dependencies])

cell_file_path = os.path.join(cell_path, cell_file_name)
dockerfile_file_path = os.path.join(cell_path, dockerfile_name)
env_file_path = os.path.join(cell_path, env_name)
files_info = {}
files_info[cell_file_name] = cell_file_path
files_info[dockerfile_name] = dockerfile_file_path
files_info[env_name] = env_file_path
files_info = {cell_file_name: cell_file_path, dockerfile_name: dockerfile_file_path, env_name: env_file_path}

template_cell.stream(cell=current_cell, deps=deps, types=current_cell.types, confs=confs).dump(cell_file_path)
template_dockerfile.stream(task_name=current_cell.task_name).dump(dockerfile_file_path)
Expand Down

0 comments on commit b65f0d4

Please sign in to comment.