Skip to content

Commit

Permalink
Remove LooseVersion from __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
appolloford committed Oct 19, 2023
1 parent 71013df commit 59f5041
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions easybuild/easyblocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
@author: Jens Timmerman (Ghent University)
"""
import os
from easybuild.tools import LooseVersion
from pkgutil import extend_path

# note: release candidates should be versioned as a pre-release, e.g. "1.1rc1"
Expand All @@ -43,7 +42,7 @@
# recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like
# UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0'
# This causes problems further up the dependency chain...
VERSION = LooseVersion('5.0.0.dev0')
VERSION = '5.0.0.dev0'
UNKNOWN = 'UNKNOWN'


Expand Down Expand Up @@ -76,7 +75,7 @@ def get_git_revision():
if git_rev == UNKNOWN:
VERBOSE_VERSION = VERSION
else:
VERBOSE_VERSION = LooseVersion("%s-r%s" % (VERSION, git_rev))
VERBOSE_VERSION = "%s-r%s" % (VERSION, git_rev)

# extend path so python finds our easyblocks in the subdirectories where they are located
subdirs = [chr(x) for x in range(ord('a'), ord('z') + 1)] + ['0']
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
sys.path.append('easybuild')
from easyblocks import VERSION # noqa

FRAMEWORK_MAJVER = str(VERSION).split('.')[0]
FRAMEWORK_MAJVER = VERSION.split('.')[0]

# log levels: 0=WARN (default), 1=INFO, 2=DEBUG
log.set_verbosity(1)
Expand All @@ -55,7 +55,7 @@ def read(fname):

setup(
name="easybuild-easyblocks",
version=str(VERSION),
version=VERSION,
author="EasyBuild community",
author_email="[email protected]",
description="""Python modules which implement support for installing particular \
Expand Down
5 changes: 1 addition & 4 deletions test/easyblocks/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ class EB_%s(EasyBlock):
__path__ = extend_path(__path__, '%s.%s' % (__name__, subdir))
"""
NAMESPACE_EXTEND_PATH = "from pkgutil import extend_path; __path__ = extend_path(__path__, __name__)"
EASYBLOCKS_VERSION = """
from distutils.version import LooseVersion
VERSION = LooseVersion('%s')
""" % VERSION
EASYBLOCKS_VERSION = "VERSION = '%s'" % VERSION


def det_path_for_import(module, pythonpath=None):
Expand Down

0 comments on commit 59f5041

Please sign in to comment.