Skip to content

Commit d126199

Browse files
committed
wip
1 parent 20f5f48 commit d126199

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: check-toml
99
- id: check-yaml
1010
exclude: template.yaml
11-
# - id: debug-statements
11+
- id: debug-statements
1212
- id: end-of-file-fixer
1313
exclude: WHEEL
1414
exclude_types: [json]

tools/synchro.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import os
2323
import re
24-
import subprocess
24+
import sys
2525
from os import listdir
2626
from pathlib import Path
2727

@@ -358,10 +358,7 @@ def unasync_directory(files: list[str], src: str, dest: str, replacements: dict[
358358

359359

360360
def main() -> None:
361-
output = subprocess.check_output(["git", "status", "-s"]).decode("utf8") # noqa:S603,S607
362-
modified_files = set()
363-
for line in output.splitlines():
364-
modified_files.add("./" + line.strip().split(" ")[1])
361+
modified_files = [f"./{f}" for f in sys.argv[1:]]
365362
errored = False
366363
for fname in async_files + gridfs_files:
367364
if str(fname) in modified_files:
@@ -371,9 +368,6 @@ def main() -> None:
371368
print(f"Refusing to overwrite {sync_name}")
372369
errored = True
373370
if errored:
374-
import pdb
375-
376-
pdb.set_trace()
377371
raise ValueError("Aborting synchro due to errors")
378372

379373
unasync_directory(async_files, _pymongo_base, _pymongo_dest_base, replacements)

tools/synchro.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -eu
44

5-
python ./tools/synchro.py
5+
python ./tools/synchro.py $@
66
python -m ruff check pymongo/synchronous/ gridfs/synchronous/ test/ --fix --silent
77
python -m ruff format pymongo/synchronous/ gridfs/synchronous/ test/ --silent

0 commit comments

Comments
 (0)