diff --git a/.gitignore b/.gitignore index 205abbb..4fc828a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__/ +.venv/ backup_tool diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f557eb5 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# =====CONFIG===== +# Devop environment runs in 3.8 +PYTHON=python3.8 + + +# =====RECIPES===== +.venv/bin/activate: requirements.txt requirements-dev.txt + '$(PYTHON)' -m venv .venv + .venv/bin/pip install -r requirements.txt -r requirements-dev.txt + +venv: .venv/bin/python +.PHONY: venv + +format: venv + @ .venv/bin/black app/*.py app/**/*.py +.PHONY: format + +clean: + rm -rf .venv + rm backup_tool +.PHONY: clean + +backup_tool: + @ cd app && \ + zip -r ../app.zip * \ + -x "__pycache__/*" "**/__pycache__/*" ".vim/*" "**/.vim/*" + @ echo "#!/usr/bin/env python3" | cat - app.zip > backup_tool + @ chmod a+x backup_tool + @ rm app.zip + +app: backup_tool +.PHONY: app + +install: app + cp backup_tool /usr/local/bin diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a8f43fe --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 79 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..3eed54f --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,10 @@ +# Language server +jedi==0.18.0 + +# Linting & Formatting +black==20.8b1 +flake8==3.8.4 + +# Testing +tox==3.21.1 +pytest==6.2.1 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29