Skip to content

Commit 18b25c6

Browse files
authored
Fix Read The Docs build (#581)
1 parent 0b7a787 commit 18b25c6

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

docs/conf.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
# version is used.
3030
sys.path.insert(0, project_root)
3131

32-
from django.conf import settings
32+
from django.conf import settings # noqa
3333
settings.configure()
3434

35-
import django_mysql
35+
import django_mysql # noqa
3636

3737
# -- General configuration ---------------------------------------------
3838

@@ -68,9 +68,19 @@
6868
# the built documents.
6969
#
7070
# 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()
7282
# The full version, including alpha/beta/rc tags.
73-
release = django_mysql.__version__
83+
release = version
7484

7585
# The language for content autogenerated by Sphinx. Refer to documentation
7686
# for a list of supported languages.

0 commit comments

Comments
 (0)