-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
44 lines (35 loc) · 1.29 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
# Makefile
VENV_DIR := .venv
LINTER := ruff # Replace this with the packages you need
LOGURU_LEVEL := INFO
all: venv lint run
.PHONY: lint run
.venv:
@echo "Initializing virtual environment..."
uv venv
requirements-dev: .venv
source $(VENV_DIR)/bin/activate \
&& uv pip compile --extra dev pyproject.toml > requirements-dev.txt \
&& uv pip install -r requirements-dev.txt \
&& uv pip install -e .
.PHONY: test
test:
source $(VENV_DIR)/bin/activate \
&& pytest src/vietlott/tests
lint: .venv
@echo "Linting..."
source $(VENV_DIR)/bin/activate && ruff check . && ruff format .
build: lint tests
@echo "Building..."
source $(VENV_DIR)/bin/activate && python3 -m build
source $(VENV_DIR)/bin/activate && python3 -m bdist_wheel
pypi: build
@echo "Publishing..."
source $(VENV_DIR)/bin/activate && python3 -m twine upload --repository pypi dist/*
run-crawl: .venv
@echo "Running script..."
source $(VENV_DIR)/bin/activate && LOGURU_LEVEL=$(LOGURU_LEVEL) PYTHONPATH=src python src/vietlott/cli/crawl.py keno
source $(VENV_DIR)/bin/activate && LOGURU_LEVEL=$(LOGURU_LEVEL) PYTHONPATH=src python src/vietlott/cli/crawl.py power_655
run-missing: .venv
@echo "Running script..."
source $(VENV_DIR)/bin/activate && LOGURU_LEVEL=$(LOGURU_LEVEL) PYTHONPATH=src python src/vietlott/cli/missing.py keno