Skip to content

Commit

Permalink
Fix flake8 issues. Print version of EESSI as part of the CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Sep 24, 2024
1 parent ed1d1bd commit 7a9d16f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pip_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
python --version
python -m pip --version
python -c 'import setuptools; print("setuptools", setuptools.__version__)'
python -c 'import eessi.testsuite; print("eessi.testsuite:", eess.testsuite.__version__)'
python -c 'import eessi.testsuite.utils'
python -c 'import eessi.testsuite.tests.apps'
12 changes: 8 additions & 4 deletions eessi/testsuite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
elif stripped_line.startswith("[") and in_setuptools_scm_section:
# We've reached a new section, so stop searching
break

# If we're in the right section, look for the fallback_version key
if in_setuptools_scm_section and stripped_line.startswith("fallback_version"):
# Extract the value after the '=' sign and strip any surrounding quotes or whitespace
Expand All @@ -68,6 +68,10 @@
except Exception as e:
print("When trying to open file %s, an exception was raised: %s." % (pyproject_toml, e))

# One of the above three methods SHOULD work in any situation. If it doesn't, one will at this point
# get an error when trying to import __version__ from this file. That's ok, it's considered a bug
# if you reach this point without having a __version__ set
# One of the above three methods to get __version__ defined SHOULD work in any situation.
# It's considered a bug you reach this point without having a __version__ set
if not __version__:
msg = "__version__ should have been defined by now, but it is not."
msg += " This is considered a bug, please report it in an issue on Github for the"
msg += " EESSI test suite."
raise ValueError(msg)
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import pkg_resources


def get_version_by_import():
# Add the fallback version to whatever was set for scm_dict
sys.path.append('.')
Expand Down

0 comments on commit 7a9d16f

Please sign in to comment.