Skip to content

Commit c8a3501

Browse files
authored
fix: Fix sphinx documentation build and add support for readthedocs V2 (#566)
- 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 0bda3e3 commit c8a3501

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
@@ -33,6 +33,9 @@ This release introduces a support for new version of InfluxDB API definitions wi
3333
1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN`
3434
1. [#595](https://github.com/influxdata/influxdb-client-python/pull/595): The `Config-Encoding: identity` header will no longer be set by the `write_api` calls to a remote server
3535

36+
### Documentation
37+
1. [#566](https://github.com/influxdata/influxdb-client-python/pull/566): Fix Sphinx documentation build and add support `.readthedocs.yml` V2 configuration file
38+
3639
## 1.36.1 [2023-02-23]
3740

3841
### Bug Fixes

README.rst

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

127127
$ pip install influxdb-client[async]
128128

129-
For more info se `How to use Asyncio`_.
129+
For more info see `How to use Asyncio`.
130130

131131
Setuptools
132132
^^^^^^^^^^
@@ -209,7 +209,7 @@ The following options are supported:
209209
210210
self.client = InfluxDBClient.from_config_file("config.ini")
211211
212-
.. code-block::
212+
.. code-block:: ini
213213
214214
[influx2]
215215
url=http://localhost:8086
@@ -279,7 +279,7 @@ Example how to enable profilers using API:
279279
280280
Example of a profiler output:
281281

282-
.. code-block::
282+
.. code-block:: text
283283
284284
===============
285285
Profiler: query
@@ -375,7 +375,7 @@ Example how to use profilers with callback:
375375
376376
Example output of this callback:
377377

378-
.. code-block::
378+
.. code-block:: text
379379
380380
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}
381381
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}
@@ -774,7 +774,7 @@ The ``client`` is able to retrieve data in `Pandas DataFrame <https://pandas.pyd
774774
775775
Output:
776776

777-
.. code-block::
777+
.. code-block:: text
778778
779779
result table location temperature
780780
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)