Skip to content

Commit

Permalink
feat: add manifest and modify setup (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzabeee authored May 4, 2024
1 parent 9d81e6d commit 15f4264
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 56 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include scripts/template.html
4 changes: 2 additions & 2 deletions scripts/html_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ def papers_comparison(save_dir: str, ind: int, text1: list, text2: list, filenam
"""Write to HTML file texts that have been compared with highlighted similar blocks"""

try:
with importlib.resources.path("copy_spotter.templates", "template.html") as template_path:
with importlib.resources.path("scripts", "template.html") as template_path:
comp_path = path.join(save_dir, f"{ind}.html")
copyfile(template_path, comp_path)
except ModuleNotFoundError:
# Fallback for local development
template_path_local = path.join("templates", "template.html")
template_path_local = path.join("template.html")
comp_path = path.join(save_dir, str(ind) + ".html")

# Copy the template to the save directory under a new name
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ def get_version():
"copy-spotter=scripts.main:main",
],
},
include_package_data=True,
package_data={
"scripts": ["template.html"],
},
)
54 changes: 0 additions & 54 deletions templates/template.html

This file was deleted.

0 comments on commit 15f4264

Please sign in to comment.