-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pydantic based app settings Inject arguments to endpoints based on type annotations (FastAPI-like) Inject logger or other components using the same mechanics
- Loading branch information
1 parent
b9d2a85
commit 041dc93
Showing
50 changed files
with
2,660 additions
and
810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# COLORS | ||
GREEN := $(shell tput -Txterm setaf 2) | ||
WHITE := $(shell tput -Txterm setaf 7) | ||
YELLOW := $(shell tput -Txterm setaf 3) | ||
RESET := $(shell tput -Txterm sgr0) | ||
|
||
.DEFAULT_GOAL := help | ||
.PHONY: help setup run lint type flake8 mypy test testcov run clean | ||
|
||
VENV=.venv | ||
PYTHON=$(VENV)/bin/python3 | ||
|
||
## Initialize venv and install dependencies | ||
setup: $(VENV)/bin/activate | ||
$(VENV)/bin/activate: | ||
python3 -m venv $(VENV) | ||
$(PYTHON) -m pip install pipenv==2022.9.8 | ||
$(PYTHON) -m pipenv sync -d | ||
|
||
## Analyze project source code for slylistic errors | ||
lint: setup | ||
$(PYTHON) -m flake8 mela tests | ||
|
||
## Analyze project source code for typing errors | ||
type: setup | ||
$(PYTHON) -m mypy mela tests | ||
|
||
## Run flake8 | ||
flake8: setup | ||
$(PYTHON) -m flake8 mela tests | ||
|
||
## Run mypy | ||
mypy: setup | ||
$(PYTHON) -m mypy mela tests | ||
|
||
## Run project tests | ||
test: setup | ||
$(PYTHON) -m pytest | ||
|
||
## Run project tests and open HTML coverage report | ||
testcov: setup | ||
$(PYTHON) -m pytest --cov-report=html | ||
xdg-open htmlcov/index.html | ||
|
||
## Clean up project environment | ||
clean: | ||
rm -rf $(VENV) *.egg-info .eggs .coverage htmlcov .pytest_cache | ||
find . -type f -name '*.pyc' -delete | ||
|
||
## Show help | ||
help: | ||
@echo '' | ||
@echo 'Usage:' | ||
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}' | ||
@echo '' | ||
@echo 'Targets:' | ||
@awk '/^[a-zA-Z\-\_0-9]+:/ { \ | ||
helpMessage = match(lastLine, /^## (.*)/); \ | ||
if (helpMessage) { \ | ||
helpCommand = $$1; sub(/:$$/, "", helpCommand); \ | ||
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ | ||
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)15s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \ | ||
} \ | ||
} \ | ||
{ lastLine = $$0 }' $(MAKEFILE_LIST) | ||
@echo '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
aio-pika = "==8.2.1" | ||
envyaml = "==1.10.211231" | ||
pydantic = "==1.10.2" | ||
|
||
[dev-packages] | ||
flake8 = "==5.0.4" | ||
flake8-broken-line = "==0.5.0" | ||
flake8-commas = "==2.1.0" | ||
flake8-comprehensions = "==3.10.0" | ||
flake8-eradicate = "==1.3.0" | ||
flake8-isort = "==4.2.0" | ||
flake8-print = "==5.0.0" | ||
pep8-naming = "==0.13.2" | ||
flake8-bandit = "==4.1.1" | ||
flake8-use-fstring = "==1.4" | ||
bandit = "==1.7.4" | ||
mypy = "==0.971" | ||
pytest = "==7.1.3" | ||
pytest-cov = "==3.0.0" | ||
pytest-mock = "==3.8.2" | ||
pytest-asyncio = "==0.19.0" | ||
pytest-clarity = "==1.0.1" | ||
|
||
[requires] | ||
python_version = "3.10" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.11 | ||
1.1.0a1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,24 @@ | ||
connections: | ||
input_connection: | ||
host: ${RABBIT_INPUT_HOST} | ||
port: 5672 | ||
username: rabbitmq-bridge | ||
password: rabbitmq-bridge | ||
connTimeout: 1000 | ||
heartbeat: 360 | ||
host: $RABBIT_INPUT_HOST | ||
port: ${RABBIT_INPUT_PORT|5672} | ||
username: ${RABBIT_INPUT_USERNAME|rabbitmq-bridge} | ||
password: ${RABBIT_INPUT_PASSWORD|rabbitmq-bridge} | ||
output_connection: | ||
host: ${RABBIT_OUTPUT_HOST} | ||
port: 5672 | ||
username: rabbitmq-bridge | ||
password: rabbitmq-bridge | ||
connTimeout: 1000 | ||
heartbeat: 360 | ||
host: $RABBIT_OUTPUT_HOST | ||
port: ${RABBIT_OUTPUT_PORT|5672} | ||
username: ${RABBIT_OUTPUT_USERNAME|rabbitmq-bridge} | ||
password: ${RABBIT_OUTPUT_PASSWORD|rabbitmq-bridge} | ||
|
||
consumers: | ||
input: | ||
connection: input_connection | ||
prefetch_count: 100 | ||
routing_key: general-sentiment-q | ||
exchange: general-sentiment-x | ||
queue: general-sentiment-temp-q | ||
decode: json | ||
|
||
producers: | ||
output: | ||
connection: output_connection | ||
routing_key: general-sentiment-q | ||
exchange: general-sentiment-x | ||
services: | ||
bridge: | ||
consumer: | ||
connection: input_connection | ||
prefetch_count: ${RABBIT_INPUT_PREFETCH_COUNT|1} | ||
routing_key: ${RABBIT_INPUT_ROUTING_KEY} | ||
exchange: ${RABBIT_INPUT_EXCHANGE} | ||
queue: ${RABBIT_INPUT_QUEUE} | ||
producer: | ||
connection: output_connection | ||
routing_key: ${RABBIT_OUTPUT_ROUTING_KEY} | ||
exchange: ${RABBIT_OUTPUT_EXCHANGE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.