Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of shutil.copytree when overriding existing template files in tmp_dir #2133

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Drop Python 3.6 and 3.7 support, add 3.12 ([#2121](https://github.com/ewels/MultiQC/pull/2121))
- <img src="./multiqc/templates/default/assets/img/favicon-16x16.png" alt="///" width="10px"/> New logo
- Set name and anchor for the custom content "module" [#2131](https://github.com/ewels/MultiQC/pull/2131)
- Fix use of `shutil.copytree` when overriding existing template files in `tmp_dir` ([#2133](https://github.com/ewels/MultiQC/pull/2133))

### New Modules

Expand Down
3 changes: 2 additions & 1 deletion multiqc/multiqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,10 @@ def __rich_measure__(self, console: rich.console.Console, options: rich.console.
# Load in parent template files first if a child theme
try:
parent_template = config.avail_templates[template_mod.template_parent].load()
shutil.copytree(parent_template.template_dir, tmp_dir)
except AttributeError:
pass # Not a child theme
else:
shutil.copytree(parent_template.template_dir, tmp_dir, dirs_exist_ok=True)

# Copy the template files to the tmp directory (`dirs_exist_ok` makes sure
# parent template files are overwritten)
Expand Down