Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #124 from Clariteia/0.0.1
Browse files Browse the repository at this point in the history
0.0.1
  • Loading branch information
andrea-mucci authored May 12, 2021
2 parents 0c5649c + 99b680f commit 5735145
Show file tree
Hide file tree
Showing 135 changed files with 3,996 additions and 2,178 deletions.
89 changes: 57 additions & 32 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,71 @@ on: push

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
container:
image: python:latest
container: python:3.9-buster


services:
zookeeper:
image: bitnami/zookeeper:latest
ports:
- "2181:2181"
kafka:
image: bitnami/kafka:latest
ports:
- "9092:9092"
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: localhost
postgres:
image: postgres
env:
POSTGRES_USER: minos
POSTGRES_PASSWORD: min0s
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

zookeeper:
image: wurstmeister/zookeeper:latest
ports:
- 2181:2181

kafka:
image: wurstmeister/kafka:latest
ports:
- 9092:9092
env:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: kafka
env:
MINOS_EVENTS_QUEUE_HOST: postgres
MINOS_EVENTS_BROKER: kafka
MINOS_COMMANDS_QUEUE_HOST: postgres
MINOS_COMMANDS_BROKER: kafka
MINOS_REPOSITORY_HOST: postgres
MINOS_SNAPSHOT_HOST: postgres

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
apt-get install -y libc6 build-essential
- name: Check out repository code
uses: actions/checkout@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
python setup.py install
- name: Test with pytest
run: |
- name: Install Postgresql client
run: |
apt-get update
apt-get install --yes postgresql-client
- name: Create database
run: |
PGPASSWORD=min0s psql -U minos -h postgres -tc "CREATE DATABASE order_db OWNER minos;"
- name: Test with pytest
run: |
make test
- name: Generate coverage report
- name: Generate coverage report
run: |
make coverage
- name: Codecov
- name: Codecov
uses: codecov/codecov-action@v1.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@ ENV/
.mypy_cache/

# IDE settings
.vscode/
.vscode/

# Intellij IDEa / PyCharm / etc.
.idea
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .idea/minos_microservice_networks.iml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

28 changes: 28 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
enabled: true
exclude:
- "**/*.md"
- ".idea/**/*"
- "docs/**/*"
- "**/*.in"
- "Makefile"
- ".github/workflows/**/*"
restylers:
- name: black
image: restyled/restyler-black:v19.10b0
command:
- black
arguments: ["--line-length", "120"]
include:
- "**/*.py"
interpreters:
- python
- name: isort
image: restyled/restyler-isort:v4.3.21
command:
- isort
arguments: []
include:
- "**/*.py"
interpreters:
- python
4 changes: 2 additions & 2 deletions AUTHORS.rst → AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
=======
Credits
=======

Expand All @@ -10,4 +9,5 @@ Development Lead
Contributors
------------

None yet. Why not be the first?
* Sergio Garcia Prado <sergio.garcia@clariteia.com>
* Vladyslav Fenchak <vladyslav.fenchak@clariteia.com>`
14 changes: 14 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
History
=======

0.0.1 (2021-05-12)
------------------

* Added Event Handler
* Added Command Handler
* Added Event Recurring Service
* Added Command Recurring Service
* Added Event Broker with Recurrent Service
* Added Command Broker with Recurrent Service
* Added REST Service with Health handler

8 changes: 0 additions & 8 deletions HISTORY.rst

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ test-all: ## run tests on every Python version with tox
coverage: ## check code coverage quickly with the default Python
coverage run --source minos -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
coverage xml
## $(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/minos_microservice_networks.rst
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Minos Microservice Networks
===========================

[![codecov](https://codecov.io/gh/Clariteia/minos_microservice_networks/branch/main/graph/badge.svg)](https://codecov.io/gh/Clariteia/minos_microservice_networks)

![Tests](https://github.com/Clariteia/minos_microservice_networks/actions/workflows/python-tests.yml/badge.svg)

Python Package with the common network classes and utlities used in Minos Microservice


Credits
-------

This package was created with ![Cookiecutter](https://github.com/audreyr/cookiecutter)
and the ![Minos Package](https://github.com/Clariteia/minos-pypackage) project template.
18 changes: 0 additions & 18 deletions README.rst

This file was deleted.

44 changes: 43 additions & 1 deletion minos/networks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
__version__ = '0.0.1.1-alpha'
"""
Copyright (C) 2021 Clariteia SL
This file is part of minos framework.
Minos framework can not be copied and/or distributed without the express permission of Clariteia SL.
"""
__version__ = "0.0.1"

from .broker import (
MinosCommandBroker,
MinosEventBroker,
MinosQueueDispatcher,
MinosQueueService,
)
from .exceptions import (
MinosNetworkException,
MinosPreviousVersionSnapshotException,
MinosSnapshotException,
)
from .handler import (
MinosCommandHandlerDispatcher,
MinosCommandHandlerServer,
MinosCommandPeriodicService,
MinosCommandReplyHandlerDispatcher,
MinosCommandReplyHandlerServer,
MinosCommandReplyPeriodicService,
MinosCommandReplyServerService,
MinosCommandServerService,
MinosEventHandlerDispatcher,
MinosEventHandlerServer,
MinosEventPeriodicService,
MinosEventServerService,
)
from .rest_interface import (
REST,
RestInterfaceHandler,
)
from .snapshots import (
MinosSnapshotDispatcher,
MinosSnapshotEntry,
MinosSnapshotService,
)
19 changes: 19 additions & 0 deletions minos/networks/broker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Copyright (C) 2021 Clariteia SL
This file is part of minos framework.
Minos framework can not be copied and/or distributed without the express permission of Clariteia SL.
"""
from .commands import (
MinosCommandBroker,
)
from .dispatchers import (
MinosQueueDispatcher,
)
from .events import (
MinosEventBroker,
)
from .services import (
MinosQueueService,
)
Loading

0 comments on commit 5735145

Please sign in to comment.