-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
69 lines (63 loc) · 2.74 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
SHELL:=/bin/bash
PROJECT := aws-allowlister
PROJECT_UNDERSCORE := aws_allowlister
# ---------------------------------------------------------------------------------------------------------------------
# Environment setup and management
# ---------------------------------------------------------------------------------------------------------------------
setup-env:
pip3 install pipenv
pipenv install
setup-dev: setup-env
pipenv install --dev
clean:
rm -rf dist/
rm -rf build/
rm -rf *.egg-info
find . -name '*.pyc' -delete
find . -name '*.pyo' -delete
find . -name '*.egg-link' -delete
find . -name '*.pyc' -exec rm --force {} +
find . -name '*.pyo' -exec rm --force {} +
# ---------------------------------------------------------------------------------------------------------------------
# Python Testing
# ---------------------------------------------------------------------------------------------------------------------
test: setup-dev
pipenv run pytest -v
security-test: setup-dev
pipenv run bandit -r ./${PROJECT_UNDERSCORE}/
fmt: setup-dev
pipenv run black ${PROJECT_UNDERSCORE}/
lint: setup-dev
pipenv run pylint ${PROJECT_UNDERSCORE}/
# ---------------------------------------------------------------------------------------------------------------------
# Package building and publishing
# ---------------------------------------------------------------------------------------------------------------------
build: clean setup-env
python3 -m pip install --upgrade setuptools wheel
python3 -m setup -q sdist bdist_wheel
install: build
python3 -m pip install -q ./dist/${PROJECT}*.tar.gz
${PROJECT} --help
uninstall:
python3 -m pip uninstall ${PROJECT} -y
python3 -m pip uninstall -r requirements.txt -y
python3 -m pip uninstall -r requirements-dev.txt -y
python3 -m pip freeze | xargs python3 -m pip uninstall -y
publish: build
python3 -m pip install --upgrade twine
python3 -m twine upload dist/*
python3 -m pip install ${PROJECT}
# ---------------------------------------------------------------------------------------------------------------------
# Miscellaneous development
# ---------------------------------------------------------------------------------------------------------------------
count-loc:
echo "If you don't have tokei installed, you can install it with 'brew install tokei'"
echo "Website: https://github.com/XAMPPRocky/tokei#installation'"
tokei ./*
# ---------------------------------------------------------------------------------------------------------------------
# Repository specific
# ---------------------------------------------------------------------------------------------------------------------
generate-examples: setup-env install
sh utils/generate_new_scps.sh
update-data: setup-dev
python3 ./utils/update_data.py