-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
75 lines (56 loc) · 1.73 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.DEFAULT_GOAL := help
.PHONY: help, lint, format, test-all, test-unit, test-e2e, ensure, sync, publish, notebook, dist, clean
SHELL := /bin/bash
default: help;
help:
@echo "꩜ Substrate Python SDK"
@echo "See DEVELOPING.md for more info."
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Main targets:"
@echo " develop Install dependencies"
@echo " sync Sync generated code & bump version"
@echo " sync-version Sync SDK version to project"
@echo " clean Remove all build, test, coverage and Python artifacts"
@echo " dist Builds source and wheel package"
@echo " publish Publish to pypi"
@echo ""
poetry.lock: pyproject.toml
poetry lock
ensure: poetry.lock
poetry install
sync: sync-version sync-codegen format
sync-version:
poetry run python scripts/sync_version.py
sync-codegen:
poetry run python scripts/sync_codegen.py
notebook:
poetry run marimo edit examples/notebook.py
dist: pyproject.toml poetry.lock substrate/_version.py
poetry build -C=dist && poetry run twine check dist/*
lint:
poetry run ruff check .
clean: clean-build clean-pyc
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr site/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
format:
poetry run ruff format .
poetry run ruff check --fix .
test-unit:
poetry run pytest -m unit
test-e2e:
poetry run pytest -m e2e
test-all: test-unit test-e2e
publish: dist/
poetry run twine upload dist/*