File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 44
55
66module = 'pina'
7- meta_file = os .path .join (module , 'meta.py' )
87version_line = r'__version__.*=.*"(.+?)"'
8+ pyproject_file = 'pyproject.toml'
99
1010
1111class Version :
@@ -34,11 +34,11 @@ def __str__(self):
3434
3535
3636def get_version ():
37- with open (meta_file , 'r' ) as fp :
37+ with open (pyproject_file , 'r' ) as fp :
3838 content = fp .read ()
3939
4040 try :
41- found = re .search (r'__version__ .*=.*"(.+?)"' , content ).group (1 )
41+ found = re .search (r'version .*=.*"(.+?)"' , content ).group (1 )
4242 except AttributeError :
4343 pass
4444
@@ -48,13 +48,13 @@ def get_version():
4848
4949
5050def set_version (version ):
51- with open (meta_file , 'r' ) as fp :
51+ with open (pyproject_file , 'r' ) as fp :
5252 content = fp .read ()
5353
54- line_string = '__version__ = "{}"' .format (version )
55- text_after = re .sub ('__version__ .*=.*"(.+?)"' , line_string , content )
54+ line_string = 'version = "{}"' .format (version )
55+ text_after = re .sub ('version .*=.*"(.+?)"' , line_string , content )
5656
57- with open (meta_file , 'w' ) as fp :
57+ with open (pyproject_file , 'w' ) as fp :
5858 fp .write (text_after )
5959
6060
You can’t perform that action at this time.
0 commit comments