diff --git a/.gitignore b/.gitignore index 41aac4aa5d38a306930c4269f7a720ce990d85fb..c3631d40423733f7c3e89d6e152a2c773ddee351 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,7 @@ venv/ .idea **/__pycache__ **/*.py[cod] -node_modules -package-lock.json -package.json + # local env files .env*.local @@ -23,3 +21,8 @@ mac.env .pytest_cache test.py output + +node_modules +package-lock.json +package.json +``` diff --git a/replace.py b/replace.py deleted file mode 100644 index d1fbe59720c3adbf00a710fcae71b647b51a0d6b..0000000000000000000000000000000000000000 --- a/replace.py +++ /dev/null @@ -1,23 +0,0 @@ -import re -import os - - -def replace_type_hints(file_path): - with open(file_path, "rb") as file: - file_data = file.read() - - # Decode the file data with error handling - file_data = file_data.decode("utf-8", errors="ignore") - - # Regular expression pattern to find '| None' and replace with 'Optional' - file_data = re.sub(r"(\w+)\s*\|\s*None", r"Optional[\1]", file_data) - - with open(file_path, "w") as file: - file.write(file_data) - - -# Walk through the repository and update all .py files -for root, dirs, files in os.walk("/Users/jakit/customers/aurelio/semantic-router"): - for file in files: - if file.endswith(".py"): - replace_type_hints(os.path.join(root, file))