Skip to content
Snippets Groups Projects

:sparkles: Also mount songs when running pylint with docker_pylint

Merged Vincent Hatakeyama requested to merge topic/default/how-to-upgrade into branch/default
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
"""Class that encapsulate the docker client"""
"""Class that encapsulate the docker client and provide common methods"""
import atexit
import atexit
import logging
import logging
import os
import os
@@ -202,3 +202,24 @@ def modules_mount(
@@ -202,3 +202,24 @@ def modules_mount(
mount_dict[full_target_path] = full_project_path
mount_dict[full_target_path] = full_project_path
return mount_list, mount_dict
return mount_list, mount_dict
 
 
 
def anthem_mounts(project_path: str, pythons: tuple[str]) -> List[Mount]:
 
"""Return a list of monts for all the anthem songs present in the super project."""
 
mounts: List[Mount] = []
 
# also mount songs for anthem to avoid having to rebuild the image when they
 
# are changed.
 
if os.path.exists("songs"):
 
for root, dirs, _files in os.walk("songs"):
 
for directory in dirs:
 
# with older odoo this will not be set
 
for python in pythons:
 
mounts.append(
 
Mount(
 
f"/usr/local/lib/{python}/dist-packages/{root}/{directory}",
 
os.path.join(project_path, root, directory),
 
"bind",
 
read_only=True,
 
)
 
)
 
return mounts
Loading