-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (48 loc) · 1.74 KB
/
Makefile
File metadata and controls
67 lines (48 loc) · 1.74 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
VIRTUALENV ?= ~/.virtualenv
REPORTS ?= reports
DOCS ?= docs
default: clean test
all: $(TARGETS)
clean: ## Clean all build files
-@echo y | pip uninstall data-migrator
@rm -rf $(DOCS)/_build
@rm -rf $(REPORTS)
@find . -name *.pyc -delete
@rm -rf build data_migrator.egg* dist
-@rm -f .coverage
.PHONY: test dist docs version help
version: ## Show current version
@python -c "import data_migrator; print(data_migrator.__version__)"
bandit: | $(REPORTS) ## Do bandit security check
@bandit --ini ./.bandit -r ./src --format json -o $(REPORTS)/bandit.json
test: test_circleci ## Run all tests
@python -m unittest discover -s tests
test_circleci: ./.circleci/config.yml
@python -c "import yaml;yaml.load(open('./.circleci/config.yml'))" 2>/dev/null || echo "\033[0;31mERROR in circle-ci config file\033[0m"
dist: ## Create a distribution
@python setup.py sdist --formats=gztar bdist_wheel
dev: ## Install this package for development
@pip install -e .
dev_env: ## Install the dev env
@pip install -r py.requirements/docs.txt
@pip install -r py.requirements/environment.txt
@pip install -r py.requirements/runtime.txt
tox: ## Run tox
tox -e py27,py36,docs
coverage: | $(REPORTS) ## Check test coverage
coverage run -m unittest discover -s tests/
coverage xml -o $(REPORTS)/coverage.xml
python-codacy-coverage -r $(REPORTS)/coverage.xml
docs: ## Run documentation
cd $(DOCS) && make html
virtualenv: $(VIRTUALENV)/dm/bin/activate
virtualenv $(VIRTUALENV)/dm
upload: ## Upload latest release to pypi
twine upload dist/*
drop:
bumpversion drop --commit
$(REPORTS):
mkdir -p $@
help: ## Shows help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
@echo ""