Skip to content

Commit

Permalink
Fix wrong test import.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmaillot committed Jun 22, 2021
1 parent d771496 commit 0e4f4f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import shutil

MODULE_NAME = "nanovare_yolov5"
VERSION = "0.2.0"
VERSION = "0.2.1"


def copy_to_module():
Expand Down Expand Up @@ -45,7 +45,8 @@ def copy_to_module():
strings_to_replace = {}
for module_name in modules_moved:
strings_to_replace[f"from {module_name} "] = f"from {MODULE_NAME}.{module_name} "
strings_to_replace[f"import {module_name}"] = f"import {MODULE_NAME}.{module_name} "
# TODO handle cases for "import module_name as"
strings_to_replace[f"import {module_name}"] = f"import {MODULE_NAME}.{module_name} as {module_name}"
strings_to_search_for = tuple(strings_to_replace)
new_python_files = list(module_root_path.glob("**/*.py"))
lines_changed = []
Expand All @@ -58,7 +59,10 @@ def copy_to_module():
lines_changed.append(line)
for key in strings_to_search_for:
if line.startswith(key):
print(line.rstrip())
line = line.replace(key, strings_to_replace[key], 1)
print(line.rstrip())
print()
data.append(line)
with python_file_path.open("w") as f:
for line in data:
Expand Down

0 comments on commit 0e4f4f7

Please sign in to comment.