diff --git a/asmbench/__init__.py b/asmbench/__init__.py index e69de29..bad32e9 100644 --- a/asmbench/__init__.py +++ b/asmbench/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1.4' \ No newline at end of file diff --git a/asmbench/bench.py b/asmbench/bench.py index 08931d3..58ff72b 100755 --- a/asmbench/bench.py +++ b/asmbench/bench.py @@ -34,7 +34,7 @@ def uniquify(l): class Benchmark: def __init__(self, frequency=None): - self.frequency = frequency or psutil.cpu_freq().current * 1e6 + self.frequency = frequency or psutil.cpu_freq().max * 1e6 def __repr__(self): return '{}({})'.format( diff --git a/setup.py b/setup.py index 687a9f3..40016ec 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,39 @@ +import io +import os +import re +from codecs import open # To use a consistent encoding + from setuptools import setup, find_packages +here = os.path.abspath(os.path.dirname(__file__)) -with open('README.rst') as f: + +# Stolen from pip +def read(*names, **kwargs): + with io.open( + os.path.join(os.path.dirname(__file__), *names), + encoding=kwargs.get("encoding", "utf8") + ) as fp: + return fp.read() + + +# Stolen from pip +def find_version(*file_paths): + version_file = read(*file_paths) + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + +# Get the long description from the relevant file +with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='asmbench', - version='0.1.3', + version=find_version('asmbench', '__init__.py'), packages=find_packages(exclude=['contrib', 'docs', 'tests*']), url='https://github.com/RRZE-HPC/asmbench', license='AGPLv3',