Skip to content

Commit 7e2d88b

Browse files
author
Sergio García Prado
authored
Merge pull request #392 from minos-framework/issue-99-add-minos-database-lmdb
#99 - Add `minos-database-lmdb`
2 parents 6b30628 + bb819b8 commit 7e2d88b

File tree

58 files changed

+2281
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2281
-533
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Publish: minos-database-lmdb"
2+
3+
on:
4+
push:
5+
branches:
6+
- '*.*.x'
7+
paths:
8+
- 'packages/plugins/minos-database-lmdb/**'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
container: python:3.9-buster
14+
defaults:
15+
run:
16+
working-directory: packages/plugins/minos-database-lmdb
17+
18+
steps:
19+
20+
- name: Check out repository code
21+
uses: actions/checkout@v2
22+
23+
- name: Install Poetry
24+
uses: snok/install-poetry@v1
25+
26+
- name: Install dependencies
27+
run: make install
28+
29+
- name: Publish package
30+
run: make release
31+
env:
32+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
33+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Test: minos-database-lmdb"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '*.*.x'
8+
pull_request:
9+
paths:
10+
- 'packages/plugins/minos-database-lmdb/**'
11+
- 'packages/core/minos-microservice-saga/**'
12+
- 'packages/core/minos-microservice-common/**'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
container: python:3.9-buster
18+
defaults:
19+
run:
20+
working-directory: packages/plugins/minos-database-lmdb
21+
22+
steps:
23+
- name: Check out repository code
24+
uses: actions/checkout@v2
25+
26+
- name: Install Poetry
27+
uses: snok/install-poetry@v1
28+
29+
- name: Install dependencies
30+
run: make install
31+
32+
- name: Lint package
33+
run: make lint
34+
35+
- name: Test package with coverage
36+
run: make coverage
37+
38+
- name: Publish coverage
39+
uses: codecov/codecov-action@v2
40+
with:
41+
token: ${{ secrets.CODECOV_TOKEN }}
42+
files: ./packages/plugins/minos-database-lmdb/coverage.xml
43+
fail_ci_if_error: true
44+
45+
- name: Generate documentation
46+
run: make docs
47+
48+
- name: Generate build
49+
run: make dist

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ repos:
5151
files: ^packages/plugins/minos-database-aiopg/
5252
language: system
5353

54+
- id: minos-database-lmdb-check
55+
pass_filenames: false
56+
entry: make --directory=packages/plugins/minos-database-lmdb check
57+
name: Check minos-database-lmdb
58+
files: ^packages/plugins/minos-database-lmdb/
59+
language: system
60+
5461
- id: minos-discovery-minos-check
5562
pass_filenames: false
5663
entry: make --directory=packages/plugins/minos-discovery-minos check

packages/core/minos-microservice-common/minos/common/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@
133133
MinosSetup,
134134
SetupMixin,
135135
)
136-
from .storage import (
137-
MinosStorage,
138-
MinosStorageLmdb,
139-
)
140136
from .uuid import (
141137
NULL_UUID,
142138
UUID_REGEX,

packages/core/minos-microservice-common/minos/common/database/mixins.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
from collections.abc import (
2+
AsyncIterator,
3+
)
14
from contextlib import (
25
suppress,
36
)
47
from typing import (
5-
AsyncIterator,
8+
Any,
69
Generic,
710
Optional,
811
TypeVar,
@@ -101,7 +104,7 @@ def _get_generic_operation_factory(self) -> Optional[type[GenericDatabaseOperati
101104
raise TypeError(f"{type(self)!r} must contain a {DatabaseOperationFactory!r} as generic value.")
102105
return operation_factory_cls
103106

104-
async def execute_on_database_and_fetch_one(self, operation: DatabaseOperation) -> tuple:
107+
async def execute_on_database_and_fetch_one(self, operation: DatabaseOperation) -> Any:
105108
"""Submit an Operation and get the first response.
106109
107110
:param operation: The operation to be executed.

packages/core/minos-microservice-common/minos/common/storage/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/core/minos-microservice-common/minos/common/storage/abc.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

packages/core/minos-microservice-common/minos/common/storage/lmdb.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

packages/core/minos-microservice-common/poetry.lock

Lines changed: 1 addition & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/minos-microservice-common/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ python = "^3.9"
3434
aiomisc = ">=14.0.3,<15.8.0"
3535
fastavro = "^1.4.0"
3636
orjson = "^3.5.2"
37-
lmdb = "^1.2.1"
3837
PyYAML = ">=5.4.1,<7.0.0"
3938
dependency-injector = "^4.32.2"
4039
cached-property = "^1.5.2"

0 commit comments

Comments
 (0)