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: setup pdoc3 #195

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ e2e: $(VENV)
source $(VENV)/bin/activate
$(PYTEST_CMD) e2e

.PHONY: docs
docs: $(VENV)
source $(VENV)/bin/activate
pdoc3 --html --force --output-dir docs pyzabbix

.PHONY: docs
docs-watch: $(VENV)
source $(VENV)/bin/activate
pdoc3 --http :8081 pyzabbix

build: $(VENV)
source $(VENV)/bin/activate
python -m build .
Expand Down
27 changes: 14 additions & 13 deletions pyzabbix/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=wrong-import-order
# pylint: disable=wrong-import-order,line-too-long

import logging
from typing import Mapping, Optional, Sequence, Tuple, Union
Expand All @@ -21,18 +21,19 @@


class ZabbixAPIException(Exception):
"""Generic Zabbix API exception

Codes:
-32700: invalid JSON. An error occurred on the server while
parsing the JSON text (typo, wrong quotes, etc.)
-32600: received JSON is not a valid JSON-RPC Request
-32601: requested remote-procedure does not exist
-32602: invalid method parameters
-32603: Internal JSON-RPC error
-32400: System error
-32300: Transport error
-32500: Application error
"""Zabbix API Exception

Codes are based on the [jsonrpc specification](https://www.jsonrpc.org/specification#error_object).

- `-32700` `Parse error`: Invalid JSON was received by the server.
- `-32600` `Invalid Request`: The JSON sent is not a valid Request object.
- `-32601` `Method not found`: The method does not exist / is not available.
- `-32602` `Invalid params`: Invalid method parameter(s).
- `-32603` `Internal error`: Internal JSON-RPC error.
- `-32000` to `-32099` `Server error`: Reserved for implementation-defined server-errors.
- `-32400` `System error`
- `-32300` `Transport error`
- `-32500` `Application error`
"""

def __init__(self, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"black",
"isort",
"mypy",
"pdoc3",
"pylint",
"pytest-cov",
"pytest-xdist",
Expand Down