import io
import os
import re

"""
This is setup.py to be used from bitbake recipe.
If package is downloaded from pypi, the version is taken from the package: src/mq4hemc/_version.py.
"""

version="0.0.1"
version_file = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/mq4hemc/_version.py'))
if os.path.isfile(version_file):
    with io.open(version_file, "rt", encoding="utf8") as f:
        match = re.search(r"__version__ = version = '(.*)'", f.read())
        if match:
            version = match.group(1)

from setuptools import setup
setup(
    version=version,
)
