Skip to content

Commit 6cf7e0e

Browse files
authored
Support registration in Consul and created a driver to connect other Services Discovery (#221)
* feat: added basic consul register * refactor!: init actions in services, not in create_app * chore: increment coverage tests * feat: Added py-ms-consulate package, a fork from https://github.com/gmr/consulate * tests: updated service discovery
1 parent 1fa9d99 commit 6cf7e0e

Some content is hidden

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

67 files changed

+1034
-675
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Lint with flake8
3737
run: |
3838
# stop the build if there are Python syntax errors or undefined names
39-
flake8 pyms --show-source --statistics --statistics
39+
flake8 pyms --show-source --statistics
4040
- name: Lint with pylint
4141
run: |
4242
pylint --rcfile=pylintrc pyms

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
files: .
7+

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ include requirements-tests.txt
44
recursive-include pyms *
55
recursive-exclude tests *
66
recursive-exclude examples *
7+
recursive-exclude docker *
78
prune tests
89
prune examples

Pipfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7-
py-ms = {editable = true,extras = ["tests"], path = "."}
7+
py-ms = {editable = true,extras = ["tests"],path = "."}
88

99
[packages]
10-
py-ms = {editable = true,extras = ["all"], path = "."}
10+
py-ms = {editable = true,extras = ["all"],path = "."}
11+
12+
[pipenv]
13+
allow_prereleases = true

Pipfile.lock

Lines changed: 200 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from examples.microservice_configuration import ms
2+
23
app = ms.create_app()
34

4-
if __name__ == '__main__':
5+
if __name__ == "__main__":
56
app.run()

examples/microservice_configuration/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ def example():
99
"GLOBAL_VARIABLE": GLOBAL_VARIABLE,
1010
"GLOBAL_VARIABLE2": GLOBAL_VARIABLE2,
1111
"test1": config().test1,
12-
"test2": config().test2
12+
"test2": config().test2,
1313
}

examples/microservice_crypt_aws_kms/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def example():
1111
return jsonify({"main": app.ms.config.encrypted_key})
1212

1313

14-
if __name__ == '__main__':
14+
if __name__ == "__main__":
1515
app.run()

examples/microservice_distribued_tracing/ms1/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import jsonify, current_app, request
1+
from flask import current_app, jsonify, request
22

33
from pyms.flask.app import Microservice
44

@@ -12,5 +12,5 @@ def index():
1212
return jsonify({"main": "hello world {}".format(current_app.config["APP_NAME"])})
1313

1414

15-
if __name__ == '__main__':
15+
if __name__ == "__main__":
1616
app.run()

examples/microservice_distribued_tracing/ms2/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ def index():
1313
return jsonify({"response": response.json()})
1414

1515

16-
if __name__ == '__main__':
16+
if __name__ == "__main__":
1717
app.run(port=5001)

0 commit comments

Comments
 (0)