Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4a01551
Trial without conditional run
RobPasMue Apr 7, 2022
a8cd70c
Missing "with"
RobPasMue Apr 7, 2022
f503a16
Better to unify all pre-commit operations in one place
RobPasMue Apr 7, 2022
50f3777
Bug on configuration key used
RobPasMue Apr 7, 2022
aaf1551
Bug - Add echo in command
RobPasMue Apr 7, 2022
6f6167e
Select files on where to apply pre-commit
RobPasMue Apr 7, 2022
9b59803
Remove bash -c
RobPasMue Apr 7, 2022
20a4b41
Bash script approach
RobPasMue Apr 7, 2022
8503a45
Reverting pre-commit approach...
RobPasMue Apr 7, 2022
ef03505
Commit to your own branch on every push - main branch is protected
RobPasMue Apr 8, 2022
857a2d6
Append last commit information to README (and thus to PKG-INFO)
RobPasMue Apr 8, 2022
a3b44c9
LAST_COMMIT Variable creation
RobPasMue Apr 8, 2022
582a6c9
Adapt Makefile
RobPasMue Apr 8, 2022
11e2395
Doc for global variable
RobPasMue Apr 8, 2022
a17aea3
Modify output way - via method version_info()
RobPasMue Apr 8, 2022
f985bdd
Rename Makefile target from last-commit-info to version-info
RobPasMue Apr 8, 2022
15ff2e8
Missing field to adapt
RobPasMue Apr 8, 2022
ae3efc9
Single underscore for _VERSION_INFO
RobPasMue Apr 8, 2022
dfa4073
Return __version__ if undefined _VERSION_INFO
RobPasMue Apr 8, 2022
919acdc
Apply suggestions from code review
RobPasMue Apr 8, 2022
d35ec89
Adding extra line - style check
RobPasMue Apr 8, 2022
2daa643
Minor modification to NB statement
RobPasMue Apr 11, 2022
8fe1e17
Merge branch 'feat/last-commit-info' of https://github.com/pyansys/py…
RobPasMue Apr 11, 2022
e3d1ba0
Change location
RobPasMue Apr 11, 2022
bf09391
Remove spaces
RobPasMue Apr 11, 2022
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.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ jobs:
- name: Install pyvistaqt requirements
run: make install-pyvistaqt-requirements

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

- name: Install pyfluent with post requirements
run: make install-post

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ install:
@python setup.py bdist_wheel
@pip install dist/*.whl

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' ansys/fluent/core/__init__.py"
@bash -c "git --no-pager log -n 1 --format='%h' | xargs -I hash sed -i 's/<id>/hash/g' ansys/fluent/core/__init__.py"

install-post:
@pip install -r requirements_build.txt
@python setup.py sdist
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ to the Fluent without changing the core behavior or license of the original
software. The use of the interactive Fluent control of ``PyFluent`` requires a
legally licensed local copy of Ansys.

To get a copy of Ansys, please visit `Ansys <https://www.ansys.com/>`_.
To get a copy of Ansys, please visit `Ansys <https://www.ansys.com/>`_.
18 changes: 18 additions & 0 deletions ansys/fluent/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
except ImportError:
pass

_VERSION_INFO = None
"""Global variable indicating the version of the PyFluent package - Empty by default"""


def version_info():
"""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__


def set_log_level(level):
"""Set logging level.
Expand Down