Skip to content

Commit 0b8381a

Browse files
committed
[update-checkout] Move all files except the top level entrypoints into ./utils/update_checkout/*.
This makes update_checkout into a true python module that we can add nosetests for, readme, and also split up without issue into multiple small files. I also added a small stub test directory and support for running tests for update_checkout during validation-testing. So once we add some tests, everything is setup correctly in terms of the swift build for testing purposes.
1 parent 31f2c75 commit 0b8381a

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

utils/update_checkout/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
from update_checkout import main
3+
4+
__all__ = ["main"]

utils/update_checkout/tests/__init__.py

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
from update_checkout import main
3+
4+
__all__ = ["main"]

utils/update_checkout.py renamed to utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ def main():
414414
action='store_true')
415415
parser.add_argument(
416416
"--config",
417-
default=os.path.join(SCRIPT_DIR, "update-checkout-config.json"),
417+
default=os.path.join(SCRIPT_DIR, os.pardir,
418+
"update-checkout-config.json"),
418419
help="Configuration file to use")
419420
parser.add_argument(
420421
"--github-comment",
@@ -518,7 +519,3 @@ def main():
518519
else:
519520
print("update-checkout succeeded")
520521
sys.exit(fail_count)
521-
522-
523-
if __name__ == "__main__":
524-
main()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %{python} -m unittest discover -s %swift_src_root/utils/update_checkout

0 commit comments

Comments
 (0)