-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (74 loc) · 3.21 KB
/
Makefile
File metadata and controls
97 lines (74 loc) · 3.21 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: help setup install run lint format clean build docs docs-serve docs-build docs-api sign release test test-live test-all test-coverage fuzz test-legacy-downloads test-batch-cli ci
VENV = .venv
PYTHON ?= python3
PIP = pip
MARKDOWNLINT = npx markdownlint-cli@0.31.1
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
setup: ## Create virtual environment and install dependencies
$(PYTHON) -m venv $(VENV)
$(VENV)/bin/pip install -e .
$(VENV)/bin/pip install -r requirements-dev.txt
install: ## Install dependencies in the current environment
$(PIP) install -e .
$(PIP) install -r requirements-dev.txt
run: ## Run the CLI (usage: make run URL=...)
$(PYTHON) -m fetchext.cli $(URL)
lint: ## Run all linters (Python and Markdown)
$(PYTHON) -m ruff check .
$(MARKDOWNLINT) "**/*.md"
format: ## Format code and fix lint errors
$(PYTHON) -m ruff format .
$(PYTHON) -m ruff check --fix .
$(MARKDOWNLINT) "**/*.md" --fix
build: ## Build the package
$(PYTHON) -m build
docs: ## Generate documentation assets (man pages, completions)
$(PYTHON) scripts/gen_man.py
$(PYTHON) scripts/gen_completion.py
docs-serve: ## Serve documentation locally
$(PYTHON) -m mkdocs serve
docs-build: ## Build documentation site
$(PYTHON) -m mkdocs build
docs-api: ## Generate API documentation
$(PYTHON) -m pdoc -o docs/api src/fetchext
sign: ## Detach-sign the built artifacts
gpg --detach-sign -a dist/*.whl
gpg --detach-sign -a dist/*.tar.gz
release: build sign ## Upload to PyPI
$(PYTHON) -m twine upload dist/*
clean: ## Clean up build artifacts and temporary files
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete
rm -rf src/*.egg-info
rm -rf dist
rm -rf downloads/
rm -rf site/
test: ## Run unit and integration tests (skips live tests)
$(PYTHON) -m pytest -m "not live" --verbosity=5 --show-capture=all
test-live: ## Run live tests (requires network)
$(PYTHON) -m pytest -m "live" --verbosity=5 --show-capture=all
test-all: ## Run all tests
$(PYTHON) -m pytest --verbosity=5 --show-capture=all
test-coverage: ## Run tests with coverage report
$(PYTHON) -m pytest --verbosity=5 --show-capture=all --cov=src/fetchext --cov-report=term-missing
fuzz: ## Run fuzz tests
$(PYTHON) -m pytest --verbosity=5 --show-capture=all tests/fuzz/
test-legacy-downloads: ## Run legacy download tests using fext CLI
# Chrome (URL)
fext download chrome https://chromewebstore.google.com/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo -o downloads/
# Chrome (ID)
fext download chrome aicmkgpgakddgnaphhhpliifpcfhicfo -o downloads/
# Edge (URL)
fext download edge https://microsoftedge.microsoft.com/addons/detail/postman-interceptor/nbjbemmokmdpdokpnbfpdfbikmhgilmc -o downloads/
# Edge (ID)
fext download edge nbjbemmokmdpdokpnbfpdfbikmhgilmc -o downloads/
# Firefox (URL)
fext download firefox https://addons.mozilla.org/en-US/firefox/addon/postman_interceptor/ -o downloads/
test-batch-cli: ## Run batch processing test
fext batch tests/batch_list.txt -o downloads/batch_output/ --workers 4
ci: lint build test ## Run CI pipeline (lint, build, test)