|
1 | 1 | import os
|
2 | 2 | from setuptools import setup, Command
|
3 | 3 |
|
| 4 | + |
4 | 5 | # Utility function to read the README file.
|
5 | 6 | # Used for the long_description. It's nice, because now 1) we have a top level
|
6 | 7 | # README file and 2) it's easier to type in the README file than to put a raw
|
7 | 8 | # string in below ...
|
8 | 9 | def read(fname):
|
9 | 10 | return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
10 | 11 |
|
| 12 | +# get the version (don't import mne here, so dependencies are not needed) |
| 13 | +version = None |
| 14 | +with open(os.path.join('stormdb', '__init__.py'), 'r') as fid: |
| 15 | + for line in (line.strip() for line in fid): |
| 16 | + if line.startswith('__version__'): |
| 17 | + version = line.split('=')[1].strip().strip('\'') |
| 18 | + break |
| 19 | +if version is None: |
| 20 | + raise RuntimeError('Could not determine version') |
| 21 | + |
| 22 | + |
11 | 23 | class CleanCommand(Command):
|
12 | 24 | """Custom clean command to tidy up the project root."""
|
13 | 25 | user_options = []
|
| 26 | + |
14 | 27 | def initialize_options(self):
|
15 | 28 | pass
|
| 29 | + |
16 | 30 | def finalize_options(self):
|
17 | 31 | pass
|
| 32 | + |
18 | 33 | def run(self):
|
19 | 34 | os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')
|
20 | 35 |
|
21 | 36 | setup(
|
22 |
| - name = "stormdb", |
23 |
| - version = "0.5", |
24 |
| - author = "Christopher Bailey", |
25 |
| - author_email = "cjb@cfin.au.dk", |
26 |
| - description = ("Tools for accessing StormDb @ CFIN"), |
27 |
| - license = "BSD", |
28 |
| - keywords = "code", |
29 |
| - url = "https://github.com/meeg-cfin/stormdb-python.git", |
| 37 | + name="stormdb", |
| 38 | + version=version, |
| 39 | + author="Christopher Bailey", |
| 40 | + author_email="cjb@cfin.au.dk", |
| 41 | + description=("Tools for accessing StormDb @ CFIN"), |
| 42 | + license="BSD", |
| 43 | + keywords="code", |
| 44 | + url="https://github.com/meeg-cfin/stormdb-python.git", |
30 | 45 | packages=['stormdb'],
|
31 | 46 | scripts=['bin/submit_to_cluster'],
|
32 | 47 | long_description=read('README.md'),
|
|
0 commit comments