-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
73 lines (55 loc) · 1.85 KB
/
Makefile
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
#
# Makefile for the 'auto-discover' network discovery and analysis project
#
# This Makefile provides targets for streamlining development tasks related to
# the 'auto-discover' project, including code linting, testing, documentation
# generation, and virtual environment management.
# Author and Contact
AUTHOR := Thomas Vincent <[email protected]>
# Version (optional)
VERSION := 0.1
# Copyright notice
COPYRIGHT := 2012-2024 Thomas Vincent
# License
LICENSE := MIT
# Variables
PROJECT_NAME := auto-discover
VENV_NAME := $(PROJECT_NAME)-venv
FLAKE8_EXECUTABLE := flake8
# Targets
.PHONY: clean-pyc clean-build clean-venv lint test docs help
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " clean-build to remove build artifacts"
@echo " clean-pyc to remove Python file artifacts"
@echo " clean-venv to remove the virtual environment"
@echo " lint to check style with flake8"
@echo " test to run tests"
@echo " docs to generate Sphinx HTML documentation, including API docs"
clean: clean-build clean-pyc clean-venv
clean-build:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
clean-pyc:
find . -name '*.pyc' -delete -o -name '*.pyo' -delete -o -name '*~' -delete -o -name '__pycache__' -delete -print0 | xargs -0 -P4 rm -f
clean-venv:
rm -rf $(VENV_NAME)
lint:
$(FLAKE8_EXECUTABLE) auto-discover tests
test:
python -m unittest discover
docs:
rm -f docs/$(PROJECT_NAME).rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ auto-discover
$(MAKE) -C docs clean
$(MAKE) -C docs html
@echo "Documentation build complete. Open 'docs/_build/html/index.html' to view."
# Development targets
venv:
python3 -m venv $(VENV_NAME)
$(VENV_NAME)/bin/pip install -U pip
$(VENV_NAME)/bin/pip install -r requirements.txt
venv-dev: venv
$(VENV_NAME)/bin/pip install -r requirements-dev.txt