Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
52 lines (41 loc) · 1.63 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
.PHONY: help venv install act test run clean cleandirs lint format
help:
@echo "MCQ Generator - Available commands:"
@echo " make venv - Create virtual environment"
@echo " make act - Activate virtual environment"
@echo " make install - Install dependencies"
@echo " make test - Run unit tests"
@echo " make run - Run CLI (requires arguments)"
@echo " make clean - Remove generated files and cache"
@echo " make cleandirs - Remove virtual environment and build files"
@echo " make lint - Run code linting"
@echo " make format - Format code with black"
venv:
python3 -m venv mcqenv
. mcqenv/bin/activate && pip install --upgrade pip
act:
@echo "To activate the virtual environment, run:"
@echo " source mcqenv/bin/activate"
shell:
bash -c 'source mcqenv/bin/activate && bash'
install: venv
. mcqenv/bin/activate && pip install -e .
test:
. mcqenv/bin/activate && python -m unittest discover tests -v
run:
. mcqenv/bin/activate && python scripts/mcq_generate_cli.py --help
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name ".DS_Store" -delete
rm -rf .pytest_cache .coverage htmlcov
rm -f mcq_generate.log mcq_*.json
cleandirs: clean
rm -rf mcqenv
rm -rf build dist *.egg-info
find . -type d -name .eggs -exec rm -rf {} + 2>/dev/null || true
lint:
. mcqenv/bin/activate && python -m flake8 --max-line-length=100 src/mcq_generator/ scripts/
format:
. mcqenv/bin/activate && python -m black --line-length=100 src/mcq_generator/ scripts/