-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (58 loc) Β· 1.57 KB
/
Makefile
File metadata and controls
76 lines (58 loc) Β· 1.57 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
64
65
66
67
68
69
70
71
72
73
74
75
76
DC_FILE := docker-compose.yml
DC := docker-compose -f $(DC_FILE)
.PHONY: run up down build rebuild test lint clean install
run-crawl:
poetry run python run_crawler.py crawl
run-search:
poetry run python run_crawler.py search "$(QUERY)"
run-stats:
poetry run python run_crawler.py stats
run-generate-samples:
poetry run python run_crawler.py generate-samples
up:
$(DC) up
up-detached:
$(DC) up -d
down:
$(DC) down
build:
$(DC) build
rebuild:
$(MAKE) down
$(MAKE) build
$(MAKE) up
fix:
poetry run ruff check . --fix
lint:
poetry run ruff check .
poetry run mypy .
format:
poetry run ruff format .
test:
poetry run pytest
test-cov:
poetry run pytest --cov=app --cov-report=html
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.db" -delete
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf htmlcov
install:
poetry install
poetry run pre-commit install
help:
@echo "Available commands:"
@echo " run-crawl - Run crawler"
@echo " run-search QUERY=... - Search documents"
@echo " run-stats - Show database statistics"
@echo " run-generate-samples - Generate test files"
@echo " up - Start Docker container"
@echo " down - Stop Docker container"
@echo " build - Build Docker image"
@echo " lint - Run linters"
@echo " format - Format code"
@echo " test - Run tests"
@echo " clean - Clean cache files"
@echo " install - Install dependencies"