diff --git a/pyproject.toml b/pyproject.toml index 8db10955..5dfb3356 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ dependencies = [ "pyyaml", "scipy", "upath", - "boto3", + "boto3==1.35.81", "matplotlib", "cellmap-schemas", "funlib.persistence @ git+https://github.com/funkelab/funlib.persistence.git@ome-ngff", diff --git a/remove_all.py b/remove_all.py new file mode 100644 index 00000000..baa01286 --- /dev/null +++ b/remove_all.py @@ -0,0 +1,26 @@ +import os +import re + +def remove_docstrings_from_file(file_path): + with open(file_path, 'r') as file: + content = file.read() + + # Pattern to match single-line and multi-line docstrings + docstring_pattern = r'(""".*?"""|\'\'\'.*?\'\'\')' + updated_content = re.sub(docstring_pattern, '', content, flags=re.DOTALL) + + with open(file_path, 'w') as file: + file.write(updated_content) + +def process_directory(directory_path): + for root, _, files in os.walk(directory_path): + for file in files: + if file.endswith('.py'): + file_path = os.path.join(root, file) + print(f"Removing docstrings from {file_path}") + remove_docstrings_from_file(file_path) + +if __name__ == "__main__": + directory_path = input("Enter the path to the directory: ") + process_directory(directory_path) +