You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+65-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Contributing
2
2
3
+
## Installation
4
+
3
5
After cloning this repo, create a [virtualenv](https://virtualenv.pypa.io/en/stable/) and ensure dependencies are installed by running:
4
6
5
7
```sh
@@ -30,4 +32,66 @@ If you wish to run against a specific version defined in the `tox.ini` file:
30
32
tox -e py36
31
33
```
32
34
33
-
Tox can only use whatever versions of Python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of Python on their own system ahead of time. We appreciate opening issues and pull requests to make PyMS even more stable & useful!
35
+
Tox can only use whatever versions of Python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of Python on their own system ahead of time.
36
+
37
+
## Pipenv
38
+
39
+
### Advantages over plain pip and requirements.txt
40
+
[Pipenv](https://pipenv.readthedocs.io/en/latest/) generates two files: a `Pipfile`and a `Pipfile.lock`.
41
+
*`Pipfile`: Is a high level declaration of the dependencies of your project. It can contain "dev" dependencies (usually test related stuff) and "standard" dependencies which are the ones you'll need for your project to function
42
+
*`Pipfile.lock`: Is the "list" of all the dependencies your Pipfile has installed, along with their version and their hashes. This prevents two things: Conflicts between dependencies and installing a malicious module.
43
+
44
+
### How to...
45
+
46
+
Here the most 'common' `pipenv` commands, for a more in-depth explanation please refer to the [official documentation](https://pipenv.readthedocs.io/en/latest/).
47
+
48
+
#### Install pipenv
49
+
```bash
50
+
pip install pipenv
51
+
```
52
+
53
+
#### Install dependencies defined in a Pipfile
54
+
```bash
55
+
pipenv install
56
+
```
57
+
58
+
#### Install both dev and "standard" dependencies defined in a Pipfile
59
+
```bash
60
+
pipenv install --dev
61
+
```
62
+
63
+
#### Install a new module
64
+
```bash
65
+
pipenv install django
66
+
```
67
+
68
+
#### Install a new dev module (usually test related stuff)
69
+
```bash
70
+
pipenv install nose --dev
71
+
```
72
+
73
+
#### Install dependencies in production
74
+
```bash
75
+
pipenv install --deploy
76
+
```
77
+
78
+
#### Start a shell
79
+
```bash
80
+
pipenv shell
81
+
```
82
+
83
+
## Documentation
84
+
85
+
This project use MkDocs
86
+
87
+
*`mkdocs new [dir-name]` - Create a new project.
88
+
*`mkdocs serve` - Start the live-reloading docs server.
89
+
*`mkdocs build` - Build the documentation site.
90
+
*`mkdocs help` - Print this help message.
91
+
92
+
### Project layout
93
+
94
+
mkdocs.yml # The configuration file.
95
+
docs/
96
+
index.md # The documentation homepage.
97
+
... # Other markdown pages, images and other files.
Copy file name to clipboardExpand all lines: README.md
+32-69
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,30 @@
10
10
PyMS, Python MicroService, is a collections of libraries, best practices and recommended ways to build
11
11
microservices with Python.
12
12
13
+
## Documentation
14
+
13
15
To know how use, install or build a project see the docs: https://py-ms.readthedocs.io/en/latest/
14
16
17
+
## Motivation
18
+
19
+
When we started to create microservice with no idea, we were looking for tutorials, guides, best practices, but we found
20
+
nothing to create professional projects. Most articles say:
21
+
- "Install flask"
22
+
- "Create routes"
23
+
- (Sometimes) "Create a swagger specs"
24
+
- "TA-DA! you have a microservice"
25
+
26
+
But... what happens with our configuration out of code like Kubernetes configmap? what happens with transactionality?
27
+
If we have many microservices, what happens with traces?.
28
+
29
+
There are many problems around Python and microservices and we can`t find anyone to give a solution.
30
+
31
+
We start creating these projects to try to solve all the problems we have found in our professional lives about
32
+
microservices architecture.
33
+
34
+
Nowadays, is not perfect and we have a looong roadmap, but we hope this library could help other felas and friends ;)
35
+
36
+
15
37
## Installation
16
38
```bash
17
39
pip install py-ms
@@ -23,80 +45,21 @@ pip install py-ms
23
45
Module to read yaml or json configuration from a dictionary or a path.
24
46
25
47
### pyms/flask/app
26
-
With the funcion `create_app` initialize the Flask app, register [blueprints](http://flask.pocoo.org/docs/0.12/blueprints/)
27
-
and intialize all libraries like Swagger, database, trace system, custom logger format, etc.
48
+
With the function `create_app` initialize the Flask app, register [blueprints](http://flask.pocoo.org/docs/0.12/blueprints/)
49
+
and initialize all libraries such as Swagger, database, trace system, custom logger format, etc.
50
+
51
+
### pyms/flask/services
52
+
Integrations and wrappers over common libs like request, swagger, connexion
28
53
29
54
### pyms/flask/healthcheck
30
-
This views is usually used by Kubernetes, Eureka and other systems to check if our application is up and running.
55
+
This view is usually used by Kubernetes, Eureka and other systems to check if our application is running.
31
56
32
57
### pyms/logger
33
58
Print logger in JSON format to send to server like Elasticsearch. Inject span traces in logger.
34
59
35
-
### pyms/rest_template
36
-
Encapsulate common rest operations between business services propagating trace headers if configured.
37
-
38
60
### pyms/tracer
39
-
Create an injector `flask_opentracing.FlaskTracer` to use in our projects
40
-
41
-
## Pipenv
42
-
43
-
### Advantages over plain pip and requirements.txt
44
-
[Pipenv](https://pipenv.readthedocs.io/en/latest/) generates two files: a `Pipfile`and a `Pipfile.lock`.
45
-
*`Pipfile`: Is a high level declaration of the dependencies of your project. It can contain "dev" dependencies (usually test related stuff) and "standard" dependencies which are the ones you'll need for your project to function
46
-
*`Pipfile.lock`: Is the "list" of all the dependencies your Pipfile has installed, along with their version and their hashes. This prevents two things: Conflicts between dependencies and installing a malicious module.
47
-
48
-
### How to...
49
-
50
-
Here the most 'common' `pipenv` commands, for a more in-depth explanation please refer to the [official documentation](https://pipenv.readthedocs.io/en/latest/).
51
-
52
-
#### Install pipenv
53
-
```bash
54
-
pip install pipenv
55
-
```
56
-
57
-
#### Install dependencies defined in a Pipfile
58
-
```bash
59
-
pipenv install
60
-
```
61
-
62
-
#### Install both dev and "standard" dependencies defined in a Pipfile
63
-
```bash
64
-
pipenv install --dev
65
-
```
66
-
67
-
#### Install a new module
68
-
```bash
69
-
pipenv install django
70
-
```
71
-
72
-
#### Install a new dev module (usually test related stuff)
73
-
```bash
74
-
pipenv install nose --dev
75
-
```
76
-
77
-
#### Install dependencies in production
78
-
```bash
79
-
pipenv install --deploy
80
-
```
81
-
82
-
#### Start a shell
83
-
```bash
84
-
pipenv shell
85
-
```
86
-
87
-
## Documentation
88
-
89
-
This project use MkDocs
90
-
91
-
*`mkdocs new [dir-name]` - Create a new project.
92
-
*`mkdocs serve` - Start the live-reloading docs server.
93
-
*`mkdocs build` - Build the documentation site.
94
-
*`mkdocs help` - Print this help message.
95
-
96
-
### Project layout
97
-
98
-
mkdocs.yml # The configuration file.
99
-
docs/
100
-
index.md # The documentation homepage.
101
-
... # Other markdown pages, images and other files.
61
+
Create an injector `flask_opentracing.FlaskTracer` to use in our projects.
102
62
63
+
## How To Contrib
64
+
We appreciate opening issues and pull requests to make PyMS even more stable & useful! See [This doc](COONTRIBUTING.md)
0 commit comments