-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.1 KB
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 1.1 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
# Makefile for Python project
# Variables
PYTHON = /usr/bin/env python3
EXAMPLE_DIR = examples
LIB_DIR = examples/mylib
SRC_DIR = flyde
TEST_DIR = tests
# Targets
.PHONY: gen test cover
gen:
@echo "Generating component definitions..."
# Generate JSON definitions for the examples and tests directory
@./pyflyde gen $(EXAMPLE_DIR)/
@./pyflyde gen $(TEST_DIR)/
lint:
@echo "Running linters..."
@ruff check $(SRC_DIR) $(LIB_DIR) $(TEST_DIR);
@ruff format $(SRC_DIR) $(LIB_DIR) $(TEST_DIR);
test:
@echo "Running tests..."
@$(PYTHON) -m unittest discover -s $(TEST_DIR) -p "test_$(if $(mod),$(mod),*).py";
cover:
@echo "Running tests with coverage..."
@coverage run -m unittest discover -s $(TEST_DIR) -p "test_*.py" ;
report:
@coverage report -m --skip-empty --omit="tests/*";
venv-activate:
@echo "Activating virtual environment..."
@source .venv/bin/activate;
builddist:
@echo "Building the project for distribution..."
@rm -f ./dist/*
@$(PYTHON) -m build;
release: lint test gen builddist
@echo "Releasing the project...";
upload:
@echo "Uploading the project to PyPI..."
@twine upload dist/*;