Test repository for Python library with Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
900 B

PWD := $(shell pwd)
MODULE := monotone
CARGO := cargo
POETRY := poetry
PYTHON := $(POETRY) run python
PYTEST := $(POETRY) run pytest
PYTHONPATH := $(PWD)
.PHONY: build
build:
$(POETRY) run maturin build
.PHONY: install
install:
$(POETRY) run maturin develop
.PHONY: test
test: cargo-test install pytest
.PHONY: cargo-test
cargo-test:
$(CARGO) test
.PHONY: pytest
pytest:
PYTHONPATH=$(PYTHONPATH) $(PYTEST)
.PHONY: clean
clean: clean-pyc clean-build
.PHONY: clean-pyc
clean-pyc:
rm -rf .pytest_cache
rm -rf .mypy_cache
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
.PHONY: clean-build
clean-build:
rm -rf target
rm -rf build/
rm -rf dist/
rm -rf $(MODULE).egg-info/
rm -rf pip-wheel-metadata/
find $(MODULE) -name "*.so" -exec rm -f {} +