File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 66
77import re
88import sys
9- from os .path import abspath , join
9+ from os .path import abspath , dirname , join
1010from distutils .core import setup
1111
1212
13+ SETUP_PY_DIR = dirname (abspath (__file__ ))
14+
1315# read version from constructor/__init__.py
14- pat = re .compile (r'__version__\s*=\s*(\S+)' , re .M )
15- data = open (join ('constructor' , '__init__.py' )).read ()
16- version = eval (pat .search (data ).group (1 ))
16+ data = open (join (SETUP_PY_DIR , "constructor" , "__init__.py" )).read ()
17+ version = re .search (r"^__version__\s*=\s*(['\"])(\S*)\1" , data , re .M ).group (2 )
1718
1819setup (
1920 name = "constructor" ,
2324 url = "https://github.com/conda/constructor" ,
2425 license = "BSD" ,
2526 description = "create installer from conda packages" ,
26- long_description = open ('README.md' ).read (),
27+ long_description = open (join ( SETUP_PY_DIR , 'README.md' ) ).read (),
2728 packages = ['constructor' , 'constructor.tests' ],
2829 scripts = ['bin/constructor' ],
2930)
You can’t perform that action at this time.
0 commit comments