-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
56 lines (46 loc) · 1.36 KB
/
makefile
File metadata and controls
56 lines (46 loc) · 1.36 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
.PHONY: help clean build install dev-install test lint format run
# Project configuration
VENV := .venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
SPEC_FILE := pybar.spec
DIST_DIR := dist
BUILD_DIR := build
INSTALL_DIR := $(HOME)/.local/bin
APP_NAME := pybar
help:
@echo "Available targets:"
@echo " install - Symlink binary to ~/.local/bin/"
@echo " setup - Set up venv and install dependencies"
@echo " build - Build executable with PyInstaller"
@echo " clean - Remove build artifacts"
@echo " test - Run tests"
@echo " lint - Run linters"
@echo " format - Format code"
@echo " run - Run the application"
install: build
@mkdir -p $(INSTALL_DIR)
ln -sf $(CURDIR)/$(DIST_DIR)/$(APP_NAME)/$(APP_NAME) $(INSTALL_DIR)/$(APP_NAME)
@echo "Linked $(APP_NAME) to $(INSTALL_DIR)"
setup:
python -m venv $(VENV)
$(PIP) install -r requirements.txt
$(PIP) install pyinstaller
build:
$(VENV)/bin/pyinstaller $(SPEC_FILE) --noconfirm
clean:
rm -rf $(BUILD_DIR) $(DIST_DIR)
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*.spec~" -delete
test:
$(PYTHON) -m pytest tests/
lint:
$(PYTHON) -m flake8 .
$(PYTHON) -m pylint .
format:
$(PYTHON) -m black .
$(PYTHON) -m isort .
run:
$(PYTHON) main.py