Skip to content

Commit

Permalink
Reorganize hoomd.version
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 9, 2021
1 parent fb2d30d commit 68b409f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 34 deletions.
33 changes: 12 additions & 21 deletions hoomd/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,18 @@
"""
from hoomd import _hoomd

try:
import hoomd.version_config

compile_date = hoomd.version_config.compile_date
git_branch = hoomd.version_config.git_branch
git_sha1 = hoomd.version_config.git_sha1
md_built = hoomd.version_config.md_built
hpmc_built = hoomd.version_config.hpmc_built
dem_built = hoomd.version_config.dem_built
mpcd_built = hoomd.version_config.mpcd_built
metal_built = hoomd.version_config.metal_built
except ImportError:
# Allow sphinx docs to build when missing CMake generated python files
compile_date = "n/a"
git_branch = "n/a"
git_sha1 = "n/a"
md_built = "n/a"
hpmc_built = "n/a"
dem_built = "n/a"
mpcd_built = "n/a"
metal_built = "n/a"
from hoomd.version_config import (
compile_date,
git_branch,
git_sha1,
md_built,
hpmc_built,
dem_built,
mpcd_built,
metal_built,
cuda_include_path,
cuda_devrt_library,
)

version = _hoomd.BuildInfo.getVersion()
compile_flags = _hoomd.BuildInfo.getCompileFlags()
Expand Down
4 changes: 4 additions & 0 deletions hoomd/version_config.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ dem_built = ${_dem_built}
mpcd_built = ${_mpcd_built}

metal_built = ${_metal_built}

cuda_include_path = "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"

cuda_devrt_library = "${CUDA_cudadevrt_LIBRARY}"
1 change: 1 addition & 0 deletions sphinx-doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

autodoc_mock_imports = [
'hoomd._hoomd',
'hoomd.version_config',
'hoomd.md._md',
'hoomd.metal._metal',
'hoomd.mpcd._mpcd',
Expand Down
13 changes: 0 additions & 13 deletions sphinx-doc/module-hoomd-version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,3 @@ hoomd.version
.. automodule:: hoomd.version
:synopsis: Version and build information.
:members: compile_date,
compile_flags,
cxx_compiler,
git_branch,
git_sha1,
gpu_api_version,
gpu_enabled,
gpu_platform,
install_dir,
mpi_enabled,
source_dir,
tbb_enabled,
version

0 comments on commit 68b409f

Please sign in to comment.