forked from codedstructure/pylibftdi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (25 loc) · 985 Bytes
/
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
# Basic development functions for pylibftdi.
# Example:
# make container && make lint && make test && make build
.PHONY: all
all: container test lint build
.PHONY: container
container:
docker build -t pylibftdi-dev:latest .
.PHONY: build
build:
docker run --rm -t -v $$PWD:/app -w /app pylibftdi-dev:latest poetry build
.PHONY: test
test:
docker run --rm -t -v $$PWD:/app -w /app pylibftdi-dev:latest bash -c 'poetry install && poetry run pytest'
.PHONY: lint
lint:
docker run --rm -t -v $$PWD:/app -w /app pylibftdi-dev:latest bash -c 'poetry install && (poetry run black --check .; poetry run ruff check src tests; poetry run mypy src)'
.PHONY: shell
shell:
# Drop into a poetry shell where e.g. `python3 -m pylibftdi.examples.list_devices` etc can be run
docker run --rm -it -v $$PWD:/app -w /app pylibftdi-dev:latest bash -ic 'poetry install && poetry shell'
.PHONY: clean
clean:
# Ideally this would remove all relevant dev containers too...
rm -rf dist/ .venv/