-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_world.py
44 lines (32 loc) · 1.22 KB
/
hello_world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Simple Python Hello World example using Docker
When running at the terminal virtual environment need the following:
export PYTHONPATH=${PYTHONPATH}:${PWD}
python3 ./app/hello_world.py
Example of formating project within virtual environment:
black ./app
Examples of running linting within virtual environment:
pylint --rcfile=setup.cfg app
bandit -r --ini setup.cfg
flake8 --config=setup.cfg app
black --check ./app
Makefile will have hints of how to run these commands in a CI/CD pipeline.
If a CI/CD pipeline is implemented, it is the centralized lint/test/build
enforcement of the project. Pre-commits are helpful for only the basics
in a distributed non-enforced manner.
"""
from lib.base_logger import getlogger
def main():
"""Simple main function"""
LOGGER.info("Hello world!!!") # pylint: disable=possibly-used-before-assignment
LOGGER.debug("Hello world!!!")
LOGGER.error("Hello world!!!")
LOGGER.warning("Hello world!!!")
LOGGER.critical("Hello world!!!")
LOGGER.trace("Hello world!!!")
LOGGER.success("Hello world!!!")
LOGGER.opt(colors=True).info("<green>Hello world!!!</green>")
print("Plain ole Hello world!!!")
if __name__ == "__main__":
LOGGER = getlogger("HelloWorld")
main()