Skip to content

Commit 5623549

Browse files
authored
Use read the docs v2 config (fsspec#697)
* Use read the docs v2 config * Fix sphinx build errors * Pin docutils to render bullets in changelog correctly * Fix display of colons in function arguments [skip ci] * Temporarily allow doc build warnings * Switch from numpydoc to napoleon
1 parent 7bf10b8 commit 5623549

9 files changed

+45
-27
lines changed

.readthedocs.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: miniconda3-4.7
7+
8+
conda:
9+
environment: docs/environment.yml
10+
11+
python:
12+
install:
13+
- method: pip
14+
path: .
15+
16+
sphinx:
17+
configuration: docs/source/conf.py
18+
fail_on_warning: true

docs/environment.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: s3fs
2+
channels:
3+
- defaults
4+
dependencies:
5+
- python= 3.9
6+
- botocore
7+
- docutils<0.17
8+
- sphinx
9+
- sphinx_rtd_theme

docs/requirements.txt

-5
This file was deleted.

docs/source/_static/custom.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.classifier:before {
2+
font-style: normal;
3+
margin: 0.5em;
4+
content: ":";
5+
}

docs/source/api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ API
4141

4242
.. autoclass:: S3FileSystem
4343
:members:
44+
:inherited-members:
4445

4546
.. autoclass:: S3File
4647
:members:
48+
:inherited-members:
4749

4850
.. currentmodule:: s3fs.mapping
4951

docs/source/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Version 0.4.0
183183
- Miscellaneous doc updates (:pr:`252`) by `James Bourbeau`_
184184
- Support for Python 3.8 (:pr:`264`) by `Tom Augspurger`_
185185
- Improved performance for ``isdir`` (:pr:`259`) by `Nate Yoder`_
186-
* Increased the minimum required version of fsspec to 0.6.0
186+
- Increased the minimum required version of fsspec to 0.6.0
187187

188188
.. _`Martin Durant`: https://github.com/martindurant
189189
.. _`Marius van Niekerk`: https://github.com/mariusvniekerk

docs/source/conf.py

+8-18
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16-
import sys
1716
import os
1817

1918
# If extensions (or modules to document with autodoc) are in another directory,
@@ -36,7 +35,7 @@
3635
'sphinx.ext.viewcode',
3736
'sphinx.ext.autosummary',
3837
'sphinx.ext.extlinks',
39-
'numpydoc',
38+
'sphinx.ext.napoleon',
4039
]
4140

4241
# Add any paths that contain templates here, relative to this directory.
@@ -68,13 +67,6 @@
6867
# The full version, including alpha/beta/rc tags.
6968
release = version
7069

71-
# The language for content autogenerated by Sphinx. Refer to documentation
72-
# for a list of supported languages.
73-
#
74-
# This is also used if you do content translation via gettext catalogs.
75-
# Usually you set "language" from the command line for these cases.
76-
language = None
77-
7870
# There are two options for replacing |today|: either, you set today to some
7971
# non-false value, then it is used:
8072
#today = ''
@@ -113,20 +105,13 @@
113105
todo_include_todos = False
114106

115107
extlinks = {
116-
"pr": ("https://github.com/fsspec/s3fs/pull/%s", "PR #"),
108+
"pr": ("https://github.com/fsspec/s3fs/pull/%s", "PR #%s"),
117109
}
118110

119111

120112
# -- Options for HTML output ----------------------------------------------
121113

122-
# Taken from docs.readthedocs.io:
123-
# on_rtd is whether we are on readthedocs.io
124-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
125-
126-
if not on_rtd: # only import and set the theme if we're building docs locally
127-
import sphinx_rtd_theme
128-
html_theme = 'sphinx_rtd_theme'
129-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
114+
html_theme = 'sphinx_rtd_theme'
130115

131116
# Theme options are theme-specific and customize the look and feel of a theme
132117
# further. For a list of options available for each theme, see the
@@ -157,6 +142,10 @@
157142
# so a file named "default.css" will overwrite the builtin "default.css".
158143
html_static_path = ['_static']
159144

145+
# Custom CSS file to override read the docs default CSS.
146+
# Contains workaround for issue #790.
147+
html_css_files = ["custom.css"]
148+
160149
# Add any extra paths that contain custom files (such as robots.txt or
161150
# .htaccess) here, relative to this directory. These files are copied
162151
# directly to the root of the documentation.
@@ -278,6 +267,7 @@
278267
#man_show_urls = False
279268

280269

270+
281271
# -- Options for Texinfo output -------------------------------------------
282272

283273
# Grouping the document tree into Texinfo files. List of tuples

docs/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Contents
333333

334334
.. toctree::
335335
install
336+
development
336337
api
337338
changelog
338339
:maxdepth: 2

s3fs/core.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1501,9 +1501,7 @@ async def _setxattr(self, path, copy_kwargs=None, **kw_args):
15011501
>>> mys3file.setxattr(copy_kwargs={'ContentType': 'application/pdf'},
15021502
... attribute_1='value1') # doctest: +SKIP
15031503
1504-
1505-
.. Metadata Reference:
1506-
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-metadata
1504+
.. _Metadata Reference: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-metadata
15071505
"""
15081506

15091507
kw_args = {k.replace("_", "-"): v for k, v in kw_args.items()}

0 commit comments

Comments
 (0)