@@ -33,9 +33,7 @@ def _replace_all_occurences(
3333 # Get files in this repository (e.g., exclude venv/).
3434 known_files : set [Path ] = set ()
3535 outer_dir = Path ("." ).parent .resolve ()
36- proc = subprocess .run (
37- ["git" , "ls-files" ], encoding = "utf-8" , stdout = subprocess .PIPE , check = True
38- )
36+ proc = subprocess .run (["git" , "ls-files" ], encoding = "utf-8" , stdout = subprocess .PIPE , check = True )
3937 for line in proc .stdout .split ("\n " ):
4038 known_files .add ((outer_dir / line ).resolve ())
4139 known_files -= exclude
@@ -64,17 +62,11 @@ def _main() -> None:
6462 github_username = config ["github-username" ]
6563 assert " " not in github_username , "Malformed GitHub username"
6664 package_name = config ["your-package-name" ]
67- assert " " not in package_name , (
68- "Package names cannot contain spaces (you want to `import package_name`)"
69- )
70- assert "-" not in package_name , (
71- "Package names cannot dashes (you want to `import package_name`)"
72- )
65+ assert " " not in package_name , "Package names cannot contain spaces (you want to `import package_name`)"
66+ assert "-" not in package_name , "Package names cannot dashes (you want to `import package_name`)"
7367 python_version = config ["python-version" ]
7468 assert python_version .startswith ("3" ), "Only Python 3 is supported"
75- assert python_version .startswith ("3." ), (
76- "Missing dot in Python version (example: 3.10)"
77- )
69+ assert python_version .startswith ("3." ), "Missing dot in Python version (example: 3.10)"
7870 python_subversion = python_version .split ("." )[1 ]
7971 assert python_subversion .isdigit ()
8072
@@ -87,15 +79,9 @@ def _main() -> None:
8779 git_config_file = git_repo / "config"
8880 with open (git_config_file , encoding = "utf-8" ) as fp :
8981 git_config_contents = fp .read ()
90- if (
91- "git@github.com:MTDickens/research-code-python-starter-template"
92- in git_config_contents
93- ):
82+ if "git@github.com:MTDickens/research-code-python-starter-template" in git_config_contents :
9483 shutil .rmtree (git_repo )
95- elif (
96- "https://github.com/MTDickens/research-code-python-starter-template"
97- in git_config_contents
98- ):
84+ elif "https://github.com/MTDickens/research-code-python-starter-template" in git_config_contents :
9985 shutil .rmtree (git_repo )
10086
10187 # Initialize the repo anew.
0 commit comments