From 4ba11376c702013327b65a53c8fb0b33537dda87 Mon Sep 17 00:00:00 2001 From: Timo <35654063+tibue99@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:53:20 +0200 Subject: [PATCH] docs: generate docs with sphinx and furo (#2) * Add docs * Create .readthedocs.yaml * Add requirements * Add logo * Add errors to doc * Configure settings and add custom session * Add docs URL * Change dev status --- .pre-commit-config.yaml | 2 +- .readthedocs.yaml | 18 +++++++++++++ cookiebot/api.py | 12 ++++++--- cookiebot/errors.py | 14 ++++++++++ docs/Makefile | 20 ++++++++++++++ docs/_static/favicon.ico | Bin 0 -> 17954 bytes docs/_static/logo.png | Bin 0 -> 11760 bytes docs/conf.py | 54 ++++++++++++++++++++++++++++++++++++++ docs/cookiebot/api.rst | 6 +++++ docs/cookiebot/errors.rst | 6 +++++ docs/cookiebot/models.rst | 6 +++++ docs/index.rst | 12 +++++++++ docs/make.bat | 35 ++++++++++++++++++++++++ docs/requirements.txt | 7 +++++ pyproject.toml | 3 ++- 15 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 .readthedocs.yaml create mode 100644 docs/Makefile create mode 100644 docs/_static/favicon.ico create mode 100644 docs/_static/logo.png create mode 100644 docs/conf.py create mode 100644 docs/cookiebot/api.rst create mode 100644 docs/cookiebot/errors.rst create mode 100644 docs/cookiebot/models.rst create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/requirements.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11c9632..6be9728 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: rev: v1.10.0 hooks: - id: mypy - args: [--disable-error-code=union-attr] + args: [--disable-error-code=union-attr, --disable-error-code=import] - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..a8f7e64 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,18 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py + fail_on_warning: false + builder: html + +python: + install: + - requirements: docs/requirements.txt diff --git a/cookiebot/api.py b/cookiebot/api.py index 40720ab..2396b99 100644 --- a/cookiebot/api.py +++ b/cookiebot/api.py @@ -16,16 +16,18 @@ def _stats_dict(data: dict[str, int]) -> dict[date, int]: class CookieAPI: - """A class to interact with the Cookie Bot API. + """A class to interact with the CookieBot API. Parameters ---------- api_key: The API key to use. If no key is provided, ``COOKIE_KEY`` is loaded from the environment. + session: + An existing aiohttp session to use. """ - def __init__(self, api_key: str | None = None): - self._session: aiohttp.ClientSession | None = None + def __init__(self, api_key: str | None = None, session: aiohttp.ClientSession | None = None): + self._session: aiohttp.ClientSession | None = session if api_key is None: load_dotenv() @@ -48,6 +50,10 @@ async def _setup(self): self._session = aiohttp.ClientSession() async def close(self): + """Close the aiohttp session. When using the async context manager, + this is called automatically. + """ + await self._session.close() @overload diff --git a/cookiebot/errors.py b/cookiebot/errors.py index f993e64..e65c5fb 100644 --- a/cookiebot/errors.py +++ b/cookiebot/errors.py @@ -1,26 +1,40 @@ class CookieError(Exception): + """Base exception class for all CookieBot exceptions.""" + pass class InvalidAPIKey(CookieError): + """Raised when an invalid API key is provided or if no key was found + in the environment variables. + """ + def __init__(self, msg: str | None = None): super().__init__(msg or "Invalid API key.") class NotFound(CookieError): + """Raised when an object is not found.""" + pass class UserNotFound(NotFound): + """Raised when the given user ID is not found.""" + def __init__(self): super().__init__("Could not find the user ID.") class GuildNotFound(NotFound): + """Raised when the given guild ID is not found.""" + def __init__(self): super().__init__("Could not find the guild ID.") class NoGuildAccess(CookieError): + """Raised when you do not have access to a guild.""" + def __init__(self): super().__init__("You are not a member of this guild.") diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8ab299ac76957a3140415597d3fe056907b231e2 GIT binary patch literal 17954 zcmeI3dr(y88O9eDSU|bR9Z3N}4PMJA1i>5DAQkbF6p*5}v8ahg?P$CpMcF6{-bckt z5Rt}cjL}++W^B??>r|6TO#U%u;vdN{lX0S%jN@ozP?4w4d*It_6N`J+U0A03IzQe$ zd%o{|-{Fc=I;WF*-_?hI0m8^)x$nmMw+T9q8!sx}QAN)B!%7AW8rd-GTxQ&Q5 z^|ID3V>y#}kj}IKCO<&5+PWEoFgLym9}K&LizD#VTo~Sr(mwkU>K$#ZeLwU0bdu;O z=KW0R&59_(d+9gv@6m8L9}K^PoXDBf?V+@vVP3xu)*ZuqUyEKpV*twf9l(V#a5^PP z`{Cu`(;2!gdP97ous8KH{A(;ajE%`>;N$71bf4h3JNr8=ggL&D`3*D0;NbADaV`rT zPQ|ZJSfAV1u^wlcCj-mp2m#(9*f;zOoXtk3QQT*pnrpef8SNy|%SEq;!4s7!XYkMQ z=u|%ZZ3_m6j8?j@vNkUV>+ZvN_eJy6#O3&K0$hUHQCH#V;U&67vp;d9on|of?A8aT zCfvtACc-6HpMDl5qrWpWXNX>5^{~@8GX*X|Y3dPpdz#d-eU|k(a-NTi-hLq&c>hJX z1g|FVwmxq=T5l}%%6SoG>Bn(851r180Tr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26C`HuqsRD(Jh zDTMEoOP$X@kBC}TY6-Zu)VEAY7T&qt8g`pR7?%itil?kWwJVp$VTPVlx5Y+y#L_P{|mxq0&%ak zN_oW|DJ1Mj;9F!sZTa~nS=h(oJo=Wo{{YuApR;5Rk$~$2&&#|L8~?14$o(~`{zIfQ zs{5x>&4W-RVI(OLcXrok=8=4Qv<~GD<>m}5X+J@mB$O(@Lo@e-xhK%~ku>;Hvd{$J*L$!E#{release}" +html_logo = "_static/logo.png" +html_favicon = "_static/favicon.ico" diff --git a/docs/cookiebot/api.rst b/docs/cookiebot/api.rst new file mode 100644 index 0000000..13c5ef0 --- /dev/null +++ b/docs/cookiebot/api.rst @@ -0,0 +1,6 @@ +API +======================= + +.. autoclass:: cookiebot.CookieAPI + :members: + :undoc-members: diff --git a/docs/cookiebot/errors.rst b/docs/cookiebot/errors.rst new file mode 100644 index 0000000..6071daa --- /dev/null +++ b/docs/cookiebot/errors.rst @@ -0,0 +1,6 @@ +Errors +======================= + +.. automodule:: cookiebot.errors + :members: + :undoc-members: diff --git a/docs/cookiebot/models.rst b/docs/cookiebot/models.rst new file mode 100644 index 0000000..d3b5070 --- /dev/null +++ b/docs/cookiebot/models.rst @@ -0,0 +1,6 @@ +Models +======================= + +.. automodule:: cookiebot.models + :members: + :undoc-members: diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..ff489e4 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,12 @@ +.. include:: ../README.md + :parser: myst_parser.sphinx_ + + +.. toctree:: + :maxdepth: 2 + :hidden: + :caption: Contents: + + cookiebot/api + cookiebot/models + cookiebot/errors diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..954237b --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..f2391f7 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,7 @@ +sphinx +furo +sphinx-autodoc-typehints +sphinx-copybutton +myst-parser +aiohttp +python-dotenv diff --git a/pyproject.toml b/pyproject.toml index f3915e3..bd3b53c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ { name = "tibue99" }, { name="tobfd" } ] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Intended Audience :: Developers", "Operating System :: OS Independent", @@ -27,6 +27,7 @@ dependencies = {file = "requirements.txt"} [project.urls] GitHub = "https://github.com/tibue99/cookie-api" CookieBot = "https://cookie-bot.xyz" +Documentation = "https://cookiebot.readthedocs.io" [build-system] requires = ["setuptools>=61.0"]