Initial untested setup

This commit is contained in:
Dirk Alders 2025-08-05 19:15:56 +02:00
parent 2836b1f1bb
commit cecc9a56c2
25 changed files with 412 additions and 0 deletions

65
.gitignore vendored Normal file
View File

@ -0,0 +1,65 @@
# general stuff
*~
unittest/testresults/*
unittest/output_data/*
# eclipse stuff
.settings/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/

15
.gitmodules vendored Normal file
View File

@ -0,0 +1,15 @@
[submodule "pylibs/mqtt"]
path = pylibs/mqtt
url = https://git.mount-mockery.de/pylib/mqtt.git
[submodule "pylibs/unittest"]
path = pylibs/unittest
url = https://git.mount-mockery.de/pylib/unittest.git
[submodule "pylibs/report"]
path = pylibs/report
url = https://git.mount-mockery.de/pylib/report.git
[submodule "pylibs/fstools"]
path = pylibs/fstools
url = https://git.mount-mockery.de/pylib/fstools.git
[submodule "pylibs/rspec"]
path = pylibs/rspec
url = https://git.mount-mockery.de/pylib/rspec.git

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
MODULE_NAME := $(shell basename `pwd`)
view_unittest:
xdg-open pylibs/$(MODULE_NAME)/_testresults_/unittest.pdf
view_requirements:
xdg-open pylibs/$(MODULE_NAME)/_requirements_/specification.pdf
view_docs:
xdg-open pylibs/$(MODULE_NAME)/_docs_/index.html
clean:
make -kC docs clean; make -kC requirements cleanall; make -kC unittest clean

38
docs/Makefile Normal file
View File

@ -0,0 +1,38 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
MAKEFLAGS += --no-print-directory
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPRJ = $(shell basename `dirname \`pwd\``)
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).
%: $(SPHINXPRJ)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
$(SPHINXPRJ): Makefile
make -C $@/_examples_ all
clean:
@echo "\033[1;33mCleanung up docs...\033[00m"
@echo "\e[1m * Sphix build directory...\e[0m"
@rm -rf $(BUILDDIR)/*
@make -kC $(SPHINXPRJ)/_examples_ clean
release: html
rm -rf $(SPHINXPRJ)/_docs_
mv $(BUILDDIR)/html $(SPHINXPRJ)/_docs_
view_html: html
xdg-open $(BUILDDIR)/html/index.html

179
docs/conf.py Normal file
View File

@ -0,0 +1,179 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'mqtt'
copyright = '2025, Dirk Alders'
author = 'Dirk Alders'
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'python_docs_theme',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'python_docs_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'cachingdoc'
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'caching.tex', 'socket\\_protocol Documentation',
'Dirk Alders', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'caching', 'caching Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'caching', 'caching Documentation',
author, 'caching', 'One line description of project.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------

23
docs/index.rst Normal file
View File

@ -0,0 +1,23 @@
.. socket_protocol documentation master file, created by
sphinx-quickstart on Fri Jan 1 19:56:01 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to cachings's documentation!
====================================
.. automodule:: caching
:members:
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

1
docs/mqtt Symbolic link
View File

@ -0,0 +1 @@
../pylibs/mqtt

4
docs/requirements.txt Normal file
View File

@ -0,0 +1,4 @@
sphinx
python-docs-theme
paho-mqtt

1
pylibs/fstools Submodule

@ -0,0 +1 @@
Subproject commit 9237f6f7f77eed79b8163077c1b4d87189193fbe

1
pylibs/mqtt Submodule

@ -0,0 +1 @@
Subproject commit cf7250c05c99ba0698b3a960e7b8a445b9dad649

1
pylibs/report Submodule

@ -0,0 +1 @@
Subproject commit 74e6f20d09cf76b3fbbdfa04c192b01708e50d5d

1
pylibs/rspec Submodule

@ -0,0 +1 @@
Subproject commit 1a941be7e01af8ba468c829933eb4f3db7b04330

1
pylibs/unittest Submodule

@ -0,0 +1 @@
Subproject commit bc0672bec78e821a59ce63ccd4dfa69f95196a48

1
unittest/Makefile Symbolic link
View File

@ -0,0 +1 @@
../pylibs/unittest/scripts/Makefile

View File

@ -0,0 +1,5 @@
coverage
jinja2
distro
paho-mqtt

18
unittest/src/config.py Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import optparse
import os
import mqtt as lib
release_unittest_version = 'c939a2bf3448ed3a941b618e1565d224'
lib_path = os.path.realpath(lib.__path__[0])
additional_loggers_to_catch = []
if __name__ == "__main__":
parser = optparse.OptionParser("usage: %prog [options] folder_for_document")
parser.add_option("-p", "--path", dest="libpath", action="store_true", default=False, help="prints the library path")
(options, args) = parser.parse_args()
if options.libpath:
print(lib_path)

1
unittest/src/fstools Symbolic link
View File

@ -0,0 +1 @@
../../pylibs/fstools

1
unittest/src/mqtt Symbolic link
View File

@ -0,0 +1 @@
../../pylibs/mqtt

1
unittest/src/report Symbolic link
View File

@ -0,0 +1 @@
../../pylibs/report

1
unittest/src/rspec Symbolic link
View File

@ -0,0 +1 @@
../../pylibs/rspec

View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import mqtt
from report import TCEL_FULL
from report import TCEL_SHORT
from report import TCEL_SINGLE
from report import TCEL_SMOKE
from tests import test_rx
execution_level = 'full'
def testrun(tcl):
#
# caching.property_cache_json
#
tcl.testCase('description', TCEL_FULL, test_rx.receive)

View File

@ -0,0 +1,2 @@
def receive(tLogger):
tLogger.error("NYI")

1
unittest/src/unittest Symbolic link
View File

@ -0,0 +1 @@
../../pylibs/unittest

19
unittest/src/unittest.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import optparse
import os
import report
import unittest
import tests
parser = optparse.OptionParser("usage: %prog [clean|run|coverage|pdf|copy|release]")
parser.add_option("-e", "--execution-level", dest="execution_level", default="full", help="sets the execution level [full | short | smoke | single]")
(options, args) = parser.parse_args()
if report.TCEL_REVERSE_NAMED.get(tests.execution_level, report.TCEL_FULL) < report.TCEL_REVERSE_NAMED.get(options.execution_level, report.TCEL_FULL):
options.execution_level = tests.execution_level
unittest.run.unittest(options, args, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))

View File