Skip to content

Commit

Permalink
Merge pull request #387 from minos-framework/0.7.0.dev1
Browse files Browse the repository at this point in the history
0.7.0.dev1
  • Loading branch information
Sergio García Prado authored Apr 11, 2022
2 parents 72cd513 + 061baca commit 94dd238
Show file tree
Hide file tree
Showing 242 changed files with 4,251 additions and 10,211 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/minos-discovery-kong-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Publish: minos-discovery-kong"

on:
push:
branches:
- '*.*.x'
paths:
- 'packages/plugins/minos-discovery-kong/**'

jobs:
deploy:
runs-on: ubuntu-latest
container: python:3.9-buster
defaults:
run:
working-directory: packages/plugins/minos-discovery-kong

steps:

- name: Check out repository code
uses: actions/checkout@v2

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: make install

- name: Publish package
run: make release
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
86 changes: 86 additions & 0 deletions .github/workflows/minos-discovery-kong-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "Test: minos-discovery-kong"

on:
push:
branches:
- main
- '*.*.x'
pull_request:
paths:
- 'packages/plugins/minos-discovery-kong/**'
- 'packages/core/minos-microservice-networks/**'
- 'packages/core/minos-microservice-common/**'

jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-buster
services:
postgres:
image: postgres:9.5
env:
POSTGRES_DB: kong
POSTGRES_USER: kong
POSTGRES_PASSWORD: kong
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
defaults:
run:
working-directory: packages/plugins/minos-discovery-kong

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Install dependencies
run: apt install -y curl apt-transport-https

- name: Update apt list
run: echo "deb [trusted=yes] https://download.konghq.com/gateway-2.x-debian-buster/ default all" | tee /etc/apt/sources.list.d/kong.list

- name: Install kong
run: apt-get update && apt install -y kong-enterprise-edition=2.8.0.0

- name: Set env variables
run: |
echo "KONG_DATABASE=postgres" >> $GITHUB_ENV
echo "KONG_PG_DATABASE=kong" >> $GITHUB_ENV
echo "KONG_PG_HOST=postgres" >> $GITHUB_ENV
echo "KONG_PG_USER=kong" >> $GITHUB_ENV
echo "KONG_PG_PASSWORD=kong" >> $GITHUB_ENV
echo "KONG_ADMIN_ACCESS_LOG=/dev/stdout" >> $GITHUB_ENV
echo "KONG_ADMIN_ERROR_LOG=/dev/stderr" >> $GITHUB_ENV
echo "KONG_PROXY_LISTEN=0.0.0.0:8000" >> $GITHUB_ENV
echo "KONG_ADMIN_LISTEN=0.0.0.0:8001" >> $GITHUB_ENV
echo "KONG_PROXY_ACCESS_LOG=/dev/stdout" >> $GITHUB_ENV
echo "KONG_PROXY_ERROR_LOG=/dev/stderr" >> $GITHUB_ENV
echo "KONG_LOG_LEVEL=debug" >> $GITHUB_ENV
- name: Kong Migration
run: kong migrations bootstrap && kong migrations up && kong migrations finish

- name: Kong Start
run: kong start

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: make install

- name: Lint package
run: make lint

- name: Test package with coverage
run: make coverage

- name: Publish coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/plugins/minos-discovery-kong/coverage.xml
fail_ci_if_error: true

- name: Generate build
run: make dist
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ $RECYCLE.BIN/
*.lmdb

# Sphinx Api Documentation
**/docs/api*
**/docs/api-reference*
**/docs/_build

tutorials/stock-wallet/front/stock-front
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ repos:
files: ^packages/plugins/minos-discovery-minos/
language: system

- id: minos-discovery-kong-check
pass_filenames: false
entry: make --directory=packages/plugins/minos-discovery-kong check
name: Check minos-discovery-kong
files: ^packages/plugins/minos-discovery-kong/
language: system

- id: minos-http-aiohttp-check
pass_filenames: false
entry: make --directory=packages/plugins/minos-http-aiohttp check
Expand Down
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# How to contribute

Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull
request with new features, or the creation of an issue related to a bug you have found.
Minos being an open-source project, we are looking forward to having your contributions. No matter whether it is a pull request with new features, or the creation of an issue related to a bug you have found.

Please consider these guidelines before you submit any modification.

Create an issue
----------------
## Create an issue

1. If you happen to find a bug, please file a new issue filling the 'Bug report' template.
2. Set the appropriate labels, so we can categorise it easily.
3. Wait for any core developer's feedback on it.

Submit a Pull Request
-----------------------
## Submit a Pull Request

1. Create an issue following the previous steps.
2. Fork the project.
3. Push your changes to a local branch.
Expand Down
35 changes: 1 addition & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,5 @@ install:
poetry install

docs:
mkdir -p $(DOCS_TARGET)/core
mkdir -p $(DOCS_TARGET)/plugins

$(MAKE) --directory=packages/core/minos-microservice-aggregate install docs
cp -R packages/core/minos-microservice-aggregate/docs/_build/html $(DOCS_TARGET)/core/minos-microservice-aggregate

$(MAKE) --directory=packages/core/minos-microservice-common install docs
cp -R packages/core/minos-microservice-common/docs/_build/html $(DOCS_TARGET)/core/minos-microservice-common

$(MAKE) --directory=packages/core/minos-microservice-cqrs install docs
cp -R packages/core/minos-microservice-cqrs/docs/_build/html $(DOCS_TARGET)/core/minos-microservice-cqrs

$(MAKE) --directory=packages/core/minos-microservice-networks install docs
cp -R packages/core/minos-microservice-networks/docs/_build/html $(DOCS_TARGET)/core/minos-microservice-networks

$(MAKE) --directory=packages/core/minos-microservice-saga install docs
cp -R packages/core/minos-microservice-saga/docs/_build/html $(DOCS_TARGET)/core/minos-microservice-saga

$(MAKE) --directory=packages/plugins/minos-broker-kafka install docs
cp -R packages/plugins/minos-broker-kafka/docs/_build/html $(DOCS_TARGET)/plugins/minos-broker-kafka

$(MAKE) --directory=packages/plugins/minos-broker-rabbitmq install docs
cp -R packages/plugins/minos-broker-rabbitmq/docs/_build/html $(DOCS_TARGET)/plugins/minos-broker-rabbitmq

$(MAKE) --directory=packages/plugins/minos-discovery-minos install docs
cp -R packages/plugins/minos-discovery-minos/docs/_build/html $(DOCS_TARGET)/plugins/minos-discovery-minos

$(MAKE) --directory=packages/plugins/minos-http-aiohttp install docs
cp -R packages/plugins/minos-http-aiohttp/docs/_build/html $(DOCS_TARGET)/plugins/minos-http-aiohttp

$(MAKE) --directory=packages/plugins/minos-router-graphql install docs
cp -R packages/plugins/minos-router-graphql/docs/_build/html $(DOCS_TARGET)/plugins/minos-router-graphql


rm -rf docs/api-reference
poetry run $(MAKE) --directory=docs html
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# minos-python: The framework which helps you create reactive microservices in Python

[![GitHub Repo stars](https://img.shields.io/github/stars/minos-framework/minos-python?label=GitHub)]
[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg)](https://pypi.org/project/minos-microservice-common/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python)
[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE)
Expand Down
5 changes: 2 additions & 3 deletions ...ore/minos-microservice-aggregate/SETUP.md → SETUP.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Set up a development environment
=================================
# Set up a development environment

Since we use `poetry` as the default package manager, it must be installed. Please refer to
`https://python-poetry.org/docs/#installation`.

Run `poetry install` to get the dependencies.

Run `pre-commit install` to set the git checks before commiting.
Run `pre-commit install` to set the git checks before committing.

Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide.
8 changes: 8 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.wy-nav-content {
max-width: 1200px !important;
}

dl[class*="py"] {
display: block !important;
}

dl[class*="py"] > dt {
display: block !important;
}
68 changes: 45 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,60 @@
import os
import sys
from datetime import datetime

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

import sphinx_rtd_theme # noqa
from minos import common

exclude_patterns = [
"standard/docs/*.md", # FIXME: Include these directories.
"standard/docs/architecture/*.md", # FIXME: Include these directories.
"_build",
"Thumbs.db",
".DS_Store",
]

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx_rtd_theme",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"m2r2",
]
templates_path = ["_templates"]
source_suffix = [".rst", ".md"]

source_suffix = ['.rst', '.md']

master_doc = 'index'

project = 'Minos Python'
copyright = "2021, Clariteia"
master_doc = "index"
project = "minos-python"
copyright = f"2021-{datetime.now().year}, Clariteia"
author = "Minos Framework Devs"

language = None

templates_path = ['_templates']

exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

pygments_style = 'sphinx'

todo_include_todos = False

html_theme = 'sphinx_rtd_theme'

html_extra_path = ['api-reference']
version = common.__version__
release = common.__version__

html_theme = "sphinx_rtd_theme"
html_sidebars = {"**": ["about.html", "navigation.html", "searchbox.html"]}

html_static_path = ["_static"]

autodoc_default_options = {
"members": True,
"undoc-members": True,
"inherited-members": True,
"show-inheritance": True,
"member-order": "bysource",
}
autodoc_mock_imports = [
"unittest",
]

autoclass_content = "class"
autodoc_class_signature = "separated"
autodoc_member_order = "bysource"
autodoc_typehints_format = "short"
autodoc_typehints = "description"
autodoc_preserve_defaults = True
add_module_names = False
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}
autosummary_generate = True
43 changes: 42 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
.. mdinclude:: ../README.md
<p align="center">
<a href="https://minos.run" target="_blank"><img src="https://raw.githubusercontent.com/minos-framework/.github/main/images/logo.png" alt="Minos logo"></a>
</p>

# minos-python: The framework which helps you create reactive microservices in Python

[![GitHub Repo stars](https://img.shields.io/github/stars/minos-framework/minos-python?label=GitHub)](https://github.com/minos-framework/minos-python/stargazers)
[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-microservice-common.svg)](https://pypi.org/project/minos-microservice-common/)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python)
[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE)
[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python)
[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minos-framework/community)
[![Tokei](https://tokei.rs/b1/github/minos-framework/minos-python?category=code)](https://github.com/minos-framework/minos-python)

## Summary

Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python. Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an asynchronous environment.


## API Reference

.. autosummary::
:toctree: api-reference
:recursive:

minos.aggregate
minos.common
minos.cqrs
minos.networks
minos.saga
minos.plugins.kafka
minos.plugins.rabbitmq
minos.plugins.minos_discovery
minos.plugins.kong
minos.plugins.aiohttp
minos.plugins.graphql

## Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
9 changes: 3 additions & 6 deletions packages/core/minos-microservice-aggregate/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,21 @@
* Rename `TransactionService` command topics to avoid collisions with application-level topics.
* Minor changes.

0.5.3 (2022-03-04)
------------------
## 0.5.3 (2022-03-04)

* Add `RefException` to be raised when some reference cannot be resolved.
* Improve attribute and item accessors of `Ref`, `Event` and `FieldDiffContainer`
* Deprecate `Event.get_one` in favor of `Event.get_field`.
* Deprecate `Event.get_all` in favor of `Event.get_fields`.

0.5.4 (2022-03-07)
------------------
## 0.5.4 (2022-03-07)

* Fix bug related with `Ref.resolve`.
* Add `RefResolver.build_topic_name` static method.
* Remove `SnapshotService.__get_one__` method.
* Minor changes.

0.6.0 (2022-03-28)
------------------
## 0.6.0 (2022-03-28)

* Replace `dependency-injector`'s injection classes by the ones provided by the `minos.common.injections` module.
* Be compatible with latest `minos.common.Config` API.
Loading

0 comments on commit 94dd238

Please sign in to comment.