Skip to content

Commit

Permalink
#12 Print version during run
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Sep 22, 2024
1 parent 9d5d073 commit 07e0fc0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
11 changes: 2 additions & 9 deletions cppwg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,14 @@
Contains string templates for Python wrappers.
utils
Contains utility functions and constants.
version
Contains version information.
writers
Contains writers for creating Python wrappers and writing to file.
Utilities
---------
__version__
cppwg version string
"""

from importlib import metadata

from cppwg.generators import CppWrapperGenerator

__all__ = [
"CppWrapperGenerator",
]

__version__ = metadata.version("cppwg")
3 changes: 2 additions & 1 deletion cppwg/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import argparse
import logging

from cppwg import CppWrapperGenerator, __version__
from cppwg import CppWrapperGenerator
from cppwg.version import __version__


def parse_args() -> argparse.Namespace:
Expand Down
3 changes: 3 additions & 0 deletions cppwg/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
CPPWG_DEFAULT_WRAPPER_DIR,
CPPWG_HEADER_COLLECTION_FILENAME,
)
from cppwg.version import __version__ as cppwg_version
from cppwg.writers.header_collection_writer import CppHeaderCollectionWriter
from cppwg.writers.package_writer import CppPackageWrapperWriter

Expand Down Expand Up @@ -58,6 +59,8 @@ def __init__(
):
logger = logging.getLogger()

logger.info(f"cppwg version {cppwg_version}")

# Check that castxml_binary exists and is executable
self.castxml_binary: str = ""

Expand Down
5 changes: 5 additions & 0 deletions cppwg/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Version information."""

from importlib import metadata

__version__ = metadata.version("cppwg")

0 comments on commit 07e0fc0

Please sign in to comment.