feat: initial release

This commit is contained in:
Lance Edgar 2024-08-27 19:18:35 -05:00
commit 9dfe2a8d6b
24 changed files with 1370 additions and 0 deletions

20
docs/Makefile Normal file
View file

@ -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)

0
docs/_static/.keepme vendored Normal file
View file

View file

@ -0,0 +1,6 @@
``wutta_continuum.app``
=======================
.. automodule:: wutta_continuum.app
:members:

View file

@ -0,0 +1,6 @@
``wutta_continuum.conf``
========================
.. automodule:: wutta_continuum.conf
:members:

View file

@ -0,0 +1,6 @@
``wutta_continuum``
===================
.. automodule:: wutta_continuum
:members:

39
docs/conf.py Normal file
View file

@ -0,0 +1,39 @@
# 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 = 'Wutta-Continuum'
copyright = '2024, Lance Edgar'
author = 'Lance Edgar'
release = get_version('Wutta-Continuum')
# -- 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',
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
intersphinx_mapping = {
'sqlalchemy-continuum': ('https://sqlalchemy-continuum.readthedocs.io/en/latest/', None),
'wuttjamaican': ('https://rattailproject.org/docs/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']

25
docs/index.rst Normal file
View file

@ -0,0 +1,25 @@
Wutta-Continuum
===============
This package adds data versioning/history for `WuttJamaican`_, using
`SQLAlchemy-Continuum`_.
.. _WuttJamaican: https://rattailproject.org/docs/wuttjamaican/
.. _SQLAlchemy-Continuum: https://sqlalchemy-continuum.readthedocs.io/en/latest/
.. toctree::
:maxdepth: 2
:caption: Documentation
narr/install
.. toctree::
:maxdepth: 1
:caption: API
api/wutta_continuum
api/wutta_continuum.app
api/wutta_continuum.conf

35
docs/make.bat Normal file
View file

@ -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

45
docs/narr/install.rst Normal file
View file

@ -0,0 +1,45 @@
Installation
============
This assumes you already have a :doc:`WuttJamaican app+database
<wuttjamaican:narr/install/index>` setup and working.
Install the Wutta-Continuum package to your virtual environment:
.. code-block:: sh
pip install Wutta-Continuum
Edit your :term:`config file` to enable Wutta-Continuum versioning:
.. code-block:: ini
[wutta_continuum]
enable_versioning = true
.. note::
The above *must* be done via config file; the :term:`settings
table` will not work.
Another edit required to your config file, is to make Alembic aware of
this package for database migrations. You should already have an
``[alembic]`` section, but now must update it like so:
.. code-block:: ini
[alembic]
script_location = wuttjamaican.db:alembic
version_locations = wuttjamaican.db:alembic/versions wutta_continuum.db:alembic/versions
Then (as you would have done previously in
:ref:`wuttjamaican:db-setup`) you can migrate your database to add the
versioning tables:
.. code-block:: sh
cd /path/to/env
bin/alembic -c /path/to/my.conf upgrade heads
And that's it, the versioning/history feature should be setup and working.