File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717PLACEHOLDER_DIR = [Path ("src/module_name/sample_data" )]
1818PYPROJECT_TARGET = Path ("pyproject.toml" )
1919README_TARGET = Path ("README.md" )
20+ ALT_FILE_DIR = Path ("alt_files" )
2021ORG = "Preocts"
2122REPO = r"python\-src\-template"
2223
@@ -69,6 +70,19 @@ def get_input(prompt: str) -> str:
6970 return input (prompt )
7071
7172
73+ def select_project_type () -> None :
74+ """Select whether alt_files should be used."""
75+ user_input = get_input ("Switch to dependencies in pyproject.toml? (y/N) : " )
76+ if user_input .lower () == "y" :
77+ for file in ALT_FILE_DIR .iterdir ():
78+ file .replace (file .name )
79+
80+ # Remove alt_files directory and all contents
81+ for file in ALT_FILE_DIR .iterdir ():
82+ os .remove (file )
83+ os .rmdir (ALT_FILE_DIR )
84+
85+
7286def get_project_data () -> ProjectData :
7387 """Query user for details on the project. This is the quiz."""
7488 data = ProjectData ()
@@ -118,6 +132,8 @@ def rename_module_folder(name: str) -> None:
118132if __name__ == "__main__" :
119133 print ("Eggcellent template setup:\n " )
120134
135+ select_project_type ()
136+
121137 project_data = get_project_data ()
122138
123139 replace_pyproject_values (project_data )
You can’t perform that action at this time.
0 commit comments