Skip to content

Commit 819378a

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent d01e069 commit 819378a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hooks/post_gen_project.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def set_python_version():
6-
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
6+
python_version = f"{str(sys.version_info.major)}.{str(sys.version_info.minor)}"
77

88
file_names = ["Dockerfile", "Pipfile", ".github/workflows/test.yml"]
99
for file_name in file_names:
@@ -15,8 +15,8 @@ def set_python_version():
1515

1616
def remove_main_if_lib():
1717
is_lib = '{{ cookiecutter.binary }}'
18-
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
19-
if not (is_lib == "y" or is_lib == "Y"):
18+
if is_lib not in {"y", "Y"}:
19+
main_file_path = os.path.join('{{ cookiecutter.repo_name }}', '__main__.py')
2020
os.remove(main_file_path)
2121
print(main_file_path)
2222

@@ -28,7 +28,7 @@ def remove_main_if_lib():
2828
def main():
2929
set_python_version()
3030
remove_main_if_lib()
31-
print(SUCCESS + "Project successfully initialized" + TERMINATOR)
31+
print(f"{SUCCESS}Project successfully initialized{TERMINATOR}")
3232

3333

3434
if __name__ == "__main__":

0 commit comments

Comments
 (0)