From 422460a6156e5be2df4e1cc50b64ea2287aed904 Mon Sep 17 00:00:00 2001 From: Subhash Bhushan Date: Mon, 20 Nov 2023 18:12:30 -0800 Subject: [PATCH] Add ReadTheDocs config file + misc fixes (#386) --- .readthedocs.yaml | 22 ++++++++++++++++++++++ src/protean/domain/__init__.py | 5 ++++- tests/repository/child_entities.py | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..d9ee7902 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,22 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt \ No newline at end of file diff --git a/src/protean/domain/__init__.py b/src/protean/domain/__init__.py index 0777d23e..423c1207 100644 --- a/src/protean/domain/__init__.py +++ b/src/protean/domain/__init__.py @@ -99,7 +99,10 @@ class Domain(_PackageBoundObject): "AUTOLOAD_DOMAIN": True, "IDENTITY_STRATEGY": IdentityStrategy.UUID.value, "IDENTITY_TYPE": IdentityType.STRING.value, - "DATABASES": {"default": {"PROVIDER": "protean.adapters.MemoryProvider"}}, + "DATABASES": { + "default": {"PROVIDER": "protean.adapters.MemoryProvider"}, + "memory": {"PROVIDER": "protean.adapters.MemoryProvider"}, + }, "EVENT_PROCESSING": EventProcessing.ASYNC.value, "COMMAND_PROCESSING": CommandProcessing.ASYNC.value, "EVENT_STORE": { diff --git a/tests/repository/child_entities.py b/tests/repository/child_entities.py index 1f6eec76..7371c58a 100644 --- a/tests/repository/child_entities.py +++ b/tests/repository/child_entities.py @@ -8,7 +8,7 @@ class Post(BaseAggregate): title = String(required=True, max_length=1000) slug = String(required=True, max_length=1024) content = Text(required=True) - posted_at = DateTime(required=True, default=datetime.now()) + posted_at = DateTime(required=True, default=datetime.now) post_meta = HasOne("tests.repository.child_entities.PostMeta") comments = HasMany("tests.repository.child_entities.Comment")