Skip to content

Commit 13ce336

Browse files
authored
* Updated requirements * Fix docker configuration * Fix swagger yaml * Fix tests
1 parent 76a0ca0 commit 13ce336

9 files changed

+333
-284
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ RUN apk add --update curl gcc g++ git libffi-dev openssl-dev python3-dev build-b
44
&& rm -rf /var/cache/apk/*
55
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
66

7-
ENV PYTHONUNBUFFERED=1 ENVIRONMENT=pre APP_HOME=/microservice/
7+
ENV PYTHONUNBUFFERED=1 APP_HOME=/microservice/
88
ENV DATABASE_DIR=database
99
ENV CONFIGMAP_FILE="$APP_HOME"config-docker.yml
1010
RUN mkdir $APP_HOME && adduser -S -D -H python

Pipfile

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
Flask-SQLAlchemy = "==2.4.1"
8-
SQLAlchemy = "==1.3.16"
7+
Flask-SQLAlchemy = "==2.4.4"
8+
SQLAlchemy = "==1.3.19"
99
Flask-Script = "==2.0.6"
10-
py-ms = {extras = ["all"],version = "==2.4.0"}
11-
marshmallow = "==3.5.1"
12-
marshmallow-sqlalchemy = "==0.22.3"
10+
py-ms = {extras = ["all"],version = "==2.6.1"}
11+
marshmallow = "==3.8.0"
12+
marshmallow-sqlalchemy = "==0.23.1"
1313

1414
[dev-packages]
1515
requests-mock = "*"
1616
coverage = "==4.5.4"
17-
pytest = "*"
18-
pytest-cov = "*"
17+
pytest = ">=5.4.3"
18+
pytest-cov = ">=2.9.0"
1919
pylint = "*"
2020
flake8 = "*"
2121
tox = "*"

Pipfile.lock

+295-257
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config-docker.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ pyms:
55
swagger:
66
path: "swagger"
77
file: "swagger.yaml"
8+
url: "/ui/"
9+
project_dir: "project.views"
810
tracer:
911
client: "jaeger"
1012
host: "localhost"
1113
component_name: "Python Microservice"
1214
config:
1315
DEBUG: false
1416
TESTING: false
15-
APP_NAME: Template
16-
APPLICATION_ROOT : /template
17+
APP_NAME: Films&Actors
18+
APPLICATION_ROOT : ""
1719
SQLALCHEMY_TRACK_MODIFICATIONS: true
1820
SECRET_KEY: "gjr39dkjn344_!67#"
1921
DATABASE: db.sqlite3

docs/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Or innstall with pipenv
2626
Advantages over plain pip and requirements.txt
2727
----------------------------------------------
2828

29-
Pipenv generates two files: a `Pipfile`and a `Pipfile.lock`.
29+
Pipenv generates two files: a `Pipfile` and a `Pipfile.lock`.
3030

3131
* `Pipfile`: Is a high level declaration of the dependencies of your project. It can contain "dev" dependencies
3232
(usually test related stuff) and "standard" dependencies which are the ones you'll need for your project to function

project/swagger/swagger.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ paths:
4242
schema:
4343
$ref: "#/definitions/Actor"
4444
responses:
45-
200:
45+
"200":
4646
description: "The actor created"
4747
schema:
4848
$ref: '#/definitions/Actor'
49-
405:
49+
"405":
5050
description: "Invalid input"
5151
get:
5252
tags:
@@ -58,15 +58,15 @@ paths:
5858
produces:
5959
- "application/json"
6060
responses:
61-
200:
61+
"200":
6262
description: "A list of actors"
6363
schema:
6464
$ref: '#/definitions/Actors'
65-
400:
65+
"400":
6666
description: "Invalid ID supplied"
67-
404:
67+
"404":
6868
description: "Actor not found"
69-
405:
69+
"405":
7070
description: "Validation exception"
7171
/films:
7272
post:
@@ -86,11 +86,11 @@ paths:
8686
schema:
8787
$ref: "#/definitions/Film"
8888
responses:
89-
200:
89+
"200":
9090
description: "The film created"
9191
schema:
9292
$ref: '#/definitions/Film'
93-
405:
93+
"405":
9494
description: "Invalid input"
9595
get:
9696
tags:
@@ -102,15 +102,15 @@ paths:
102102
produces:
103103
- "application/json"
104104
responses:
105-
200:
105+
"200":
106106
description: "A list of actors"
107107
schema:
108108
$ref: '#/definitions/Films'
109-
400:
109+
"400":
110110
description: "Invalid ID supplied"
111-
404:
111+
"404":
112112
description: "Actor not found"
113-
405:
113+
"405":
114114
description: "Validation exception"
115115
/films/{id}:
116116
put:
@@ -135,11 +135,11 @@ paths:
135135
schema:
136136
$ref: "#/definitions/Film"
137137
responses:
138-
200:
138+
"200":
139139
description: "The film created"
140140
schema:
141141
$ref: '#/definitions/Film'
142-
405:
142+
"405":
143143
description: "Invalid input"
144144
definitions:
145145
Actor:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Flask-SQLAlchemy==2.4.4
22
SQLAlchemy==1.3.19
33
Flask-Script==2.0.6
4-
py-ms[all]==2.6.0
4+
py-ms[all]==2.6.1
55
marshmallow==3.8.0
66
marshmallow-sqlalchemy==0.23.1

setup.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[aliases]
2+
test=pytest
3+
4+
[tool:pytest]
5+
addopts = --cov=project --cov=tests tests/

setup.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
platforms=["any"],
3939
keywords="python, microservices",
4040
url='https://github.com/python-microservices/microservices-scaffold',
41-
packages=find_packages(),
41+
packages=find_packages(
42+
exclude=['*.tests', '*.tests.*', 'tests.*', 'tests', '*.examples', '*.examples.*', 'examples.*', 'examples']),
43+
setup_requires=[
44+
'pytest-runner>=2.0,<3dev',
45+
],
4246
include_package_data=True,
4347
)

0 commit comments

Comments
 (0)