Skip to content

Commit 87e180a

Browse files
committed
Makefile and scripts setup
1 parent 1a91fa2 commit 87e180a

File tree

7 files changed

+109
-2
lines changed

7 files changed

+109
-2
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
APP_NAME=pyflask-service
2+
APP_DIR=app
3+
TESTS_DIR=tests
4+
5+
# Signifies our desired python version
6+
# Makefile macros (or variables) are defined a little bit differently than traditional bash, keep in mind that in the Makefile there's top-level Makefile-only syntax, and everything else is bash script syntax.
7+
PYTHON = python3
8+
9+
# .PHONY defines parts of the makefile that are not dependant on any specific file
10+
# This is most often used to store functions
11+
.PHONY = help setup lint test debug clean
12+
13+
# Defining an array variable
14+
FILES = input output
15+
16+
# Defines the default target that `make` will to try to make, or in the case of a phony target, execute the specified commands
17+
# This target is executed whenever we just type `make`
18+
.DEFAULT_GOAL = help
19+
20+
# The @ makes sure that the command itself isn't echoed in the terminal
21+
help:
22+
@echo "-----------------------------Make help-----------------------------"
23+
@echo "make setup : Setup pyflask-service"
24+
@echo "make lint : Lint pyflask-service"
25+
@echo "make test : Test pyflask-service"
26+
@echo "make debug : Debug pyflask-service"
27+
@echo "make clean : Clean pyflask-service"
28+
@echo "make dev-run : Run pyflask-service in environment=development"
29+
@echo "make prod-run : Run pyflask-service in environment=prod"
30+
@echo "-------------------------------------------------------------------"
31+
32+
33+

requirements/dev-requirements.in

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions
2+
pylint
3+
# Black is the uncompromising Python code formatter
4+
black
5+
# Remove unused imports and unused variables from Python code
6+
autoflake
7+
# Sort imports alphabetically, and automatically separate into sections and by type
8+
isort
9+
# Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or "duck") typing and static typing
10+
mypy
11+
# Security oriented static analyser for python code
12+
bandit
13+
14+
# Flake8
15+
flake8
16+
flake8-flask
17+
flake8-blind-except
18+
flake8-breakpoint
19+
flake8-builtins
20+
flake8-comprehensions
21+
flake8-logging-format
22+
flake8-print
23+
flake8-pytest
24+
flake8-pytest-style
25+
flake8-return
26+
pep8-naming

requirements/dev-requirements.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,49 @@
44
#
55
# pip-compile --output-file=requirements/dev-requirements.txt requirements/dev-requirements.in
66
#
7+
appdirs==1.4.4 # via black
8+
astroid==2.4.2 # via pylint
9+
attrs==19.3.0 # via black
10+
autoflake==1.3.1 # via -r requirements/dev-requirements.in
11+
bandit==1.6.2 # via -r requirements/dev-requirements.in
12+
black==19.10b0 # via -r requirements/dev-requirements.in
13+
click==7.1.2 # via black
14+
flake8-blind-except==0.1.1 # via -r requirements/dev-requirements.in
15+
flake8-breakpoint==1.1.0 # via -r requirements/dev-requirements.in
16+
flake8-builtins==1.5.3 # via -r requirements/dev-requirements.in
17+
flake8-comprehensions==3.2.3 # via -r requirements/dev-requirements.in
18+
flake8-flask==0.9.3 # via -r requirements/dev-requirements.in
19+
flake8-logging-format==0.6.0 # via -r requirements/dev-requirements.in
20+
flake8-plugin-utils==1.3.1 # via flake8-breakpoint, flake8-pytest-style, flake8-return
21+
flake8-polyfill==1.0.2 # via pep8-naming
22+
flake8-print==3.1.4 # via -r requirements/dev-requirements.in
23+
flake8-pytest-style==1.2.3 # via -r requirements/dev-requirements.in
24+
flake8-pytest==1.3 # via -r requirements/dev-requirements.in
25+
flake8-return==1.1.2 # via -r requirements/dev-requirements.in
26+
flake8==3.8.3 # via -r requirements/dev-requirements.in, flake8-builtins, flake8-comprehensions, flake8-flask, flake8-polyfill, flake8-print, flake8-pytest
27+
gitdb==4.0.5 # via gitpython
28+
gitpython==3.1.7 # via bandit
29+
isort==4.3.21 # via -r requirements/dev-requirements.in, pylint
30+
lazy-object-proxy==1.4.3 # via astroid
31+
mccabe==0.6.1 # via flake8, pylint
32+
mypy-extensions==0.4.3 # via mypy
33+
mypy==0.782 # via -r requirements/dev-requirements.in
34+
pathspec==0.8.0 # via black
35+
pbr==5.4.5 # via stevedore
36+
pep8-naming==0.11.1 # via -r requirements/dev-requirements.in
37+
pycodestyle==2.6.0 # via flake8, flake8-print
38+
pyflakes==2.2.0 # via autoflake, flake8
39+
pylint==2.5.3 # via -r requirements/dev-requirements.in
40+
pyyaml==5.3.1 # via bandit
41+
r2c-py-ast==0.1.0b1 # via flake8-flask
42+
regex==2020.7.14 # via black
43+
six==1.15.0 # via astroid, bandit, flake8-print
44+
smmap==3.0.4 # via gitdb
45+
stevedore==3.2.0 # via bandit
46+
toml==0.10.1 # via black, pylint
47+
typed-ast==1.4.1 # via black, mypy
48+
typing-extensions==3.7.4.2 # via mypy
49+
wrapt==1.12.1 # via astroid
50+
51+
# The following packages are considered to be unsafe in a requirements file:
52+
# setuptools
File renamed without changes.

scripts/service_rename.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Use to change service related names in the complete project
3+
# Define service name
4+
# Define environment name

src/routes/health/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
def get_health():
1010
log.info("Request received : ping")
1111
return {"statusCode": 200}
12-

src/util/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
def has_no_empty_params(rule):
32
defaults = rule.defaults if rule.defaults is not None else ()
43
arguments = rule.arguments if rule.arguments is not None else ()

0 commit comments

Comments
 (0)