Skip to content

Commit

Permalink
Merge pull request #107 from douglasfarinelli/implements-dev-commands…
Browse files Browse the repository at this point in the history
…-for-makefile

Implements dev commands for makefile
  • Loading branch information
lamenezes committed Nov 1, 2017
2 parents c8266b8 + 62f47a4 commit ec23b78
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ lib
lib64
__pycache__

htmlcov
.coverage
.tox
.cache
.mypy_cache

pip-log.txt

Expand Down
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ matrix:
- python: '3.6.2'

install:
- pip install -rrequirements-test.txt
- pip install tox-travis
- pip install codecov
- pip install flake8
- pip install isort
- make install

before_script:
- isort --check --diff -rc correios tests
- flake8 --max-line-length=120 correios tests
- make lint

script:
- tox
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,41 @@
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

clean:
@find . -name "*.pyc" | xargs rm -rf
@find . -name "*.pyo" | xargs rm -rf
@find . -name "__pycache__" -type d | xargs rm -rf
@rm -f .coverage
@rm -rf htmlcov/
@rm -f coverage.xml
@rm -f *.log

outdated: ## Show outdated dependencies
@pip list --outdated --format=columns

install:
pip install -U -r requirements-dev.txt

check-types: ## Check type annotations
mypy correios --ignore-missing-imports --follow-imports=skip

flake:
flake8 --max-line-length=120 correios tests

isort: ## Check imports
isort --check --diff -rc correios tests

fix-imports: ## Fix imports
isort -rc .

lint: check-types flake isort ## Run code lint

test: clean lint ## Run tests
pytest -x

cov-test: clean lint ## Run coverage tests
pytest -x --cov=correios/ --cov-report=term-missing --cov-report=html:htmlcov

update-wsdl: ## Update wsdl files
@curl -o 'correios/wsdls/AtendeCliente-production.wsdl' 'https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl'
@curl -o 'correios/wsdls/AtendeCliente-test.wsdl' 'https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl'
Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
-r requirements-test.txt
bumpversion
isort
flake8
mypy
1 change: 0 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-r requirements.txt
factory-boy==2.8.1
mypy
pytest
pytest-cov
pytest-factoryboy
Expand Down

0 comments on commit ec23b78

Please sign in to comment.