Skip to content

Commit

Permalink
feat: add project_name configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie committed Dec 12, 2024
1 parent 1bbfe9e commit 28787e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
project_name: PyConverter-GeneratedCommands # Name of the project

library_name_structured: # Future name of the library
- pyconverter
- generatedcommands
Expand Down
3 changes: 2 additions & 1 deletion src/pyconverter/xml2py/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def write_global__init__file(library_path: Path, config_path: Path) -> None:
Path object of the directory containing the generated package.
"""

project_name = get_config_data_value(config_path, "project_name")
subfolder_values = get_config_data_value(config_path, "subfolders")

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


Expand Down

0 comments on commit 28787e8

Please sign in to comment.