Skip to content

Commit 28787e8

Browse files
committed
feat: add project_name configuration
1 parent 1bbfe9e commit 28787e8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
project_name: PyConverter-GeneratedCommands # Name of the project
2+
13
library_name_structured: # Future name of the library
24
- pyconverter
35
- generatedcommands

src/pyconverter/xml2py/writer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def write_global__init__file(library_path: Path, config_path: Path) -> None:
220220
Path object of the directory containing the generated package.
221221
"""
222222

223+
project_name = get_config_data_value(config_path, "project_name")
223224
subfolder_values = get_config_data_value(config_path, "subfolders")
224225

225226
if subfolder_values:
@@ -244,7 +245,7 @@ def write_global__init__file(library_path: Path, config_path: Path) -> None:
244245
fid.write("except ModuleNotFoundError:\n")
245246
fid.write(" import importlib_metadata\n\n")
246247
fid.write("__version__ = importlib_metadata.version(__name__.replace('.', '-'))\n")
247-
fid.write('"""PyConverter-GeneratedCommands version."""\n')
248+
fid.write(f'"""{project_name} version."""\n')
248249
fid.close()
249250

250251

0 commit comments

Comments
 (0)