forked from fetchai/agents-aea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
130 lines (109 loc) · 3.05 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.PHONY: clean
clean: clean-build clean-pyc clean-test clean-docs
.PHONY: clean-build
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr pip-wheel-metadata
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -fr {} +
rm -fr Pipfile.lock
.PHONY: clean-docs
clean-docs:
rm -fr site/
.PHONY: clean-pyc
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name '.DS_Store' -exec rm -fr {} +
.PHONY: clean-test
clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr .coverage*
rm -fr coverage.xml
rm -fr htmlcov/
rm -fr .hypothesis
rm -fr .pytest_cache
rm -fr .mypy_cache/
rm -fr input_file
rm -fr output_file
find . -name 'log.txt' -exec rm -fr {} +
find . -name 'log.*.txt' -exec rm -fr {} +
.PHONY: lint
lint:
black aea benchmark examples packages scripts tests
flake8 aea benchmark examples packages scripts tests
.PHONY: pylint
pylint:
pylint aea benchmark examples packages scripts
.PHONY: security
security:
bandit -s B101 -r aea benchmark examples packages scripts tests
safety check -i 37524 -i 38038 -i 37776 -i 38039
.PHONY: static
static:
mypy aea benchmark examples packages scripts tests
.PHONY: misc_checks
misc_checks:
# pip install '.[all]'
# python scripts/freeze_dependencies.py -o requirements.txt
# liccheck -s strategy.ini -r requirements.txt -l PARANOID
# rm -fr requirements.txt
python scripts/check_copyright_notice.py
python scripts/generate_ipfs_hashes.py --check
python scripts/check_package_versions_in_docs.py
.PHONY: docs
docs:
mkdocs build --clean
.PHONY: common_checks
common_checks: security misc_checks lint static docs
.PHONY: test
test:
pytest --doctest-modules aea packages/fetchai/protocols packages/fetchai/connections tests/ --cov-report=html --cov-report=xml --cov-report=term --cov=aea --cov=packages/fetchai/protocols --cov=packages/fetchai/connections
rm -fr .coverage*
.PHONY: test-sub
test-sub:
#pytest --doctest-modules $(dir) $(tdir) --cov-report=html --cov-report=xml --cov-report=term --cov=$(dir)
pytest tests/test_$(tdir) --cov=aea.$(dir) --cov-report=html --cov-report=xml --cov-report=term
rm -fr .coverage*
.PHONY: test-all
test-all:
tox
.PHONY: install
install: clean
python3 setup.py install
.PHONY: dist
dist: clean
python setup.py sdist
python setup.py bdist_wheel
h := $(shell git rev-parse --abbrev-ref HEAD)
.PHONY: release_check
release:
if [ "$h" = "master" ];\
then\
echo "Please ensure everything is merged into master & tagged there";\
pip install twine;\
twine upload dist/*;\
else\
echo "Please change to master branch for release.";\
fi
v := $(shell pip -V | grep -r virtualenvs)
.PHONY: new_env
new_env: clean
if [ "$v" == "" ];\
then\
pipenv --rm;\
pipenv --python 3.7;\
echo "Enter clean virtual environment now: 'pipenv shell'.";\
else\
echo "In a virtual environment! Exit first: 'exit'.";\
fi
.PHONY: install_env
install_env:
pipenv install --dev --skip-lock
pip uninstall typing -y
pip install -e .[all]