File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 11
11
from codecs import open
12
12
from os import path
13
13
14
- from metsrw import __version__
15
14
16
15
HERE = path .abspath (path .dirname (__file__ ))
17
16
18
17
19
18
# Get the long description from the relevant file
20
- with open (path .join (here , 'README.md' ), encoding = 'utf-8' ) as f :
19
+ with open (path .join (HERE , 'README.md' ), encoding = 'utf-8' ) as f :
21
20
long_description = f .read ()
22
21
23
22
23
+ def get_version ():
24
+ version = '0.1.0'
25
+ with open (path .join (HERE , 'metsrw' , '__init__.py' )) as fi :
26
+ for line in fi :
27
+ if line .startswith ('__version__' ):
28
+ parts = line .strip ().split ()
29
+ try :
30
+ version = parts [2 ].replace ("'" , '' ).replace ('"' , '' ).strip ()
31
+ except (IndexError , AttributeError ):
32
+ continue
33
+ return version
34
+
35
+
24
36
setup (
25
37
name = 'metsrw' ,
26
- version = __version__ ,
38
+ version = get_version () ,
27
39
28
40
description = 'Library for dealing with METS files.' ,
29
41
long_description = long_description ,
You can’t perform that action at this time.
0 commit comments