1
- .PHONY : help install install-dev test test-cov lint clean format check build publish dev run
1
+ .PHONY : help setup test test-cov lint clean format check build publish dev nixopus
2
2
3
- help :
4
- @echo " Available commands:"
3
+ help : # # Show available commands
5
4
@grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
6
5
7
- install :
8
- poetry install
6
+ setup : # # Setup Python environment and install dependencies
7
+ @if command -v poetry > /dev/null 2>&1 ; then \
8
+ echo " Poetry found. Installing dependencies..." ; \
9
+ poetry install --with dev --quiet; \
10
+ echo " Environment ready! Use: make nixopus ARGS=\" command\" " ; \
11
+ else \
12
+ echo " Poetry not found. Installing Poetry..." ; \
13
+ curl -sSL https://install.python-poetry.org | python3 - > /dev/null 2>&1 ; \
14
+ echo " Poetry installed. Please restart your shell or run: source ~/.bashrc (or ~/.zshrc)" ; \
15
+ echo " Then run 'make setup' again to install dependencies." ; \
16
+ fi
9
17
10
- install-dev :
11
- poetry install --with dev --no-root
18
+ test : # # Run tests
19
+ @ poetry run pytest
12
20
13
- test :
14
- poetry run pytest
21
+ test-cov : # # Run tests with coverage
22
+ @ poetry run pytest --cov=app --cov-report=term-missing --cov-report=html
15
23
16
- test-cov :
17
- poetry run pytest --cov=core --cov=utils --cov-report=term-missing --cov-report=html
24
+ lint : # # Run linting
25
+ @poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
26
+ @poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
18
27
19
- test-watch :
20
- poetry run pytest-watch
28
+ format : # # Format code
29
+ @poetry run black . --quiet
30
+ @poetry run isort . --quiet
21
31
22
- lint :
23
- poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
24
- poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32
+ check : # # Run linting and tests
33
+ $(MAKE ) lint && $(MAKE ) test
25
34
26
- format :
27
- poetry run black .
28
- poetry run isort .
35
+ clean : # # Clean build artifacts
36
+ @rm -rf build/ dist/ * .egg-info/ .pytest_cache/ htmlcov/ .coverage
37
+ @find . -type d -name __pycache__ -delete
38
+ @find . -type f -name " *.pyc" -delete
29
39
30
- check :
31
- $(MAKE ) lint
32
- $(MAKE ) test
40
+ build : # # Build the package
41
+ @poetry build
33
42
34
- clean :
35
- rm -rf build/
36
- rm -rf dist/
37
- rm -rf * .egg-info/
38
- rm -rf .pytest_cache/
39
- rm -rf htmlcov/
40
- rm -rf .coverage
41
- find . -type d -name __pycache__ -delete
42
- find . -type f -name " *.pyc" -delete
43
+ publish : # # Publish to PyPI
44
+ @poetry publish
43
45
44
- build :
45
- poetry build
46
+ dev : # # Activate development shell
47
+ @ poetry shell
46
48
47
- publish :
48
- poetry publish
49
49
50
- dev :
51
- poetry shell
50
+ # -----------------------------------------------------------------------------
51
+ # Nixopus test CLI commands
52
+ # -----------------------------------------------------------------------------
53
+ nixopus : # # Run nixopus CLI
54
+ @if [ -z " $( ARGS) " ]; then \
55
+ poetry run nixopus --help; \
56
+ else \
57
+ poetry run nixopus $(ARGS ) ; \
58
+ fi
52
59
53
- run :
60
+ conflict : # # Run conflict command
61
+ @poetry run nixopus conflict $(ARGS )
62
+
63
+ preflight : # # Run preflight command
64
+ @poetry run nixopus preflight $(ARGS )
65
+
66
+ version : # # Show version
67
+ @poetry run nixopus version
68
+
69
+ run : # # Run nixopus CLI directly
54
70
poetry run nixopus
55
71
56
- generate-docs :
57
- typer app.main utils docs --output
58
- ../docs/cli/cli-reference.md --name
59
- nixopus
72
+ generate-docs : # # Generate CLI documentation
73
+ typer app.main utils docs --output ../docs/cli/cli-reference.md --name nixopus
0 commit comments