File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020# Source package
2121_source_package = 'dice_notation/'
2222
23- # Regular expression for the version
24- _version_re = re .compile (r'__version__\s+=\s+(.*)' )
25-
2623# Test requirements
2724_tests_require = ['tox' ]
2825
@@ -36,19 +33,24 @@ def read(*names, **kwargs):
3633
3734
3835# Gets the version for the source folder __init__.py file
39- with open (_source_package + '__init__.py' , 'rb' , encoding = 'utf-8' ) as f :
40- version_lib = f .read ()
41- version_lib = _version_re .search (version_lib ).group (1 )
42- version_lib = str (ast .literal_eval (version_lib .rstrip ()))
36+ def read_version (path ):
37+ # Regular expression for the version
38+ _version_re = re .compile (r'__version__\s+=\s+(.*)' )
39+
40+ with open (path + '__init__.py' , 'rb' , encoding = 'utf-8' ) as f :
41+ version_lib = f .read ()
42+ version_lib = _version_re .search (version_lib ).group (1 )
43+ version_lib = str (ast .literal_eval (version_lib .rstrip ()))
4344
45+ return version_lib
4446
4547setup (
4648 name = 'dice-notation' ,
4749 packages = find_packages (),
4850 include_package_data = True ,
4951 package_data = {
5052 },
51- version = version_lib ,
53+ version = read_version ( _source_package ) ,
5254 description = 'Dice notation tools' ,
5355 author = 'Bernardo Martínez Garrido' ,
5456 author_email = 'programming@bernardomg.com' ,
You can’t perform that action at this time.
0 commit comments