Skip to content

Commit

Permalink
Added __version__ attribute in ARRUS Python main module.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjarosik committed Jun 30, 2021
1 parent c173afe commit 6e1ec43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,25 @@ set(TEST_FILES
"arrus/tests/us4oem_kernels_test.py"
)

set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
set(SETUP_PY_OUT "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
set(INIT_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/arrus/__init__.py")
set(INIT_PY_OUT "${CMAKE_CURRENT_BINARY_DIR}/tmp/__init__.py")

set(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/timestamp")

configure_file(${SETUP_PY_IN} ${SETUP_PY_OUT})
configure_file(${INIT_PY_IN} ${INIT_PY_OUT})


add_custom_command(OUTPUT ${TIMESTAMP}
COMMAND
${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/arrus ${CMAKE_CURRENT_BINARY_DIR}/arrus
# Override __init__.py file with the correct Python package version.
COMMAND
${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/tmp/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/arrus
COMMAND
${CMAKE_COMMAND} -E copy_directory
${Us4_ROOT_DIR}/lib64 ${CMAKE_CURRENT_BINARY_DIR}/arrus
Expand Down
2 changes: 2 additions & 0 deletions api/python/arrus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
os.environ["PATH"] += os.pathsep + os.path.dirname(os.path.join(os.path.abspath(__file__)))


__version__ = "${PROJECT_VERSION}"

from arrus.session import Session
from arrus.logging import (
set_clog_level,
Expand Down

0 comments on commit 6e1ec43

Please sign in to comment.