Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ jobs:
with:
python-version: 3.7

- name: Add version information
run: make version-info

- name: Install dependencies and build the library
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ install:
@python -m build
@pip install dist/*.whl --force-reinstall

version-info:
@bash -c "date -u +'Build date: %B %d, %Y %H:%M UTC ShaID: <id>' | xargs -I date sed -i 's/_VERSION_INFO = .*/_VERSION_INFO = \"date\"/g' src/ansys/fluent/visualization/__init__.py"
@bash -c "git --no-pager log -n 1 --format='%h' | xargs -I hash sed -i 's/<id>/hash/g' src/ansys/fluent/visualization/__init__.py"

docker-pull:
@pip install docker
@bash .ci/pull_fluent_image.sh
Expand Down
15 changes: 15 additions & 0 deletions src/ansys/fluent/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@
except ModuleNotFoundError:
import importlib_metadata

_VERSION_INFO = None
__version__ = importlib_metadata.version(__name__.replace(".", "-"))


def version_info() -> str:
"""Method returning the version of PyFluent being used.
Returns
-------
str
The PyFluent version being used.
Notes
-------
Only available in packaged versions. Otherwise it will return __version__.
"""
return _VERSION_INFO if _VERSION_INFO is not None else __version__


required_libraries = {
"vtk": "9.1.0",
"pyvista": "0.33.2",
Expand Down