diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f0ed21 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docs/_build/ 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/.keepme b/docs/_static/.keepme new file mode 100644 index 0000000..e69de29 diff --git a/docs/api/wuttapos.rst b/docs/api/wuttapos.rst new file mode 100644 index 0000000..9ebc514 --- /dev/null +++ b/docs/api/wuttapos.rst @@ -0,0 +1,6 @@ + +``wuttapos`` +============ + +.. automodule:: wuttapos + :members: diff --git a/docs/api/wuttapos.server.rst b/docs/api/wuttapos.server.rst new file mode 100644 index 0000000..725c0c7 --- /dev/null +++ b/docs/api/wuttapos.server.rst @@ -0,0 +1,6 @@ + +``wuttapos.server`` +=================== + +.. automodule:: wuttapos.server + :members: diff --git a/docs/api/wuttapos.terminal.rst b/docs/api/wuttapos.terminal.rst new file mode 100644 index 0000000..9117ad6 --- /dev/null +++ b/docs/api/wuttapos.terminal.rst @@ -0,0 +1,6 @@ + +``wuttapos.terminal`` +===================== + +.. automodule:: wuttapos.terminal + :members: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..53b0c1e --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,41 @@ +# 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 + +from importlib.metadata import version as get_version + +project = "WuttaPOS" +copyright = "2026, Lance Edgar" +author = "Lance Edgar" +release = get_version("WuttaPOS") + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", + "sphinx.ext.todo", + "sphinxcontrib.programoutput", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "wutta-continuum": ("https://docs.wuttaproject.org/wutta-continuum/", None), + "wuttjamaican": ("https://docs.wuttaproject.org/wuttjamaican/", None), +} + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "furo" +html_static_path = ["_static"] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..3cd8287 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,35 @@ + +WuttaPOS +======== + +This is an old idea but a new effort, for a Python-based point of sale system. + +This project includes two primary components: + +- web app and related daemons, to run on the server +- standalone GUI app, to run on the lanes + +This project is in the very early stages and is not yet documented. +It is based on an earlier effort, which used Rattail: +`rattail/wuttapos`_ + +.. _rattail/wuttapos: https://forgejo.wuttaproject.org/rattail/wuttapos + +However this project uses `Wutta Framework +`_, has no Rattail dependencies, and "starts +over" for (mostly) everything. + + +.. toctree:: + :maxdepth: 2 + :caption: Documentation + + narr/install + +.. toctree:: + :maxdepth: 1 + :caption: Package API + + api/wuttapos + api/wuttapos.server + api/wuttapos.terminal diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..32bb245 --- /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/narr/install.rst b/docs/narr/install.rst new file mode 100644 index 0000000..7a3c767 --- /dev/null +++ b/docs/narr/install.rst @@ -0,0 +1,89 @@ + +============== + Installation +============== + +For now this only describes a *development* setup, which assumes the following: + +* Linux OS +* Python 3.11 or newer +* database in PostgreSQL or MySQL + +These steps will setup both the server and terminal in a shared +virtual environment. + + +Virtual Environment +------------------- + +Obviously you should make a virtual environment. + +.. code-block:: sh + + python3 -m venv wuttapos + cd wuttapos + source bin/activate + + +Install Package +--------------- + +Install the WuttaPOS package within your virtual environment: + +.. code-block:: sh + + bin/pip install WuttaPOS + + +Install Server +-------------- + +**Please note, you must create your database before running the installer.** + +Run the WuttaPOS installer to setup the server app: + +.. code-block:: ini + + bin/wuttapos install + +Now you can run the server app via command line: + +.. code-block:: ini + + bin/wutta -c app/web.conf webapp -r + +And browse it (by default) at http://localhost:9080 + +The first time you browse to it, you must enter details for the +(first) admin user. That can all be changed later, just needs an +account to get things started. + +After that you must login using the credentials you gave it. + +At this point the app is fully functional. + +Don't forget you can "become root" (via user menu in top right of +screen) to bypass all permission checks. This shows all menu options, +tool buttons etc. no matter what your normal permissions are. +(Only users in the Administrator role can become root.) + + +Sample Data +~~~~~~~~~~~ + +You may also want to install sample data, to get some basic tables +populated and avoid that headache. As of now the sample data is very +minimal, and obviously not "real" so it's only a small convenience. + +To install sample data, first "become root" (via user menu in top +right of screen) and then go to Admin -> App Info and click Install +Sample Data. + +Eventually the sample data, and/or data import options in general, +should be improved - but that will come later. + + +Install Terminal +---------------- + +TODO: this is not yet documented diff --git a/pyproject.toml b/pyproject.toml index 3cad60a..1d58287 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,9 +27,10 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", + # TODO: decide what we actually want to support + # "Programming Language :: Python :: 3.8", + # "Programming Language :: Python :: 3.9", + # "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Topic :: Office/Business", ] @@ -44,6 +45,8 @@ dependencies = [ server = ["WuttaWeb[continuum]"] # terminal = ["flet[all]<0.80.0"] terminal = ["flet[all]<0.21"] +docs = ["Sphinx", "sphinxcontrib-programoutput", "furo"] +tests = ["tox"] [project.scripts] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..cd87198 --- /dev/null +++ b/tox.ini @@ -0,0 +1,6 @@ + +[testenv:docs] +basepython = python3.11 +extras = docs +changedir = docs +commands = sphinx-build -b html -d {envtmpdir}/doctrees -W -T . {envtmpdir}/docs