-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from holgerson97/dev
Improved Makefile, venv,clean,tests,lint,format and help
- Loading branch information
Showing
1 changed file
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,57 @@ | ||
.PHONY: help prepare-dev run-dev | ||
.DEFAULT: help | ||
|
||
VENV_NAME?=venv | ||
VENV_ACTIVATE=. $(VENV_NAME)/bin/activate | ||
PYTHON=${VENV_NAME}/bin/python3 | ||
|
||
.PHONY: help | ||
help: | ||
# TODO add help | ||
@echo 'Makefile for "Auto README for Terraform"' | ||
@echo '' | ||
@echo ' prepare-dev - Installs required Python packages via Pip.' | ||
@echo ' run - Run main.py' | ||
@echo ' create-venv - Create virtual environment.' | ||
@echo ' remove-venv - Remove the virutal environment.' | ||
@echo ' lint - Run flake8 to lint your Python code.' | ||
@echo ' format - Run autopep8 to format Python code.' | ||
@echo ' all-tests - Run all tests in test files.' | ||
@echo ' clean - Clean Python cache files.' | ||
|
||
.PHONY: prepare-dev | ||
prepare-dev: | ||
# TODO add prepare-dev | ||
run-dev: | ||
pip3 install flake8 | ||
pip3 install autopep8 | ||
pip3 install virtualenv | ||
|
||
.PHONY: create-venv | ||
create-venv: | ||
virtualenv $(VENV_NAME) | ||
source $(VENV_ACTIVATE) | ||
pip3 install -r src/requirements.txt | ||
|
||
.PHONY: remove-venv | ||
remove-venv: | ||
rm -rf $(VENV_NAME) | ||
|
||
.PHONY: run-dev | ||
run: | ||
cd src; \ | ||
python3 main.py --path "../module" | ||
python3 main.py --path "../tests/" | ||
|
||
.PHONY: lint | ||
lint: | ||
flake8 src/ --ignore=E501,W504,E128 | ||
|
||
.PHONY: format | ||
format: | ||
autopep8 --in-place --aggressive --aggressive . | ||
|
||
.PHONY: all-tests | ||
all-tests: | ||
cd src; \ | ||
pytest | ||
|
||
.PHONY: clean | ||
clean: | ||
find -type d -name ".pytest_cache" -exec rm -rf {} + | ||
find -type d -name "__pycache__" -exec rm -rf {} + |