Skip to content

Commit 8b76afb

Browse files
committed
fix: Fix sphinx documentation build and add support for readthedocs V2
- Upgrade Sphinx versions & sphinx_rtd_theme - Install optional dependencies for documentation build - Update .readthedocs.yml to V2 format - Use `html_css_files` to inject custom css in `conf.py`
1 parent a4c5746 commit 8b76afb

File tree

5 files changed

+36
-17
lines changed

5 files changed

+36
-17
lines changed

.readthedocs.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
version: 2
2+
3+
formats: all
4+
15
build:
2-
image: latest
6+
os: ubuntu-22.04
7+
tools:
8+
python: "3.7"
9+
10+
sphinx:
11+
configuration: docs/conf.py
12+
313
python:
4-
version: 3.7
5-
pip_install: true
6-
extra_requirements:
7-
- docs
14+
install:
15+
- requirements: docs/requirements.txt
16+
- method: pip
17+
path: .
18+
extra_requirements:
19+
- async
20+
- extra
21+
- ciso

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ This release introduces a support for new version of InfluxDB API definitions wi
3030
1. [#583](https://github.com/influxdata/influxdb-client-python/pull/583): Async HTTP client doesn't always use `HTTP_PROXY`/`HTTPS_PROXY` environment variables. [async/await]
3131
1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN`
3232

33+
### Documentation
34+
1. [#566](https://github.com/influxdata/influxdb-client-python/pull/566): Fix Sphinx documentation build and add support `.readthedocs.yml` V2 configuration file
35+
3336
## 1.36.1 [2023-02-23]
3437

3538
### Bug Fixes

README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ If your application uses async/await in Python you can install with the ``async`
125125

126126
$ pip install influxdb-client[async]
127127

128-
For more info se `How to use Asyncio`_.
128+
For more info see `How to use Asyncio`.
129129

130130
Setuptools
131131
^^^^^^^^^^
@@ -208,7 +208,7 @@ The following options are supported:
208208
209209
self.client = InfluxDBClient.from_config_file("config.ini")
210210
211-
.. code-block::
211+
.. code-block:: ini
212212
213213
[influx2]
214214
url=http://localhost:8086
@@ -278,7 +278,7 @@ Example how to enable profilers using API:
278278
279279
Example of a profiler output:
280280

281-
.. code-block::
281+
.. code-block:: text
282282
283283
===============
284284
Profiler: query
@@ -374,7 +374,7 @@ Example how to use profilers with callback:
374374
375375
Example output of this callback:
376376

377-
.. code-block::
377+
.. code-block:: text
378378
379379
Custom processing of profiler result: {'result': '_profiler', 'table': 0, '_measurement': 'profiler/query', 'TotalDuration': 18843792, 'CompileDuration': 1078666, 'QueueDuration': 93375, 'PlanDuration': 0, 'RequeueDuration': 0, 'ExecuteDuration': 17371000, 'Concurrency': 0, 'MaxAllocated': 448, 'TotalAllocated': 0, 'RuntimeErrors': None, 'flux/query-plan': 'digraph {\r\n ReadRange2\r\n generated_yield\r\n\r\n ReadRange2 -> generated_yield\r\n}\r\n\r\n', 'influxdb/scanned-bytes': 0, 'influxdb/scanned-values': 0}
380380
Custom processing of profiler result: {'result': '_profiler', 'table': 1, '_measurement': 'profiler/operator', 'Type': '*influxdb.readFilterSource', 'Label': 'ReadRange2', 'Count': 1, 'MinDuration': 3274084, 'MaxDuration': 3274084, 'DurationSum': 3274084, 'MeanDuration': 3274084.0}
@@ -773,7 +773,7 @@ The ``client`` is able to retrieve data in `Pandas DataFrame <https://pandas.pyd
773773
774774
Output:
775775

776-
.. code-block::
776+
.. code-block:: text
777777
778778
result table location temperature
779779
0 _result 0 New York 24.3

docs/conf.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
exec('\n'.join(l for l in f if l.startswith('VERSION')), meta)
2727

2828

29-
def setup(app):
30-
app.add_stylesheet('custom.css')
31-
32-
3329
project = 'influxdb_client'
3430
copyright = '2022 InfluxData, Inc'
3531
author = 'Robert Hajek, Jakub Bednar'
@@ -57,7 +53,8 @@ def setup(app):
5753
'sphinx.ext.coverage',
5854
'sphinx.ext.mathjax',
5955
'sphinx.ext.todo',
60-
'sphinx.ext.viewcode'
56+
'sphinx.ext.viewcode',
57+
'sphinx_rtd_theme',
6158
# 'sphinx_autodoc_typehints'
6259
]
6360

@@ -78,7 +75,7 @@ def setup(app):
7875
#
7976
# This is also used if you do content translation via gettext catalogs.
8077
# Usually you set "language" from the command line for these cases.
81-
language = None
78+
language = "en"
8279

8380
# List of patterns, relative to source directory, that match files and
8481
# directories to ignore when looking for source files.
@@ -101,6 +98,10 @@ def setup(app):
10198
#
10299
# html_theme_options = {}
103100

101+
html_css_files = [
102+
'custom.css',
103+
]
104+
104105
# Add any paths that contain custom static files (such as style sheets) here,
105106
# relative to this directory. They are copied after the builtin static files,
106107
# so a file named "default.css" will overwrite the builtin "default.css".

docs/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
docutils < 0.18
1+
sphinx>=5.0.0
2+
sphinx_rtd_theme==1.1.0

0 commit comments

Comments
 (0)