-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (55 loc) · 1.47 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
.PHONY: all environment install install-mac install-linux install-windows auto-lint validate test test-example coverage coverage-html coverage-xml coverage-erase generate-sample-data
CODE_COVERAGE ?= 90
OS ?= $(shell python -c 'import platform; print(platform.system())')
IS_64_BIT ?= $(shell python -c 'from sys import maxsize; print(maxsize > 2**32)')
all: environment install validate auto-lint
environment:
@echo 🔧 PIPENV SETUP
pip3 install pipenv
pipenv install --dev
install:
@echo 📦 Install Module
@echo Operating System identified as $(OS)
ifeq ($(OS), Linux)
make install-linux
endif
ifeq ($(OS), Darwin)
make install-mac
endif
ifeq ($(OS), Windows)
make install-windows
endif
ifeq ($(OS), Windows_NT)
make install-windows
endif
install-mac:
@echo 🍎 MACOS INSTALL
# install module
pipenv run python -m pip install -e .
install-linux:
@echo 🐧 LINUX INSTALL
# install module
pipenv run python -m pip install -e .
install-windows:
@echo 🏁 WINDOWS INSTALL
auto-lint:
@echo 💚 AUTO LINT
@echo Reformatting using Ruff
pipenv run ruff format
make lint
lint:
@echo 💚 LINT
@echo 1.Ruff Lint
pipenv run ruff check
@echo 2.Mypy Static Typing
pipenv run mypy src setup.py
validate:
@echo ✅ VALIDATE
@pipenv run python -c 'import shoe_backtest; print(shoe_backtest.__package__ + " successfully imported")'
script:
pipenv run python scripts/$(SCRIPT_NAME) $(ARGS)
test:
@echo ✅ ALL TESTS
@date -u
pipenv run pytest tests -s
$(MAKE) coverage