12
12
#
13
13
14
14
import os
15
- import re
16
15
import sys
17
16
from os .path import dirname , join as pjoin
18
17
from setuptools import setup , find_packages , Command
19
18
from setuptools .command .test import test as TestCommand
20
19
21
20
22
- with open ( pjoin ( dirname ( __file__ ), 'icecream' , '__init__.py' )) as fo :
23
- regex = r".*__version__ = '(.*?)'"
24
- VERSION = re . compile ( regex , re . S ). match ( fo . read ()). group ( 1 )
21
+ meta = {}
22
+ with open ( pjoin ( 'icecream' , '__version__.py' )) as f :
23
+ exec ( f . read (), meta )
25
24
26
25
27
26
class Publish (Command ):
@@ -37,8 +36,8 @@ def finalize_options(self):
37
36
def run (self ):
38
37
os .system ('python setup.py sdist bdist_wheel' )
39
38
40
- sdist = 'dist/icecream-%s.tar.gz' % VERSION
41
- wheel = 'dist/icecream-%s-py2.py3-none-any.whl' % VERSION
39
+ sdist = 'dist/icecream-%s.tar.gz' % meta [ '__version__' ]
40
+ wheel = 'dist/icecream-%s-py2.py3-none-any.whl' % meta [ '__version__' ]
42
41
rc = os .system ('twine upload "%s" "%s"' % (sdist , wheel ))
43
42
44
43
sys .exit (rc )
@@ -67,15 +66,13 @@ def run_tests(self):
67
66
68
67
69
68
setup (
70
- name = 'icecream' ,
71
- license = 'MIT' ,
72
- version = VERSION ,
73
- author = 'Ansgar Grunseid' ,
74
- author_email = 'grunseid@gmail.com' ,
75
- url = 'https://github.com/gruns/icecream' ,
76
- description = (
77
- 'Inspect variables, expressions, and program execution with a '
78
- 'single, simple function call.' ),
69
+ name = meta ['__title__' ],
70
+ license = meta ['__license__' ],
71
+ version = meta ['__version__' ],
72
+ author = meta ['__author__' ],
73
+ author_email = meta ['__contact__' ],
74
+ url = meta ['__url__' ],
75
+ description = meta ['__description__' ],
79
76
long_description = (
80
77
'Information and documentation can be found at '
81
78
'https://github.com/gruns/icecream.' ),
0 commit comments