Skip to content

Commit

Permalink
Fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Sep 24, 2024
1 parent 15706fc commit a6afd1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eessi/testsuite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
# Using a relative path for relative_to doesn't work, because it will be relative to the current working
# directory (which could be anywhere)
# __file__ is the location of this init file (a full path), and this gives us a predictable path to the root
# (namely: two levels up)
# Note that if we ever move this __init__ file relative to the root of the git tree, we'll need to adjust this
# (namely: two levels up). Note that if we ever move this __init__ file relative to the root of the git
# tree, we'll need to adjust this
__version__ = get_version(root='../..', relative_to=__file__)
except (ImportError, LookupError):
# If running from a tarball (e.g. release tarball) downloaded from github, we will not have the .git
# folder available. Thus, setuptools_scm cannot determine the version in any way. Thus, use the
# fallback_version from the pyproject.toml file (which doesn't exist when this is installed as a package,
# but SHOULD exist when this is run from a downloaded tarball from git)

# Pyproject.toml should be two levels up from this file
import os.path
pyproject_toml = "%s/../../pyproject.toml" % os.path.dirname(__file__)

# Variables to track if we're in the right section and to store the fallback_version
in_setuptools_scm_section = False
fallback_version = None

file = None
try:
file = open(pyproject_toml, 'r')
Expand All @@ -51,7 +51,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 Down

0 comments on commit a6afd1a

Please sign in to comment.