This repository was archived by the owner on Nov 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 33
33
34
34
__author__ = 'Ero Carrera'
35
35
__license__ = 'MIT'
36
+ __version__ = '1.0.1.dev0'
36
37
37
38
PY3 = not sys .version_info < (3 , 0 , 0 )
38
39
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
+ import ast
2
3
import os
4
+ import re
3
5
from codecs import open
4
6
5
7
from setuptools import setup
10
12
os .environ ['COPYFILE_DISABLE' ] = 'true'
11
13
12
14
15
+ CURRENT_DIR = os .path .dirname (__file__ )
16
+
17
+
18
+ def get_version ():
19
+ init_file = os .path .join (CURRENT_DIR , 'pydot_ng' , '__init__.py' )
20
+ _version_re = re .compile (r'__version__\s+=\s+(?P<version>.*)' )
21
+ with open (init_file , 'r' , encoding = 'utf8' ) as f :
22
+ match = _version_re .search (f .read ())
23
+ version = match .group ('version' ) if match is not None else '"unknown"'
24
+ return str (ast .literal_eval (version ))
25
+
26
+
13
27
with open ('README.rst' , 'r' , 'utf-8' ) as f :
14
28
readme = f .read ()
15
29
16
30
17
31
setup (
18
32
name = 'pydot_ng' ,
19
- version = '1.0.1.dev0' ,
33
+ version = get_version () ,
20
34
description = 'Python interface to Graphviz\' s Dot' ,
21
35
author = 'Ero Carrera' ,
22
36
author_email = 'ero@dkbza.org' ,
You can’t perform that action at this time.
0 commit comments