-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (60 loc) · 2.29 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
SOURCE_DIR = ./deep_gw_pe_followup
.PHONY: clean help
BIN=venv/bin/
help:
clear;
@echo "================= Usage =================";
@echo "clean : Remove autogenerated folders";
@echo "clean-pyc : Remove python artifacts."
@echo "clean-build : Remove build artifacts."
@echo "bandit : Install and run bandit security analysis.";
@echo "mypy : Install and run mypy type checking.";
@echo "flake8 : Install and run flake8 linting.";
@echo "install_requirements : Install all the packages listed in txt files in requirements folder.";
@echo "test : Run tests and generate coverage report.";
@echo "build_whl : Build a python wheel package.";
@echo "venv : Build a python venv with pacakges installed.";
# Clean the folder from build/test related folders
clean: clean-build clean-pyc clean-macos-gunk
rm -rf .mypy_cache/ .pytest_cache/
rm -f .coverage
rm -rf venv
clean-macos-gunk:
find . -name '.DS_Store' -type f -delete
clean-pyc:
find . \( -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf {} +
clean-build:
rm -rf build/ dist/ *.egg-info
# Install all the packages listed in txt files in requirements folder.
install_requirements:
find ./requirements -maxdepth 1 -name '*.txt' -exec python -m pip install -r {} \;
# Install and run bandit security analysis
bandit:
python -m pip install bandit
bandit -r $(SOURCE_DIR)
# Install and run mypy type checking
mypy:
python -m pip install -r requirements/dev.txt
mypy $(SOURCE_DIR)
# Install and run flake8 linting
flake8:
python -m pip install flake8
flake8 $(SOURCE_DIR)
# Install requirements for testing and run tests
test:
python -m pip install -r requirements/dev.txt
python -m pip install -e .
pytest
# build wheel package
build_whl:
python setup.py bdist_wheel
install: venv
# : # Activate venv and install smthing inside
. venv/bin/activate && python setup.py develop
. venv/bin/activate && cd dependancies/bilby_pipe python setup.py develop
. venv/bin/activate && cd dependancies/parallel_bilby python setup.py develop
# : # Other commands here
venv:
: # Create venv if it doesn't exist
: # test -d venv || virtualenv -p python3 --no-site-packages venv
test -d venv || python -m venv venv