Skip to content

Commit 15f4264

Browse files
authored
feat: add manifest and modify setup (#21)
1 parent 9d81e6d commit 15f4264

File tree

4 files changed

+7
-56
lines changed

4 files changed

+7
-56
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include scripts/template.html

scripts/html_writing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ def papers_comparison(save_dir: str, ind: int, text1: list, text2: list, filenam
117117
"""Write to HTML file texts that have been compared with highlighted similar blocks"""
118118

119119
try:
120-
with importlib.resources.path("copy_spotter.templates", "template.html") as template_path:
120+
with importlib.resources.path("scripts", "template.html") as template_path:
121121
comp_path = path.join(save_dir, f"{ind}.html")
122122
copyfile(template_path, comp_path)
123123
except ModuleNotFoundError:
124124
# Fallback for local development
125-
template_path_local = path.join("templates", "template.html")
125+
template_path_local = path.join("template.html")
126126
comp_path = path.join(save_dir, str(ind) + ".html")
127127

128128
# Copy the template to the save directory under a new name

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ def get_version():
4040
"copy-spotter=scripts.main:main",
4141
],
4242
},
43+
include_package_data=True,
44+
package_data={
45+
"scripts": ["template.html"],
46+
},
4347
)

templates/template.html

-54
This file was deleted.

0 commit comments

Comments
 (0)