Skip to content

Commit

Permalink
Adjusted extras and dependency groups. Removed the docs extra, and mo…
Browse files Browse the repository at this point in the history
…ved docs dependencies to a separate group. Also adjusted Makefile and .readthedocs.yaml accordingly. Also deleted mention of the postgres_dev extra from the docs (it hasn't existed for a while by now).
  • Loading branch information
johnbywater committed Nov 6, 2024
1 parent 3307245 commit c023609
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 501 deletions.
23 changes: 17 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install -extras "crypto" --with docs
# jobs:
# pre_create_environment:
# # Select Python version (keep in sync with other versions):
Expand Down Expand Up @@ -43,9 +54,9 @@ sphinx:
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- method: pip
path: .
extra_requirements:
- docs
#python:
# install:
# - method: pip
# path: .
# extra_requirements:
# - docs
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ install-poetry:

.PHONY: install
install:
$(POETRY) install --sync --extras "crypto docs" -vv $(opts)
$(POETRY) install --sync --extras "crypto" --with "docs" -vv $(opts)

.PHONY: install-packages
install-packages:
$(POETRY) install --sync --no-root --extras "crypto docs" -vv $(opts)
$(POETRY) install --sync --no-root --extras "crypto" --with "docs" -vv $(opts)

.PHONY: update-lockfile
update-lockfile:
Expand All @@ -40,9 +40,9 @@ lint-black:
lint-ruff:
$(POETRY) run ruff check eventsourcing

.PHONY: lint-flake8
lint-flake8:
$(POETRY) run flake8 eventsourcing
# .PHONY: lint-flake8
# lint-flake8:
# $(POETRY) run flake8 eventsourcing

.PHONY: lint-isort
lint-isort:
Expand Down
35 changes: 19 additions & 16 deletions docs/topics/tutorial/part3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,11 @@ tutorial so far.
SQLite environment
==================

We can also configure an application to use SQLite for storing events.
Alternatively, we can configure an application to use SQLite for storing events.

To use the library's :ref:`SQLite persistence module <sqlite-module>`,
set ``PERSISTENCE_MODULE`` to the value ``'eventsourcing.sqlite'``.

When using the library's SQLite persistence module, the environment variable
``SQLITE_DBNAME`` must also be set. This value will be passed to Python's
:func:`sqlite3.connect`.
Expand Down Expand Up @@ -508,10 +510,14 @@ we can expect the recorded values to be visible in the database records.
PostgreSQL environment
======================

We can also configure a "production" environment to use PostgreSQL.
Using the library's :ref:`PostgresSQL persistence module <postgres-module>`
will keep stored events in a PostgresSQL database. This persistence module
uses `Psycopg v3 <https://www.psycopg.org>`_.
We can configure a "production" environment to use PostgreSQL. The example
below shows how to store events in PostgreSQL that have been compressed and
encrypted.

We can use the library's :ref:`PostgresSQL persistence module <postgres-module>`
to store events in a PostgresSQL database. This persistence module
uses `Psycopg v3 <https://www.psycopg.org>`_, along with its connection pool package,
and either its C optimization package, or its pre-built binary package.

To use the PostgreSQL persistence module, either install the
library with the ``postgres`` option, or install ``psycopg[c,pool]``
Expand All @@ -521,23 +527,20 @@ directly.

$ pip install eventsourcing[postgres]

Please note, the library option ``postgres_dev`` will install Psycopg v3
with the connection pool option, and the pre-built binary optimization option ``psycopg[binary]``
which is much faster to install than ``psycopg[c]``, but possibly less optimal. The binary
package is a practical choice for development and testing, but in production
it is advised to use ``psycopg[c]`` if you can meet the prerequistes for
building the C extension.
Please note, the Psycopg pre-built binary optimization option``psycopg[binary,pool]``
is a practical choice for development and testing.

The example below also uses zlib and AES to compress and encrypt the
stored events. To use the library's encryption functionality,
either install the library with the ``crypto`` option, or install the
``pycryptodome`` directly.
The example below compresses and encrypts stored events with zlib and AES.
To use the library's encryption functionality, which depends on PyCryptodome,
either install the library with the ``crypto`` option, or install ``pycryptodome``
directly. The ``zlib`` package is included with the
`Python Standard Library <https://docs.python.org/3/library/zlib.html>`_.

::

$ pip install eventsourcing[crypto]

Both the ``crypto`` and the ``postgres`` options can be installed together
Both the ``postgres`` and the ``crypto`` options can be installed together
with the following command.

::
Expand Down
Loading

0 comments on commit c023609

Please sign in to comment.