Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Generate documentation for constructor parameters #900

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,10 @@ ReadtheDocs.org. When a push is detected by readthedocs.org, they automatically
and republish the docs. ReadtheDocs is also version aware, so it retains prior and unreleased
versions of the docs for us.

To build the docs:
To build the docs and live-reload them locally:

```bash
# Build docs
nox -rs docs

# Open in the local browser:
open build/index.html
nox -rs docs-serve
```

Sphinx will automatically generate class stubs, so be sure to `git add` them.
Expand Down
1 change: 1 addition & 0 deletions docs/_templates/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

.. autoclass:: {{ name }}
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.BatchSink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: BatchSink
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.GraphQLStream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: GraphQLStream
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.InlineMapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: InlineMapper
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.RESTStream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: RESTStream
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.RecordSink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: RecordSink
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.SQLConnector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: SQLConnector
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.SQLSink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: SQLSink
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.SQLStream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: SQLStream
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.SQLTap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: SQLTap
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.SQLTarget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: SQLTarget
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.Sink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: Sink
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.Stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: Stream
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.Tap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: Tap
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.Target.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk

.. autoclass:: Target
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: APIKeyAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: BasicAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: BearerTokenAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: OAuthAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: OAuthJWTAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.authenticators

.. autoclass:: SimpleAuthenticator
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: ConfigValidationError
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.exceptions.FatalAPIError.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: FatalAPIError
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: InvalidStreamSortException
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.exceptions.MapExpressionError.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: MapExpressionError
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: MaxRecordsLimitException
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: RecordsWitoutSchemaException
:members:
:members:
:special-members: __init__
3 changes: 2 additions & 1 deletion docs/classes/singer_sdk.exceptions.RetriableAPIError.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: RetriableAPIError
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: StreamMapConfigError
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: TapStreamConnectionFailure
:members:
:members:
:special-members: __init__
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.. currentmodule:: singer_sdk.exceptions

.. autoclass:: TooManyRecordsException
:members:
:members:
:special-members: __init__
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Show typehints in the signature
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_typehints
# Show typehints in the description, along with parameter descriptions
autodoc_typehints = "signature"
autodoc_class_signature = "separated"

# -- Options for HTML output -------------------------------------------------

Expand Down
22 changes: 22 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,25 @@ def docs(session: Session) -> None:
shutil.rmtree(build_dir)

session.run("sphinx-build", *args)


@session(name="docs-serve", python=main_python_version)
def docs_serve(session: Session) -> None:
"""Build the documentation."""
args = session.posargs or [
"--open-browser",
"--watch",
".",
"--ignore",
"**/.nox/*",
"docs",
"build",
"-W",
]
session.install(".[docs]")

build_dir = Path("build")
if build_dir.exists():
shutil.rmtree(build_dir)

session.run("sphinx-autobuild", *args)
Loading