diff --git a/setup.cfg b/setup.cfg index cfae6d8fc..4742ef709 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,5 @@ [metadata] name = mne-bids -version = attr: mne_bids.__version__ url = https://github.com/mne-tools/mne-bids author = mne-bids developers maintainer = Mainak Jas diff --git a/setup.py b/setup.py index b62f98a40..b096e7fbf 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,19 @@ # This enables setuptools to install wheel on-the-fly SETUP_REQUIRES += ["wheel"] if "bdist_wheel" in sys.argv else [] +version = None +with open('mne_bids/__init__.py', 'r') as fid: + for line in fid: + line = line.strip() + if line.startswith('__version__ = '): + version = line.split(' = ')[1].split('#')[0].strip('\'') + break +if version is None: + raise RuntimeError('Could not determine version') + + if __name__ == "__main__": setup( + version=version, setup_requires=SETUP_REQUIRES, )