-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.36 KB
/
Makefile
File metadata and controls
63 lines (49 loc) · 1.36 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
# ==========================================================
SHELL := /bin/bash -l
export SHELL
VENV := ./vtmp/
export VENV
# tested on 3.10-3.14
MIN_PYTHON_VERSION := $(shell basename $$( ls /usr/bin/python3.[0-9][0-9] | awk '{print $0; exit}' ) )
export MIN_PYTHON_VERSION
PIP_INSTALL := pip3 -q \
--require-virtualenv \
--disable-pip-version-check \
--no-color install --no-cache-dir
# ==========================================
# Code formatting and checks
PY_FILES := *.py whoisdomain/
# LINE_LENGTH := 160
MYPY_INSTALL := \
types-requests \
types-python-dateutil redis tld
COMMON_VENV := rm -rf $(VENV); \
$(MIN_PYTHON_VERSION) -m venv $(VENV); \
source ./$(VENV)/bin/activate;
# --------------------------------------------------
# reformat, lint and verify basics
# --------------------------------------------------
prep: clean format check mypy
clean:
rm -rf tmp/* 1 2 out *.out *.1 *.2
rm -rf $(VENV)
rm -f ./rl-secure-list-*.txt
rm -f ./rl-secure-status-*.txt
format:
ruff format $(PY_FILES)
check:
ruff check --fix $(PY_FILES)
mypy:
$(COMMON_VENV) \
$(PIP_INSTALL) mypy $(MYPY_INSTALL); \
mypy \
--strict \
--no-incremental \
$(PY_FILES) | tee [email protected]
# this step creates or updates the toml file
build:
./bin/build.sh
./bin/testLocalWhl.sh 2>tmp/[email protected] | tee tmp/[email protected]
./bin/test.sh 2>tmp/[email protected] | tee -a tmp/[email protected]
test:
make -f Makefile.tests