-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (37 loc) · 1.46 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
.PHONY: help install clean build publish
DIST_DIR := dist
SRC_DIR := src
help:
@echo "Available commands:"
@echo " make install - Install project dependencies"
@echo " make clean - Clean build directory"
@echo " make build - Build project"
@echo " make publish - Build and publish plugin package"
install:
uv sync --all-extras
clean:
rm -rf $(DIST_DIR)
lint:
uv run ruff check src
uv run mypy src
format:
uv run ruff format src
build: lint format
rm -rf $(DIST_DIR)
mkdir -p $(DIST_DIR)/killprocess
mkdir -p $(DIST_DIR)/dependencies
uv pip freeze > requirements.txt
uv pip install -r requirements.txt --target $(DIST_DIR)/dependencies
rm requirements.txt
cp -r $(SRC_DIR)/* $(DIST_DIR)/killprocess/
find $(DIST_DIR)/dependencies -type d -name "*.dist-info" -o -name "*.egg-info" | xargs rm -rf
find $(DIST_DIR)/dependencies -type f -name "__editable__*" -o -name ".lock" | xargs rm -f
echo 'import os\nimport sys\n\n# Add dependencies directory to Python path\ndeps_dir = os.path.join(os.path.dirname(__file__), "dependencies")\nif deps_dir not in sys.path:\n sys.path.insert(0, deps_dir)\n\n# Import your actual plugin code\nfrom .killprocess.main import plugin\n\n__all__ = ["plugin"]' > $(DIST_DIR)/__init__.py
cp plugin.json $(DIST_DIR)/plugin.json
mkdir -p $(DIST_DIR)/image
cp image/* $(DIST_DIR)/image/
test:
uv run python -m unittest tests/test_friendly_names.py
publish: build
zip -r wox.plugin.killprocess.wox $(DIST_DIR)/*
rm -rf $(DIST_DIR)