From 39369a65d64658923a6f9cce0bd7796e0682ef64 Mon Sep 17 00:00:00 2001 From: Joscha Dierks Date: Fri, 14 Mar 2025 16:53:44 +0100 Subject: [PATCH 1/5] feat/OPS-61: add basic documentation It currently works only for haiku.py for some reason --- .dockerignore | 2 +- .gitignore | 2 +- docs/Makefile | 20 ++++++++++++++ docs/make.bat | 35 +++++++++++++++++++++++++ docs/source/_modules/haiku.rst | 7 +++++ docs/source/_modules/main.rst | 7 +++++ docs/source/_modules/modules.rst | 9 +++++++ docs/source/_modules/store_manager.rst | 7 +++++ docs/source/_static/kanji.png | Bin 0 -> 2386 bytes docs/source/conf.py | 35 +++++++++++++++++++++++++ docs/source/index.rst | 19 ++++++++++++++ docs/source/usage.rst | 4 +++ {docs => requirements}/requirements.md | 0 13 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/_modules/haiku.rst create mode 100644 docs/source/_modules/main.rst create mode 100644 docs/source/_modules/modules.rst create mode 100644 docs/source/_modules/store_manager.rst create mode 100644 docs/source/_static/kanji.png create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst create mode 100644 docs/source/usage.rst rename {docs => requirements}/requirements.md (100%) diff --git a/.dockerignore b/.dockerignore index 1513c39..0d78105 100644 --- a/.dockerignore +++ b/.dockerignore @@ -68,7 +68,7 @@ coverage.xml *.log # Sphinx documentation -docs/_build/ +requirements/_build/ # PyBuilder target/ diff --git a/.gitignore b/.gitignore index a1db2f1..ed76ffc 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,7 @@ instance/ .scrapy # Sphinx documentation -docs/_build/ +requirements/_build/ # PyBuilder .pybuilder/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d0c3cbf --- /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 = source +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/make.bat b/docs/make.bat new file mode 100644 index 0000000..dc1312a --- /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=source +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/source/_modules/haiku.rst b/docs/source/_modules/haiku.rst new file mode 100644 index 0000000..6e6e926 --- /dev/null +++ b/docs/source/_modules/haiku.rst @@ -0,0 +1,7 @@ +haiku module +============ + +.. automodule:: haiku + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/_modules/main.rst b/docs/source/_modules/main.rst new file mode 100644 index 0000000..eace87b --- /dev/null +++ b/docs/source/_modules/main.rst @@ -0,0 +1,7 @@ +main module +=========== + +.. automodule:: main + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/_modules/modules.rst b/docs/source/_modules/modules.rst new file mode 100644 index 0000000..d024233 --- /dev/null +++ b/docs/source/_modules/modules.rst @@ -0,0 +1,9 @@ +senju +===== + +.. toctree:: + :maxdepth: 4 + + haiku + main + store_manager diff --git a/docs/source/_modules/store_manager.rst b/docs/source/_modules/store_manager.rst new file mode 100644 index 0000000..aa5fa7f --- /dev/null +++ b/docs/source/_modules/store_manager.rst @@ -0,0 +1,7 @@ +store\_manager module +===================== + +.. automodule:: store_manager + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/_static/kanji.png b/docs/source/_static/kanji.png new file mode 100644 index 0000000000000000000000000000000000000000..345f5a566d7fddd89a42ab6af12e6ad3903c725f GIT binary patch literal 2386 zcmV-Y39a^tP)Yn!ql5Qft&vusm4Y_)A=hi(7=KYYs* zBZ7d^8{@_EaTk<3ki#$xgMpQmm6es1m6es1m6es1m6es1m6cUT`LpQVMR>7B&T01U zGQ3s`$8qMPcbDRoT02i|XW_dG@-jKOh9jx(F%+fp?u(rtYbcm5`A(_zNTMG7;p#97 zVm_yv{#?^@;x;7upGq8{rMS<@ev!*{l6$|(vZ<=p^RBEO58iItw!@Jw)AX-;`?@1!;`vBp6QEQ@u3gHV1tgK3nOl8I|l4HnD zU>M;{{sYW~jc@}ArKTX*2!ao4Gm&<~Ta0mz&a#?T@MzE2( za(QqO!m;8mnFkjkoU*Z|CoG{NgpKqjyBo_h-S*Vv4~mXn&%Rwto% zN|TLW(Ne=tQ9*gqNEj@Ogo#=iWCSe1irZiM2%|AcDP@dS5*Z974N#@D5eCpmLV=L~lgiPqotjk4!2|ON7j;5M?Q=AoFy7Vy_iD!w3@7}n@y*YQeT~_K@w|$+9PN~CTxJs< zs0viDs2}}`9bGXBp{U-M@a2M!D%3@e9oGkv%2Q;Y4wY4L|{ggSQDqPxS; zsbx!z_gVgBX%=lDJl>}QZG;YSfN;Zk2BQX_nzutNOc%tZ;yA7<)o}DG-XE zR*^d2V37H!ZmNGYU_8{ObNU|IBcVrxSwDKB=L-EH%-oExwf?C;gz2((Q}2L#Lzr6E zSOYzBA$+z`b|8qJ5QaDIS&^O)4t6u%TBI+8e03w-^`3BM3DFZCdQUj% zJ>jPJgwx&=Ud!AZ%NTaThkg;fo-mAl$RX?@=bVNb zp_h(6iQbDD+7U)S$qEFrcnpV}QYjGz`QW2BE`~B;@O7MC99q1{L@IGG6=C zWs>gDg5!(aXql3P{=EJcT~V=Egpr&4t~qp%wQiEX7|cq!KQ|!!Y!DMr(`6AX!XNhg zQmx5_GT?L{w|DOp7eghIsv6;d6ENnn3WU>75Nnb9_>P2aJWiwt8F!UDG)yY*i%C1? zm@v8%sz&CLCX5)qW_S9ID^Pg;5pa-buC8w#(M{NWDP4*C-(78z0hUhup$iZO>e9f+ zBLqgYrw**&lK3TF_>VVt1q>>2&E8uDWp4=oZ7yNioo;yUWnipmm|q!8m{%el9gB#x z-@ zI^epGMvH^dgyESV5-tSWYK`^=qX{3YHf}DkVbL75)^I|;rm_XcN(ib@5O)bFA&4D) z6IlI_5&|25D0VbbLShu=FMV_2Bm@Dpgr`1G5`r*x;;=**2}5G(-iz%-7zx3AP2$uw zLPB7Emoa7{BqUb2p^PmPAEA_i4G0~f*nx%;HbO8^NM5*uj1XKdFMA9b86jCS-DJ1D za1oL#2IOyMKt%|qqw-tqmH{0AaBx zTEdnX9&@Yc_|VaZ)d0f0H(5avH=o5^4xN4H%CHi1J(sApP-Z?$z+d8XUZ_7EzJd9( zwD>c()M$8Gz}M%^cBy!8E>HQ7rRQNS6;?K?)7$Va-`cLLO}dRXFVN|-UnUywaSgv_ zuHLg~T^0MjSp~APva+(Wva+(Wva+(Wva+(Wva;%+f9z~*#L!c=P5=M^07*qoM6N<$ Ef`xT#761SM literal 0 HcmV?d00001 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..d018fed --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,35 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import os +import sys +from pathlib import Path +sys.path.insert(0, os.path.abspath("../../senju")) + +project = 'senju' +copyright = '2025, senju hashirama' +author = 'senju hashirama' +release = 'before the light' +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['sphinx.ext.autodoc', + 'sphinx.ext.napoleon'] + +templates_path = ['_templates'] +exclude_patterns = [] + +autodoc_typehints = 'both' + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'nature' +html_static_path = ['_static'] + +html_favicon = '_static/kanji.png' +html_logo = '_static/kanji.png' \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..9915c68 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,19 @@ +.. senju documentation master file, created by + sphinx-quickstart on Fri Mar 14 15:18:32 2025. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome senju documentation +=================== + +Add your content using ``reStructuredText`` syntax. See the +`reStructuredText `_ +documentation for details. + + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + usage + _modules/modules \ No newline at end of file diff --git a/docs/source/usage.rst b/docs/source/usage.rst new file mode 100644 index 0000000..10bcfdf --- /dev/null +++ b/docs/source/usage.rst @@ -0,0 +1,4 @@ +Installation +============ + +Its a docker - it just works diff --git a/docs/requirements.md b/requirements/requirements.md similarity index 100% rename from docs/requirements.md rename to requirements/requirements.md From b9c40912994cae9281b929438f03f2d81645c1e0 Mon Sep 17 00:00:00 2001 From: Joscha Dierks Date: Sat, 15 Mar 2025 19:40:35 +0100 Subject: [PATCH 2/5] feat/OPS-61: added auto documentation for haiku.py, main.py and store_manager.py At the moment it works by converting senju into a python package. This causes the html docu to start with a link 'senju package' which lists all three moduls and their documentation. I will try now to make it so all three moduls have a docu link of their own. The method foobar in each modul is for testing purposes and should be deleted once full functionality is confirmed. --- docs/source/_modules/haiku.rst | 7 - docs/source/_modules/main.rst | 7 - docs/source/_modules/modules.rst | 9 - docs/source/_modules/store_manager.rst | 7 - docs/source/conf.py | 3 +- docs/source/index.rst | 2 +- poetry.lock | 238 +++++++++++++++++++++++-- pyproject.toml | 3 + senju/__init__.py | 0 senju/haiku.py | 7 + senju/main.py | 6 + senju/store_manager.py | 5 + 12 files changed, 250 insertions(+), 44 deletions(-) delete mode 100644 docs/source/_modules/haiku.rst delete mode 100644 docs/source/_modules/main.rst delete mode 100644 docs/source/_modules/modules.rst delete mode 100644 docs/source/_modules/store_manager.rst create mode 100644 senju/__init__.py diff --git a/docs/source/_modules/haiku.rst b/docs/source/_modules/haiku.rst deleted file mode 100644 index 6e6e926..0000000 --- a/docs/source/_modules/haiku.rst +++ /dev/null @@ -1,7 +0,0 @@ -haiku module -============ - -.. automodule:: haiku - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/_modules/main.rst b/docs/source/_modules/main.rst deleted file mode 100644 index eace87b..0000000 --- a/docs/source/_modules/main.rst +++ /dev/null @@ -1,7 +0,0 @@ -main module -=========== - -.. automodule:: main - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/_modules/modules.rst b/docs/source/_modules/modules.rst deleted file mode 100644 index d024233..0000000 --- a/docs/source/_modules/modules.rst +++ /dev/null @@ -1,9 +0,0 @@ -senju -===== - -.. toctree:: - :maxdepth: 4 - - haiku - main - store_manager diff --git a/docs/source/_modules/store_manager.rst b/docs/source/_modules/store_manager.rst deleted file mode 100644 index aa5fa7f..0000000 --- a/docs/source/_modules/store_manager.rst +++ /dev/null @@ -1,7 +0,0 @@ -store\_manager module -===================== - -.. automodule:: store_manager - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index d018fed..bf51d33 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -9,7 +9,8 @@ import os import sys from pathlib import Path sys.path.insert(0, os.path.abspath("../../senju")) - +senju_path = os.path.abspath("../../") +print("FFFFFFFFFFFFFFFFFFFFFFFFFF", senju_path, sys.path) project = 'senju' copyright = '2025, senju hashirama' author = 'senju hashirama' diff --git a/docs/source/index.rst b/docs/source/index.rst index 9915c68..aa7c231 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -4,7 +4,7 @@ contain the root `toctree` directive. Welcome senju documentation -=================== +=========================== Add your content using ``reStructuredText`` syntax. See the `reStructuredText `_ diff --git a/poetry.lock b/poetry.lock index 51568fa..0bd0101 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,32 @@ # This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +[[package]] +name = "alabaster" +version = "1.0.0" +description = "A light, configurable Sphinx theme" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "alabaster-1.0.0-py3-none-any.whl", hash = "sha256:fc6786402dc3fcb2de3cabd5fe455a2db534b371124f1f21de8731783dec828b"}, + {file = "alabaster-1.0.0.tar.gz", hash = "sha256:c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e"}, +] + +[[package]] +name = "babel" +version = "2.17.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2"}, + {file = "babel-2.17.0.tar.gz", hash = "sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d"}, +] + +[package.extras] +dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""] + [[package]] name = "blinker" version = "1.9.0" @@ -18,7 +45,7 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -30,7 +57,7 @@ version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, @@ -147,12 +174,12 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["main"] -markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" +groups = ["main", "dev"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +markers = {main = "sys_platform == \"win32\" or platform_system == \"Windows\"", dev = "sys_platform == \"win32\""} [[package]] name = "coverage" @@ -230,6 +257,18 @@ files = [ [package.extras] toml = ["tomli ; python_full_version <= \"3.11.0a6\""] +[[package]] +name = "docutils" +version = "0.21.2" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, + {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, +] + [[package]] name = "exceptiongroup" version = "1.2.2" @@ -275,7 +314,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -284,6 +323,18 @@ files = [ [package.extras] all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["dev"] +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + [[package]] name = "iniconfig" version = "2.0.0" @@ -314,7 +365,7 @@ version = "3.1.6" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, @@ -332,7 +383,7 @@ version = "3.0.2" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.9" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8"}, {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158"}, @@ -403,7 +454,7 @@ version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, @@ -425,6 +476,21 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pygments" +version = "2.19.1" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, + {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + [[package]] name = "pytest" version = "8.3.5" @@ -454,7 +520,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -470,6 +536,154 @@ urllib3 = ">=1.21.1,<3" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + +[[package]] +name = "sphinx" +version = "8.1.3" +description = "Python documentation generator" +optional = false +python-versions = ">=3.10" +groups = ["dev"] +files = [ + {file = "sphinx-8.1.3-py3-none-any.whl", hash = "sha256:09719015511837b76bf6e03e42eb7595ac8c2e41eeb9c29c5b755c6b677992a2"}, + {file = "sphinx-8.1.3.tar.gz", hash = "sha256:43c1911eecb0d3e161ad78611bc905d1ad0e523e4ddc202a58a821773dc4c927"}, +] + +[package.dependencies] +alabaster = ">=0.7.14" +babel = ">=2.13" +colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} +docutils = ">=0.20,<0.22" +imagesize = ">=1.3" +Jinja2 = ">=3.1" +packaging = ">=23.0" +Pygments = ">=2.17" +requests = ">=2.30.0" +snowballstemmer = ">=2.2" +sphinxcontrib-applehelp = ">=1.0.7" +sphinxcontrib-devhelp = ">=1.0.6" +sphinxcontrib-htmlhelp = ">=2.0.6" +sphinxcontrib-jsmath = ">=1.0.1" +sphinxcontrib-qthelp = ">=1.0.6" +sphinxcontrib-serializinghtml = ">=1.1.9" +tomli = {version = ">=2", markers = "python_version < \"3.11\""} + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=6.0)", "mypy (==1.11.1)", "pyright (==1.1.384)", "pytest (>=6.0)", "ruff (==0.6.9)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-Pillow (==10.2.0.20240822)", "types-Pygments (==2.18.0.20240506)", "types-colorama (==0.4.15.20240311)", "types-defusedxml (==0.7.0.20240218)", "types-docutils (==0.21.0.20241005)", "types-requests (==2.32.0.20240914)", "types-urllib3 (==1.26.25.14)"] +test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "2.0.0" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5"}, + {file = "sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "2.0.0" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2"}, + {file = "sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.1.0" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8"}, + {file = "sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "2.0.0" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb"}, + {file = "sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["defusedxml (>=0.7.1)", "pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "2.0.0" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331"}, + {file = "sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d"}, +] + +[package.extras] +lint = ["mypy", "ruff (==0.5.5)", "types-docutils"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + [[package]] name = "tinydb" version = "3.15.2" @@ -488,7 +702,7 @@ version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, @@ -531,7 +745,7 @@ version = "2.3.0" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"}, {file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"}, @@ -564,4 +778,4 @@ watchdog = ["watchdog (>=2.3)"] [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "3354ffec9d75797950a58543b075f207e55da7004add3ca2aa106728e08093fe" +content-hash = "ce9cac7092447dc5d6b3920853bb10fcc166018bc4f48c50925ef09db74e7891" diff --git a/pyproject.toml b/pyproject.toml index 5264f20..0711a27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,9 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] sennen = "senju.main:main" +[tool.poetry.group.dev.dependencies] +sphinx = "8.1.3" + [tool.pytest.ini_options] testpaths = ["tests"] python_files = ["test_*.py"] diff --git a/senju/__init__.py b/senju/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/senju/haiku.py b/senju/haiku.py index 4640afb..506ef3f 100644 --- a/senju/haiku.py +++ b/senju/haiku.py @@ -37,6 +37,13 @@ USER INPUT FOR HAIKU CREATION: """ +def foobar(): + """WE KNOW""" + a = 3 + b = 3 + return a+b + + @dataclass class Haiku: lines: list[str] diff --git a/senju/main.py b/senju/main.py index 35a9b27..bb42b1a 100644 --- a/senju/main.py +++ b/senju/main.py @@ -14,6 +14,11 @@ app = Flask(__name__) store = StoreManager(Path("/tmp/store.db")) +def foobar(): + """WE KNOW""" + a = 3 + b = 3 + return a+b @app.route("/") def index_view(): @@ -31,6 +36,7 @@ def haiku_index_view(): @app.route("/haiku/") def haiku_view(haiku_id): + """test""" haiku: Haiku | None = store.load_haiku(haiku_id) if haiku is None: # TODO: add "haiku not found" page diff --git a/senju/store_manager.py b/senju/store_manager.py index e99b98e..ba78a2e 100644 --- a/senju/store_manager.py +++ b/senju/store_manager.py @@ -11,6 +11,11 @@ from senju.haiku import Haiku DEFAULT_DB_PATH: Path = Path("/var/lib/senju.json") +def foobar(): + """WE KNOW""" + a = 3 + b = 3 + return a+b class StoreManager: __slots__ = "_db", "logger" From 20855b211770a1c15ed437a4ecc94cc9158afb48 Mon Sep 17 00:00:00 2001 From: Joscha Dierks Date: Sat, 15 Mar 2025 19:55:10 +0100 Subject: [PATCH 3/5] feat/OPS-61: fix - documentation works without converting senju into a python package. Important: It seems the sphinx commands only work by entering the virtual environment of senju by copying the command/output of ```poetry env activate``` Inside the env install/update the poetry packages to ensure that you use the correct version of sphinx. Afterward cd into the senju/docs folder and execute auto_docu.sh You can open the docu with ```firefox build/html/index.html``` --- docs/auto_docu.sh | 4 ++++ docs/source/_modules/haiku.rst | 7 +++++++ docs/source/_modules/main.rst | 7 +++++++ docs/source/_modules/modules.rst | 9 +++++++++ docs/source/_modules/store_manager.rst | 7 +++++++ docs/source/conf.py | 4 +--- senju/__init__.py | 0 7 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 docs/auto_docu.sh create mode 100644 docs/source/_modules/haiku.rst create mode 100644 docs/source/_modules/main.rst create mode 100644 docs/source/_modules/modules.rst create mode 100644 docs/source/_modules/store_manager.rst delete mode 100644 senju/__init__.py diff --git a/docs/auto_docu.sh b/docs/auto_docu.sh new file mode 100644 index 0000000..7188fe5 --- /dev/null +++ b/docs/auto_docu.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sphinx-apidoc -o source/_modules ../senju +poetry run make clean +poetry run make html \ No newline at end of file diff --git a/docs/source/_modules/haiku.rst b/docs/source/_modules/haiku.rst new file mode 100644 index 0000000..6e6e926 --- /dev/null +++ b/docs/source/_modules/haiku.rst @@ -0,0 +1,7 @@ +haiku module +============ + +.. automodule:: haiku + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/_modules/main.rst b/docs/source/_modules/main.rst new file mode 100644 index 0000000..eace87b --- /dev/null +++ b/docs/source/_modules/main.rst @@ -0,0 +1,7 @@ +main module +=========== + +.. automodule:: main + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/_modules/modules.rst b/docs/source/_modules/modules.rst new file mode 100644 index 0000000..d024233 --- /dev/null +++ b/docs/source/_modules/modules.rst @@ -0,0 +1,9 @@ +senju +===== + +.. toctree:: + :maxdepth: 4 + + haiku + main + store_manager diff --git a/docs/source/_modules/store_manager.rst b/docs/source/_modules/store_manager.rst new file mode 100644 index 0000000..aa5fa7f --- /dev/null +++ b/docs/source/_modules/store_manager.rst @@ -0,0 +1,7 @@ +store\_manager module +===================== + +.. automodule:: store_manager + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index bf51d33..0cdb291 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -7,10 +7,8 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information import os import sys -from pathlib import Path sys.path.insert(0, os.path.abspath("../../senju")) -senju_path = os.path.abspath("../../") -print("FFFFFFFFFFFFFFFFFFFFFFFFFF", senju_path, sys.path) + project = 'senju' copyright = '2025, senju hashirama' author = 'senju hashirama' diff --git a/senju/__init__.py b/senju/__init__.py deleted file mode 100644 index e69de29..0000000 From 627b546227c6fa298908b6e9f5b218b406ea9648 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 19:09:15 +0000 Subject: [PATCH 4/5] ci: automatic Python Formatter changes --- docs/source/conf.py | 2 +- senju/haiku.py | 2 +- senju/main.py | 4 +++- senju/store_manager.py | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 0cdb291..3a1a6eb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,4 +31,4 @@ html_theme = 'nature' html_static_path = ['_static'] html_favicon = '_static/kanji.png' -html_logo = '_static/kanji.png' \ No newline at end of file +html_logo = '_static/kanji.png' diff --git a/senju/haiku.py b/senju/haiku.py index 506ef3f..11f0cef 100644 --- a/senju/haiku.py +++ b/senju/haiku.py @@ -41,7 +41,7 @@ def foobar(): """WE KNOW""" a = 3 b = 3 - return a+b + return a + b @dataclass diff --git a/senju/main.py b/senju/main.py index bb42b1a..36d5954 100644 --- a/senju/main.py +++ b/senju/main.py @@ -14,11 +14,13 @@ app = Flask(__name__) store = StoreManager(Path("/tmp/store.db")) + def foobar(): """WE KNOW""" a = 3 b = 3 - return a+b + return a + b + @app.route("/") def index_view(): diff --git a/senju/store_manager.py b/senju/store_manager.py index ba78a2e..72a4561 100644 --- a/senju/store_manager.py +++ b/senju/store_manager.py @@ -11,11 +11,13 @@ from senju.haiku import Haiku DEFAULT_DB_PATH: Path = Path("/var/lib/senju.json") + def foobar(): """WE KNOW""" a = 3 b = 3 - return a+b + return a + b + class StoreManager: __slots__ = "_db", "logger" From 63d434efe2b103645737fdef497a600545afab9f Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 17 Mar 2025 14:24:22 +0100 Subject: [PATCH 5/5] chore: remove _modules and autogenerate it Refs: OPS-61 --- .gitignore | 3 +++ docs/auto_docu.sh | 3 ++- docs/source/_modules/haiku.rst | 7 ------- docs/source/_modules/main.rst | 7 ------- docs/source/_modules/modules.rst | 9 --------- docs/source/_modules/store_manager.rst | 7 ------- 6 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 docs/source/_modules/haiku.rst delete mode 100644 docs/source/_modules/main.rst delete mode 100644 docs/source/_modules/modules.rst delete mode 100644 docs/source/_modules/store_manager.rst diff --git a/.gitignore b/.gitignore index ed76ffc..706bc04 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,6 @@ pyrightconfig.json # Ollama Local Dir ollama + +# sphinx rst files +docs/source/_modules diff --git a/docs/auto_docu.sh b/docs/auto_docu.sh index 7188fe5..80729a0 100644 --- a/docs/auto_docu.sh +++ b/docs/auto_docu.sh @@ -1,4 +1,5 @@ #!/bin/bash +rm -rf source/_modules sphinx-apidoc -o source/_modules ../senju poetry run make clean -poetry run make html \ No newline at end of file +poetry run make html diff --git a/docs/source/_modules/haiku.rst b/docs/source/_modules/haiku.rst deleted file mode 100644 index 6e6e926..0000000 --- a/docs/source/_modules/haiku.rst +++ /dev/null @@ -1,7 +0,0 @@ -haiku module -============ - -.. automodule:: haiku - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/_modules/main.rst b/docs/source/_modules/main.rst deleted file mode 100644 index eace87b..0000000 --- a/docs/source/_modules/main.rst +++ /dev/null @@ -1,7 +0,0 @@ -main module -=========== - -.. automodule:: main - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/_modules/modules.rst b/docs/source/_modules/modules.rst deleted file mode 100644 index d024233..0000000 --- a/docs/source/_modules/modules.rst +++ /dev/null @@ -1,9 +0,0 @@ -senju -===== - -.. toctree:: - :maxdepth: 4 - - haiku - main - store_manager diff --git a/docs/source/_modules/store_manager.rst b/docs/source/_modules/store_manager.rst deleted file mode 100644 index aa5fa7f..0000000 --- a/docs/source/_modules/store_manager.rst +++ /dev/null @@ -1,7 +0,0 @@ -store\_manager module -===================== - -.. automodule:: store_manager - :members: - :undoc-members: - :show-inheritance: