Skip to content

Commit 8c7feca

Browse files
authored
Moved docs to other repo (#230)
* docs: moved docs to other repo python-microservices/pyms#203 * docs: moved docs to other repo * refactor: removed requirements in dockerfile
1 parent 925eca3 commit 8c7feca

11 files changed

+15
-555
lines changed

CONTRIBUTING.md

+1-99
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,6 @@
11
# Contributing
22

3-
## Branch workflow
4-
5-
READ BEFORE CREATE A BRANCH OR OPEN A PR/MR
6-
- We use [Github Glow](https://guides.github.com/introduction/flow/)
7-
8-
## Commit Message Guidelines
9-
10-
- The messages of the commits use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
11-
- See [Angular guideline](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)
12-
13-
14-
## Installation
15-
16-
After cloning this repo, create a [virtualenv](https://virtualenv.pypa.io/en/stable/) and ensure dependencies are installed by running:
17-
18-
```sh
19-
virtualenv venv
20-
source venv/bin/activate
21-
pip install -r requirements-dev.txt
22-
```
23-
24-
Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
25-
26-
```sh
27-
pytest --cov=pyms --cov=tests tests/
28-
```
29-
30-
Add the `-s` flag if you have introduced breakpoints into the code for debugging.
31-
Add the `-v` ("verbose") flag to get more detailed test output. For even more detailed output, use `-vv`.
32-
Check out the [pytest documentation](https://docs.pytest.org/en/latest/) for more options and test running controls.
33-
34-
PyMS supports several versions of Python3. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each Python version and run tests with that version. To run against all Python versions defined in the `tox.ini` config file, just run:
35-
36-
```sh
37-
tox
38-
```
39-
40-
If you wish to run against a specific version defined in the `tox.ini` file:
41-
42-
```sh
43-
tox -e py36
44-
```
45-
46-
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.
47-
48-
## Pipenv
49-
50-
### Advantages over plain pip and requirements.txt
51-
[Pipenv](https://pipenv.readthedocs.io/en/latest/) generates two files: a `Pipfile`and a `Pipfile.lock`.
52-
* `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
53-
* `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.
54-
55-
### How to...
56-
57-
Here the most 'common' `pipenv` commands, for a more in-depth explanation please refer to the [official documentation](https://pipenv.readthedocs.io/en/latest/).
58-
59-
#### Install pipenv
60-
```bash
61-
pip install pipenv
62-
```
63-
64-
#### Install dependencies defined in a Pipfile
65-
```bash
66-
pipenv install
67-
```
68-
69-
#### Install both dev and "standard" dependencies defined in a Pipfile
70-
```bash
71-
pipenv install --dev
72-
```
73-
74-
#### Install a new module
75-
```bash
76-
pipenv install django
77-
```
78-
79-
#### Install a new dev module (usually test related stuff)
80-
```bash
81-
pipenv install nose --dev
82-
```
83-
84-
#### Install dependencies in production
85-
```bash
86-
pipenv install --deploy
87-
```
88-
89-
#### Start a shell
90-
```bash
91-
pipenv shell
92-
```
93-
94-
95-
## Black
96-
The code is formatted using [Black](https://github.com/psf/black).
97-
98-
### pre-commit
99-
To activate *black* before each commit, run `pre-commit install`.
100-
If any file is formatted before commit, you will need to add it again.
101-
3+
See this [webpage](https://python-microservices.github.io/contributing/)
1024

1035

1046
## Documentation

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ RUN chown -R python $APP_HOME
1313
WORKDIR $APP_HOME
1414
RUN pip install pipenv
1515
COPY Pipfile* /tmp/
16-
RUN cd /tmp && pipenv lock --requirements > requirements.txt
17-
RUN pip install -r /tmp/requirements.txt
16+
RUN cd /tmp && pipenv install --system
1817
RUN pip install gevent==1.2.2 gunicorn==19.7.1
1918
ADD . $APP_HOME
2019

README.md

+12-120
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
# microservices-scaffold
2-
Python Microservice Scaffold is an example of how to structure a Flask Microservice Project.
3-
This Scaffold is build over [PyMS](https://github.com/python-microservices/pyms) package. PyMS is a [Microservice chassis pattern](https://microservices.io/patterns/microservice-chassis.html)
4-
like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build
5-
microservices with Python which handles cross-cutting concerns:
6-
- Externalized configuration
7-
- Logging
8-
- Health checks
9-
- Metrics
10-
- Distributed tracing
112

123
![Python package](https://github.com/python-microservices/microservices-scaffold/workflows/Python%20package/badge.svg?branch=master)
134
[![Build Status](https://travis-ci.org/python-microservices/microservices-scaffold.svg?branch=master)](https://travis-ci.org/python-microservices/microservices-scaffold)
@@ -16,119 +7,20 @@ microservices with Python which handles cross-cutting concerns:
167
[![Updates](https://pyup.io/repos/github/python-microservices/microservices-scaffold/shield.svg)](https://pyup.io/repos/github/python-microservices/microservices-scaffold/)
178
[![Python 3](https://pyup.io/repos/github/python-microservices/microservices-scaffold/python-3-shield.svg)](https://pyup.io/repos/github/python-microservices/microservices-scaffold/)
189

19-
Table of Contents
20-
=================
21-
22-
* [microservices-scaffold](#microservices-scaffold)
23-
* [How to run the scaffold](#how-to-run-the-scaffold)
24-
* [Installation](#installation)
25-
* [Clone the repository](#clone-the-repository)
26-
* [Install with virtualenv](#install-with-virtualenv)
27-
* [Install with pipenv](#install-with-pipenv)
28-
* [Advantages over plain pip and requirements.txt](#advantages-over-plain-pip-and-requirementstxt)
29-
* [Run your python script](#run-your-python-script)
30-
* [Check the result](#check-the-result)
31-
* [Docker](#docker)
32-
* [Kubernetes](#kubernetes)
33-
* [How To contribute](#how-to-contribute)
34-
35-
# How to run the scaffold
36-
37-
## Installation
38-
39-
### Clone the repository
40-
41-
```bash
42-
git clone [email protected]:purwowd/microservices-scaffold.git
43-
cd microservices-scaffold
44-
```
45-
46-
### Install with virtualenv
47-
```bash
48-
virtualenv --python=python[3.6|3.7|3.8] venv
49-
source venv/bin/activate
50-
pip install -r requirements.txt
51-
```
52-
53-
### Install with pipenv
54-
```bash
55-
pip install pipenv
56-
pipenv install
57-
```
58-
59-
### Install on MacOS
60-
```bash
61-
virtualenv -p python3 venv
62-
source venv/bin/activate
63-
pip3 install -r requirements.txt
64-
python manage.py runserver
65-
```
66-
67-
#### Advantages over plain pip and requirements.txt
68-
[Pipenv](https://pipenv.readthedocs.io/en/latest/) generates two files: a `Pipfile`and a `Pipfile.lock`.
69-
* `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
70-
* `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.
71-
72-
For a more in-depth explanation please refer to the [official documentation](https://pipenv.readthedocs.io/en/latest/).
73-
74-
## Run your python script
75-
```bash
76-
python manage.py runserver
77-
```
78-
79-
80-
## Check the result
81-
82-
Your default endpoints will be in this url:
83-
```bash
84-
http://127.0.0.1:5000/films
85-
http://127.0.0.1:5000/actors
86-
```
87-
88-
This URL is set in your `config.yml`:
89-
90-
```yaml
91-
pyms:
92-
config:
93-
DEBUG: false
94-
TESTING: false
95-
APP_NAME: Template
96-
APPLICATION_ROOT : "" # <!---
97-
```
98-
99-
You can acceded to a [swagger ui](https://swagger.io/tools/swagger-ui/) in the next url:
100-
```bash
101-
http://127.0.0.1:5000/ui/
102-
```
103-
104-
This PATH is set in your `config.yml`:
105-
106-
```yaml
107-
pyms:
108-
services:
109-
swagger:
110-
path: "swagger"
111-
file: "swagger.yaml"
112-
url: "/ui/" # <!---
113-
```
114-
115-
Read more info in the documentation page:
116-
https://microservices-scaffold.readthedocs.io/en/latest/
117-
118-
# Docker
119-
You can dockerize this microservice with these steps:
120-
* Create and push the image
121-
122-
docker build -t films -f Dockerfile .
123-
* Run the image:
10+
Python Microservice Scaffold is an example of how to structure a Flask Microservice Project.
11+
This Scaffold is build over [PyMS](https://github.com/python-microservices/pyms) package. PyMS is a
12+
[Microservice chassis pattern](https://microservices.io/patterns/microservice-chassis.html)
13+
like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build
14+
microservices with Python which handles cross-cutting concerns:
15+
- Externalized configuration
16+
- Logging
17+
- Health checks
18+
- Metrics
19+
- Distributed tracing
12420

125-
docker run -d -p 5000:5000 films
126-
127-
128-
# Kubernetes
129-
You can run this microservice in a Kubernetes cluster with:
21+
## Quickstart
13022

131-
kubectl apply -f service.yaml
23+
See our [quickstart webpage](https://python-microservices.github.io/scaffold/quickstart/)
13224

13325
# How To contribute
13426

docs/codeexample.rst

-8
This file was deleted.

docs/configuration.rst

-28
This file was deleted.

docs/index.rst

+1-35
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,5 @@
44
55
Python Microservices
66
====================
7-
Python Microservice Scaffold is an example of how to structure a Flask Microservice Project.
8-
This Scaffold is build over `PyMS <https://github.com/python-microservices/pyms>`_ package. PyMS is a `Microservice chassis pattern <https://microservices.io/patterns/microservice-chassis.html>`_
9-
like Spring Boot (Java) or Gizmo (Golang). PyMS is a collection of libraries, best practices and recommended ways to build
10-
microservices with Python which handles cross-cutting concerns:
7+
Documentation moved to `https://python-microservices.github.io/ <https://python-microservices.github.io/>`_
118

12-
* Externalized configuration
13-
* Logging
14-
* Health checks
15-
* Metrics
16-
* Distributed tracing
17-
18-
19-
Stack
20-
-----
21-
* `PyMS <https://github.com/python-microservices/pyms>`_
22-
* `Flask <https://github.com/pallets/flask>`_
23-
* `connexion <http://connexion.readthedocs.io>`_
24-
* `Opentracing <https://github.com/opentracing-contrib/python-flask>`_
25-
* `SQLAlchemy <https://www.sqlalchemy.org/>`_
26-
* `Flask-SQLAlchemy <http://flask-sqlalchemy.pocoo.org/2.3/>`_
27-
* `Flask-Script <https://flask-script.readthedocs.io/en/latest/>`_
28-
29-
30-
31-
Content
32-
-------
33-
.. toctree::
34-
:maxdepth: 4
35-
36-
installation
37-
quickstart
38-
structure
39-
configuration
40-
codeexample
41-
project
42-
runinkubernetes

docs/installation.rst

-39
This file was deleted.

docs/project.rst

-8
This file was deleted.

0 commit comments

Comments
 (0)