Skip to content

Commit addbf98

Browse files
committed
format scripts and adding cli
1 parent 8596323 commit addbf98

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# python-devops-scaffolding
1+
# python-devops-walkthrough
22

33
1. create a python virtualenv `python -m venv ~/.venv` or `virtualenv ~/.venv`
44
2. create empty files `Makefile`, `requirements.txt`, `main.py`, `Dockerfile`, `lib/__init__.py`
55
3. populate `Makefile`
66
4. setup continuous integration, i.e. check for issues like lint errors
77
![testing_lint_step](https://github.com/user-attachments/assets/183073e5-18f0-49c7-8996-f9c4190c1a1d)
8+
9+
5. build a cli using python fire library `./cli-fire.py --help` to test logic

cli-fire.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
3+
import fire
4+
from mylib.logic import wiki
5+
6+
if __name__ == "__main__":
7+
fire.Fire(wiki)

mylib/logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import wikipedia
22

33

4-
def wiki(name='War Goddess', length=1):
4+
def wiki(name="War Goddess", length=1):
55
"""This is a wikipedia fetcher"""
66

77
my_wiki = wikipedia.summary(name, length)

0 commit comments

Comments
 (0)