File size: 2,141 Bytes
69fec20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
.PHONY: help install install-dev test lint format clean run docker-build docker-run docker-compose-up docker-compose-down

help:
	@echo "gcli2api - Development Commands"
	@echo ""
	@echo "Available commands:"
	@echo "  make install            - Install production dependencies"
	@echo "  make install-dev        - Install development dependencies"
	@echo "  make test               - Run tests"
	@echo "  make test-cov           - Run tests with coverage report"
	@echo "  make lint               - Run linters (flake8, mypy)"
	@echo "  make format             - Format code with black"
	@echo "  make format-check       - Check code formatting without making changes"
	@echo "  make clean              - Clean build artifacts and cache"
	@echo "  make run                - Run the application"
	@echo "  make docker-build       - Build Docker image"
	@echo "  make docker-run         - Run Docker container"
	@echo "  make docker-compose-up  - Start services with docker-compose"
	@echo "  make docker-compose-down - Stop services with docker-compose"

install:
	pip install -r requirements.txt

install-dev:
	pip install -e ".[dev]"
	pip install -r requirements-dev.txt

test:
	python -m pytest -v

test-cov:
	python -m pytest --cov=src --cov-report=term-missing --cov-report=html

lint:
	python -m flake8 src/ web.py config.py log.py --max-line-length=100 --extend-ignore=E203,W503
	python -m mypy src/ --ignore-missing-imports

format:
	python -m black src/ web.py config.py log.py test_*.py

format-check:
	python -m black --check src/ web.py config.py log.py test_*.py

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 "*.log" -delete
	rm -rf .pytest_cache .mypy_cache .coverage htmlcov/ build/ dist/ *.egg-info

run:
	python web.py

docker-build:
	docker build -t gcli2api:latest .

docker-run:
	docker run -d --name gcli2api --network host -e PASSWORD=pwd -e PORT=7861 -v $$(pwd)/data/creds:/app/creds gcli2api:latest

docker-compose-up:
	docker-compose up -d

docker-compose-down:
	docker-compose down