File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 29
29
# version is used.
30
30
sys .path .insert (0 , project_root )
31
31
32
- from django .conf import settings
32
+ from django .conf import settings # noqa
33
33
settings .configure ()
34
34
35
- import django_mysql
35
+ import django_mysql # noqa
36
36
37
37
# -- General configuration ---------------------------------------------
38
38
68
68
# the built documents.
69
69
#
70
70
# The short X.Y version.
71
- version = django_mysql .__version__
71
+
72
+
73
+ def _get_version ():
74
+ with open (os .path .join (project_root , 'setup.cfg' ), 'r' ) as setup_fp :
75
+ version_lines = [line .strip () for line in setup_fp if line .startswith ("version = " )]
76
+
77
+ assert len (version_lines ) == 1
78
+ return version_lines [0 ].split (' = ' )[1 ]
79
+
80
+
81
+ version = _get_version ()
72
82
# The full version, including alpha/beta/rc tags.
73
- release = django_mysql . __version__
83
+ release = version
74
84
75
85
# The language for content autogenerated by Sphinx. Refer to documentation
76
86
# for a list of supported languages.
You can’t perform that action at this time.
0 commit comments