@@ -8,9 +8,10 @@ RUST_LOG := info
8
8
RUST_BACKTRACE := full
9
9
WHEEL_DIR := dist
10
10
PYGRAPHINA_DIR := pygraphina
11
+ PY_DEP_MNGR := uv # Use `uv sync --all-extras` to make the environment
11
12
TEST_DATA_DIR := tests/testdata
12
13
SHELL := /bin/bash
13
- MSRV := 1.83
14
+ MSRV := 1.86
14
15
15
16
# Find the latest built Python wheel file
16
17
WHEEL_FILE := $(shell ls $(PYGRAPHINA_DIR ) /$(WHEEL_DIR ) /pygraphina-* .whl 2>/dev/null | head -n 1)
@@ -20,8 +21,8 @@ WHEEL_FILE := $(shell ls $(PYGRAPHINA_DIR)/$(WHEEL_DIR)/pygraphina-*.whl 2>/dev/
20
21
21
22
.PHONY : help
22
23
help : # # Show the help message for each target
23
- @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $( MAKEFILE_LIST ) | \
24
- awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
24
+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' Makefile | \
25
+ awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
25
26
26
27
# #######################################################################################
27
28
# # Rust targets
@@ -74,6 +75,8 @@ install-deps: install-snap ## Install development dependencies
74
75
@cargo install cargo-tarpaulin
75
76
@cargo install cargo-audit
76
77
@cargo install cargo-nextest
78
+ @sudo apt-get install python3-pip
79
+ @pip install $(PY_DEP_MNGR )
77
80
78
81
.PHONY : lint
79
82
lint : format # # Run linters on Rust files
@@ -125,9 +128,9 @@ install-msrv: ## Install the minimum supported Rust version (MSRV) for developme
125
128
run-examples : # # Run all the scripts in the examples directory one by one
126
129
@echo " Running all example scripts..."
127
130
@for example in examples/* .rs; do \
128
- example_name=$$(basename $$example .rs) ; \
129
- echo " Running example: $$ example_name" ; \
130
- cargo run --example $$ example_name; \
131
+ example_name=$$(basename $$example .rs) ; \
132
+ echo " Running example: $$ example_name" ; \
133
+ cargo run --example $$ example_name; \
131
134
done
132
135
133
136
# #######################################################################################
@@ -153,14 +156,14 @@ wheel-manylinux: ## Build the manylinux wheel file for PyGraphina (using Zig)
153
156
.PHONY : test-py
154
157
test-py : develop-py # # Run Python tests
155
158
@echo " Running Python tests..."
156
- @poetry run pytest $( PYGRAPHINA_DIR ) /tests
159
+ @$( PY_DEP_MNGR ) run pytest
157
160
158
161
.PHONY : publish-py
159
162
publish-py : wheel-manylinux # # Publish the PyGraphina wheel to PyPI (requires PYPI_TOKEN to be set)
160
163
@echo " Publishing PyGraphina to PyPI..."
161
164
@if [ -z " $( WHEEL_FILE) " ]; then \
162
- echo " Error: No wheel file found. Please run 'make wheel' first." ; \
163
- exit 1; \
165
+ echo " Error: No wheel file found. Please run 'make wheel' first." ; \
166
+ exit 1; \
164
167
fi
165
168
@echo " Found wheel file: $( WHEEL_FILE) "
166
169
@twine upload -u __token__ -p $(PYPI_TOKEN ) $(WHEEL_FILE )
@@ -169,3 +172,19 @@ publish-py: wheel-manylinux ## Publish the PyGraphina wheel to PyPI (requires PY
169
172
generate-ci : # # Generate CI configuration files (GitHub Actions workflow)
170
173
@echo " Generating CI configuration files..."
171
174
@ (cd $( PYGRAPHINA_DIR) && maturin generate-ci --zig --pytest --platform all -o ../.github/workflows/ci.yml github)
175
+
176
+ # #######################################################################################
177
+ # # Additional targets
178
+ # #######################################################################################
179
+
180
+ .PHONY : setup-hooks
181
+ setup-hooks : # # Install Git hooks (pre-commit and pre-push)
182
+ @echo " Installing Git hooks..."
183
+ @pre-commit install --hook-type pre-commit
184
+ @pre-commit install --hook-type pre-push
185
+ @pre-commit install-hooks
186
+
187
+ .PHONY : test-hooks
188
+ test-hooks : # # Test Git hooks on all files
189
+ @echo " Testing Git hooks..."
190
+ @pre-commit run --all-files
0 commit comments