-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (42 loc) · 1.02 KB
/
Makefile
File metadata and controls
58 lines (42 loc) · 1.02 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
PYTEST_TEST=.
DOCEST_TEST=validator/
# files
RULES_IMPORT_GENERATOR_SCRIPT := utils/generate_rules_import.py
RULES_TEMPLATE_GENERATOR_SCRIPT := utils/generate_rule/generate_rule_sample.py
README_TEMPLATE_GENERATOR_SCRIPT := utils/readme/generate_readme.py
GENERATED_RULES_FILE := validator/rules.py
ifdef TEST
PYTEST_TEST=tests/rules/test_$(TEST).py
DOCEST_TEST=validator/rules_src/$(TEST).py
endif
init:
$(RULES_IMPORT_GENERATOR_SCRIPT) $(GENERATED_RULES_FILE)
clean:
git clean -Xdf
# Test with pytest test/ folder and doctests
test: doctest pytest check
doctest:
pytest --doctest-modules $(DOCEST_TEST)
@echo ""
pytest:
python3 -m pytest $(PYTEST_TEST)
@echo ""
# Check for formating
check:
black --check .
# Fix formating
fix:
black .
# Generate files
rule:
$(RULES_TEMPLATE_GENERATOR_SCRIPT) $(F_NAME)
make
readme: init
$(README_TEMPLATE_GENERATOR_SCRIPT)
# Upload to pip
pip-upload: init build-dist upload-dist
build-dist:
python3 setup.py bdist_wheel sdist
upload-dist:
twine upload dist/*
.PHONY: init test