Skip to content

Commit 7a12973

Browse files
authored
fix: building sphinx docs (#275)
* feat: add check for sphinx docs
1 parent dc88ee9 commit 7a12973

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.circleci/config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,21 @@ jobs:
125125
export PYTHONPATH="$PWD"
126126
python examples/monitoring_and_alerting.py
127127
python examples/buckets_management.py
128+
check-sphinx:
129+
docker:
130+
- image: *default-python
131+
environment:
132+
PIPENV_VENV_IN_PROJECT: true
133+
steps:
134+
- checkout
135+
- run:
136+
name: Checks that sphinx docs are successfully generated
137+
command: |
138+
pip install -e . --user
139+
pip install sphinx==1.8.5 --user
140+
pip install sphinx_rtd_theme --user
141+
cd docs
142+
python -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
128143
check-aws-lambda-layer:
129144
docker:
130145
- image: docker:19
@@ -147,6 +162,7 @@ workflows:
147162
- check-docstyle
148163
- check-twine
149164
- check-examples
165+
- check-sphinx
150166
- tests-python:
151167
name: test-3.6
152168
- tests-python:
File renamed without changes.

docs/conf.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
from pathlib import Path
2323

2424
meta = {}
25-
with open(Path(__file__).parent.parent / 'influxdb_client' / '__init__.py') as f:
26-
exec('\n'.join(l for l in f if l.startswith('__')), meta)
25+
with open(Path(__file__).parent.parent / 'influxdb_client' / 'version.py') as f:
26+
exec('\n'.join(l for l in f if l.startswith('CLIENT_VERSION')), meta)
2727

2828

2929
def setup(app):
@@ -37,9 +37,9 @@ def setup(app):
3737
autoclass_content = 'both'
3838

3939
# The short X.Y version
40-
version = meta['__version__']
40+
version = meta['CLIENT_VERSION']
4141
# The full version, including alpha/beta/rc tags
42-
release = meta['__version__']
42+
release = meta['CLIENT_VERSION']
4343

4444
# -- General configuration ---------------------------------------------------
4545

0 commit comments

Comments
 (0)