diff --git a/Dockerfile b/Dockerfile index cb6a44b..14aa72f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,11 +28,18 @@ RUN cp -r /app/legacy/ptvp35/docs/build/html/ /app/docs/build/html/1.1rc0/ RUN rm -r /app/legacy/ptvp35/docs/build/ WORKDIR /app/legacy/ptvp35/ +RUN git fetch && git checkout 1.1rc2 +WORKDIR /app/legacy/ptvp35/docs/ +RUN make html +RUN cp -r /app/legacy/ptvp35/docs/build/html/ /app/docs/build/html/1.1rc2/ +RUN rm -r /app/legacy/ptvp35/docs/build/ +WORKDIR /app/legacy/ptvp35/ + WORKDIR /app/ COPY docs/Makefile docs/Makefile COPY setup.py setup.py -COPY traced_example.py traced_example.py +COPY docs/scripts docs/scripts COPY ptvp35 ptvp35 COPY docs/source docs/source WORKDIR /app/docs/ diff --git a/docs/Makefile b/docs/Makefile index 9056a97..735b316 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,6 +17,6 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - python ../traced_example.py > ../traced_example.txt - python ../traced_example.py all > ../traced_example_all.txt + python scripts/traced_example.py > scripts/traced_example.txt + python scripts/traced_example.py all > scripts/traced_example_all.txt @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/traced_example.py b/docs/scripts/traced_example.py similarity index 98% rename from traced_example.py rename to docs/scripts/traced_example.py index 9ea86c0..95c40a2 100644 --- a/traced_example.py +++ b/docs/scripts/traced_example.py @@ -4,8 +4,13 @@ import sys import threading from contextlib import ExitStack -from ptvp35 import * -from ptvp35.instrumentation import * +try: + sys.path.append('/app/') + + from ptvp35 import * + from ptvp35.instrumentation import * +except: + raise async def aprint(*args, **kwargs): @@ -135,7 +140,7 @@ run_all = 'all' in sys.argv async def main(): - (path := pathlib.Path('dev.db')).unlink(missing_ok=True) + (path := pathlib.Path(__file__).parent / 'trace_example.db').unlink(missing_ok=True) with ExitStack() as es: LogWrites().enter(es) diff --git a/docs/source/development.rst b/docs/source/development.rst index d253082..e422bd6 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -18,3 +18,5 @@ These apply both to the internal PARRRATE TNV team behind Persistence 5 and to e * Forking of the repository is encouraged. * Usage of the repository as a reference for custom data storage solutions is encouraged. * Instrumentation code base is more open to direct code contributions. + * Main way of instrumentation is code injection. + * Instrumentation on its own shouldn't require changes to the core code, even though instrumentation-allowing core code is preferred. diff --git a/docs/source/history.rst b/docs/source/history.rst index c8a83f7..aac15b2 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -1,12 +1,7 @@ Historical notes ================ -Persistence 1. --------------- - -* Used by CMB. - -Persistence 2. CmbPrst. +Persistence 1/2. CmbPrst. -------------- * Internal storage of CMB. diff --git a/docs/source/index.rst b/docs/source/index.rst index c262916..3fb410f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,6 +9,7 @@ Memory-Resident DataBase for simple single-process asynchronous Python applicati motivation usage + structure guarantees ordering projects diff --git a/docs/source/modules.rst b/docs/source/modules.rst index 5e713dd..61403dc 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -1,5 +1,5 @@ -ptvp35 -====== +Modules +======= .. toctree:: :maxdepth: 4 diff --git a/docs/source/ordering.rst b/docs/source/ordering.rst index 03c12aa..ca0984b 100644 --- a/docs/source/ordering.rst +++ b/docs/source/ordering.rst @@ -4,17 +4,17 @@ Traced example of how ordering works in persistence5 Source ------ -.. literalinclude :: ../../traced_example.py +.. literalinclude :: ../scripts/traced_example.py :language: python3 Writes/reads log ---------------- -.. literalinclude :: ../../traced_example.txt +.. literalinclude :: ../scripts/traced_example.txt :language: plain Everything log -------------- -.. literalinclude :: ../../traced_example_all.txt +.. literalinclude :: ../scripts/traced_example_all.txt :language: plain diff --git a/docs/source/ptvp35.rst b/docs/source/ptvp35.rst index b5728f2..b8f5f02 100644 --- a/docs/source/ptvp35.rst +++ b/docs/source/ptvp35.rst @@ -1,5 +1,5 @@ -ptvp35 package -============== +ptvp35 (API Reference) +====================== Module contents --------------- diff --git a/docs/source/structure.rst b/docs/source/structure.rst new file mode 100644 index 0000000..daf6f97 --- /dev/null +++ b/docs/source/structure.rst @@ -0,0 +1,17 @@ +Inner structure +=============== + +Main-Memory DataBase +-------------------- + +DataBase Stream File +-------------------- + +Request Queue +------------- + +Transaction View +---------------- + +Transaction +----------- diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 7be9685..29e1c7a 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -23,7 +23,7 @@ Basic functionality .. code-block:: python3 import pathlib - from ptvp35 import DbFactory, KVJson + from ptvp35 import * async def main(): async with DbFactory(pathlib.Path('example.db'), kvfactory=KVJson()) as connection: @@ -33,7 +33,7 @@ Different ways to get/set a value: .. code-block:: python3 - from ptvp35 import DbConnection + from ptvp35 import * async def _main(connection: DbConnection): value0 = connection.get('increment-0', 0)