File tree 3 files changed +20
-2
lines changed
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
- name : CI
1
+ name : Python CI
2
2
on :
3
3
push :
4
4
branches :
Original file line number Diff line number Diff line change 2
2
3
3
import os
4
4
import os .path
5
+ import re
5
6
6
7
from setuptools import setup
7
8
@@ -49,6 +50,21 @@ def load_requirements(*requirements_paths):
49
50
return list (requirements )
50
51
51
52
53
+ def get_version (* file_paths ):
54
+ """
55
+ Extract the version string from the file at the given relative path fragments.
56
+ """
57
+ filename = os .path .join (os .path .dirname (__file__ ), * file_paths )
58
+ with open (filename , encoding = 'utf-8' ) as opened_file :
59
+ version_file = opened_file .read ()
60
+ version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" ,
61
+ version_file , re .M )
62
+ if version_match :
63
+ return version_match .group (1 )
64
+ raise RuntimeError ('Unable to find version string.' )
65
+
66
+
67
+ VERSION = get_version ("workbench" , "__init__.py" )
52
68
package_data = {} # pylint: disable=invalid-name
53
69
package_data .update (find_package_data ("sample_xblocks.basic" , ["public" , "templates" ]))
54
70
package_data .update (find_package_data ("sample_xblocks.thumbs" , ["static" ]))
@@ -57,7 +73,7 @@ def load_requirements(*requirements_paths):
57
73
58
74
setup (
59
75
name = 'xblock-sdk' ,
60
- version = '0.4.0' ,
76
+ version = VERSION ,
61
77
description = 'XBlock SDK' ,
62
78
packages = [
63
79
'sample_xblocks' ,
Original file line number Diff line number Diff line change 1
1
"""
2
2
Provide a djangoapp for XBlock development
3
3
"""
4
+
5
+ __version__ = '0.4.0'
You can’t perform that action at this time.
0 commit comments