File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 50
50
# built documents.
51
51
#
52
52
# The short X.Y version.
53
- version = '0.7.0'
53
+ version = __import__ ( 'pytest_flask' ). __version__
54
54
# The full version, including alpha/beta/rc tags.
55
- release = '0.7.0'
55
+ release = __import__ ( 'pytest_flask' ). __version__
56
56
57
57
# The language for content autogenerated by Sphinx. Refer to documentation
58
58
# for a list of supported languages.
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
+
4
+ __version__ = "0.7.1"
Original file line number Diff line number Diff line change @@ -101,23 +101,31 @@ def app():
101
101
**suggestion**.
102
102
103
103
"""
104
+ import io
104
105
import os
105
- import codecs
106
+ import re
106
107
from setuptools import setup
107
108
from setuptools import find_packages
108
109
109
110
110
- version = "0.7.0"
111
-
112
-
113
111
def read (* parts ):
114
112
"""Reads the content of the file located at path created from *parts*."""
115
113
try :
116
- return codecs .open (os .path .join (* parts ), 'r' , encoding = 'utf-8' ).read ()
114
+ return io .open (os .path .join (* parts ), 'r' , encoding = 'utf-8' ).read ()
117
115
except IOError :
118
116
return ''
119
117
120
118
119
+ def get_version ():
120
+ version_file = read ('pytest_flask' , '__init__.py' )
121
+ version_match = re .search (r'^__version__ = [\'"]([^\'"]*)[\'"]' ,
122
+ version_file , re .MULTILINE )
123
+ if version_match :
124
+ return version_match .group (1 )
125
+ raise RuntimeError ('Unable to find version string.' )
126
+
127
+
128
+ version = get_version ()
121
129
requirements = read ('requirements' , 'main.txt' ).splitlines ()
122
130
tests_require = []
123
131
You can’t perform that action at this time.
0 commit comments