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
# Get the long description from the relevant file
19
- with open (path .join (here , 'README.md' ), encoding = 'utf-8' ) as f :
18
+ with open (path .join (HERE , 'README.md' ), encoding = 'utf-8' ) as f :
20
19
long_description = f .read ()
21
20
22
21
22
+ def get_version ():
23
+ version = '0.1.0'
24
+ with open (path .join (HERE , 'metsrw' , '__init__.py' )) as fi :
25
+ for line in fi :
26
+ if line .startswith ('__version__' ):
27
+ parts = line .strip ().split ()
28
+ try :
29
+ version = parts [2 ].replace ("'" , '' ).replace ('"' , '' ).strip ()
30
+ except (IndexError , AttributeError ):
31
+ continue
32
+ return version
33
+
34
+
23
35
setup (
24
36
name = 'metsrw' ,
25
- version = __version__ ,
37
+ version = get_version () ,
26
38
27
39
description = 'Library for dealing with METS files.' ,
28
40
long_description = long_description ,
You can’t perform that action at this time.
0 commit comments