Skip to content

Commit

Permalink
Sort __all__ elements in __init__.py (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
lord-haffi authored Feb 2, 2024
1 parent 66ff709 commit 2de14cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bo4e_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Contains code to generate pydantic v2 models from json schemas.
Since the used tool doesn't support all features we need, we monkey patch some functions.
"""
import itertools
import re
from pathlib import Path
from typing import Sequence, Tuple, Type
Expand Down Expand Up @@ -149,9 +150,8 @@ def bo4e_init_file_content(namespace: dict[str, SchemaMetadata], version: str) -
init_file_content = INIT_FILE_COMMENT.strip().format(version=version)

init_file_content += "\n\n__all__ = [\n"
for class_name in namespace:
for class_name in sorted(itertools.chain(namespace, ["__version__"])):
init_file_content += f' "{class_name}",\n'
init_file_content += ' "__version__",\n'
init_file_content += "]\n\n"

for schema_metadata in namespace.values():
Expand Down

0 comments on commit 2de14cf

Please sign in to comment.