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+ TOX_TARGET = Path ("tox.ini" )
2021ALT_FILE_DIR = Path ("alt_files" )
2122REQUIREMENTS_DIR = Path ("requirements" )
2223ORG = "Preocts"
@@ -110,6 +111,14 @@ def replace_readme_values(data: ProjectData) -> None:
110111 README_TARGET .write_text (readme )
111112
112113
114+ @bookends ("Updating tox.ini values" )
115+ def replace_tox_values (data : ProjectData ) -> None :
116+ """Update tox value, replacing module_name with actual module name."""
117+ tox = Path (TOX_TARGET ).read_text ()
118+ tox = tox .replace ("module_name" , data .module )
119+ Path (TOX_TARGET ).write_text (tox )
120+
121+
113122@bookends ("Renaming src/module_name folder" )
114123def rename_module_folder (name : str ) -> None :
115124 """Rename module folder."""
@@ -123,6 +132,7 @@ def rename_module_folder(name: str) -> None:
123132 project_data = get_project_data ()
124133
125134 replace_pyproject_values (project_data )
135+ replace_tox_values (project_data )
126136 replace_readme_values (project_data )
127137
128138 delete_placeholder_files ()
You can’t perform that action at this time.
0 commit comments