Skip to content
Snippets Groups Projects
Commit f28d9b53 authored by Pierre Augier's avatar Pierre Augier
Browse files

Alternative implementation for local version (pull request #14)

parent c6bb9b9b
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@
"""
from ._version import __version__
from ._version import __version__, get_local_version
from fluiddyn.io import FLUIDSIM_PATH as path_dir_results
......@@ -46,6 +46,7 @@
__all__ = [
"__version__",
"get_local_version",
"path_dir_results",
"import_module_solver_from_key",
"import_simul_class_from_key",
......
......@@ -22,6 +22,8 @@
__version__ = "0.2.3"
__all__ = ["__version__", "get_local_version", "__about__"]
try:
from pyfiglet import figlet_format
......@@ -37,3 +39,21 @@
"""
__about__ = __about__.rstrip() + f"\n\n{28 * ' '} v. {__version__}\n"
_loc_version = None
def get_local_version():
"""Get a long "local" version."""
global _loc_version
if _loc_version is None:
from setuptools_scm import get_version
try:
_loc_version = get_version(root="..", relative_to=__file__)
except LookupError:
_loc_version = __version__
return _loc_version
......@@ -349,7 +349,7 @@
" the Python program FluidDyn "
+ fluiddyn.__version__
+ " and FluidSim "
+ fluidsim.__version__
+ fluidsim.get_local_version()
+ ".\n\nIt should not be modified "
"(except for adding xml comments)."
)
......
......@@ -124,6 +124,7 @@
"h5py",
"h5netcdf",
"fluidpythran >= 0.0.3",
"setuptools_scm",
]
if FFTW3:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment