Skip to content

Commit

Permalink
Add Docs Linter; Add .readthedoc Config File; Update Docs (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai authored Mar 28, 2024
1 parent 7757898 commit 394e87a
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2
build:
os: ubuntu-lts-latest
tools:
python: latest
sphinx:
configuration: docs/conf.py
python:
install:
- method: pip
path: .
extra_requirements:
- doc
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ lint:
$(PYTHON) -m autoflake --check linode_metadata test
$(PYTHON) -m black --check --verbose linode_metadata test
$(PYTHON) -m pylint linode_metadata
sphinx-lint docs

.PHONY: black
black:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Linode Metadata Client for Python

[![Unit Tests](https://github.com/linode/py-metadata/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/linode/py-metadata/actions/workflows/unit-tests.yml)
[![E2E Tests](https://github.com/linode/py-metadata/actions/workflows/e2e-suite.yml/badge.svg?branch=main)](https://github.com/linode/py-metadata/actions/workflows/e2e-suite.yml)
[![PyPI version](https://badge.fury.io/py/linode-metadata.svg)](https://badge.fury.io/py/linode-metadata)
[![Documentation Status](https://readthedocs.org/projects/linode-metadata/badge/?version=latest)](https://linode-metadata.readthedocs.io/en/latest/?badge=latest)

This package allows Python projects to easily interact with the [Linode Metadata Service](https://www.linode.com/docs/products/compute/compute-instances/guides/metadata/?tabs=linode-api).

## Getting Started
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@

html_theme = 'alabaster'
html_static_path = ['_static']

autoclass_content = 'both'
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Table of Contents
:maxdepth: 2

linode_metadata/metadata_client
linode_metadata/watcher
linode_metadata/objects/instance
linode_metadata/objects/networking
linode_metadata/objects/ssh_keys
Expand Down
9 changes: 6 additions & 3 deletions docs/linode_metadata/metadata_client.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Metadata Client Object
Metadata Clients
======================

.. autoclass:: linode_metadata.MetadataClient
:members:
.. autoclass:: linode_metadata.metadata_client.MetadataClient
:members:

.. autoclass:: linode_metadata.metadata_client.AsyncMetadataClient
:members:
2 changes: 1 addition & 1 deletion docs/linode_metadata/objects/error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Error Objects

.. automodule:: linode_metadata.objects.error
:members:
:undoc-members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/linode_metadata/objects/instance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Instance Objects

.. automodule:: linode_metadata.objects.instance
:members:
:undoc-members:
:undoc-members:
4 changes: 2 additions & 2 deletions docs/linode_metadata/objects/networking.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Networking Objects
================
==================

.. automodule:: linode_metadata.objects.networking
:members:
:undoc-members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/linode_metadata/objects/ssh_keys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ SSH Key Objects

.. automodule:: linode_metadata.objects.ssh_keys
:members:
:undoc-members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/linode_metadata/objects/token.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Token Object

.. automodule:: linode_metadata.objects.token
:members:
:undoc-members:
:undoc-members:
8 changes: 8 additions & 0 deletions docs/linode_metadata/watcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Metadata Watchers
======================

.. autoclass:: linode_metadata.watcher.MetadataWatcher
:members:

.. autoclass:: linode_metadata.watcher.AsyncMetadataWatcher
:members:
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ dependencies = ["httpx"]
dynamic = ["version"]

[project.optional-dependencies]
dev = ["pytest", "black", "isort", "pylint", "autoflake", "Sphinx>=7.2.6", "pytest-asyncio"]
dev = [
"pytest",
"black",
"isort",
"pylint",
"autoflake",
"Sphinx>=7.2.6",
"pytest-asyncio",
"sphinx-lint",
]

doc = ["Sphinx>=7.2.6"]

[project.urls]
homepage = "https://github.com/linode/py-metadata"
Expand Down

0 comments on commit 394e87a

Please sign in to comment.