Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
106 lines (83 loc) · 2.55 KB
/
Copy pathMakefile
File metadata and controls
106 lines (83 loc) · 2.55 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
VERSION := $(shell poetry version -s)
ruff:
poetry run ruff check . --fix
ruff-check:
poetry run ruff check .
fuzz:
poetry run pytest tests/fuzz
mypy:
poetry run mypy cashu --check-untyped-defs
format: ruff
check: ruff-check mypy
clean:
rm -r cashu.egg-info/ || true
find . -name ".DS_Store" -exec rm -f {} \; || true
rm -rf dist || true
rm -rf build || true
rm -rf docker-build || true
package:
poetry export -f requirements.txt --without-hashes --output requirements.txt
poetry build --clean
test:
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests --cov-report xml --cov cashu
test-wallet:
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests/wallet --cov-report xml --cov cashu
test-mint:
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests/mint --cov-report xml --cov cashu
.PHONY: compatibility-targets test-wallet-compatibility
compatibility-targets:
poetry run python -m tests.compatibility
test-wallet-compatibility:
@test -n "$$CASHU_TEST_MINT_IMAGE" || \
(echo "Set CASHU_TEST_MINT_IMAGE, e.g. CASHU_TEST_MINT_IMAGE=cashubtc/nutshell:0.20.3" && exit 1)
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests/wallet --cov-report xml --cov cashu
.PHONY: test-spark-regtest test-spark-backend-regtest test-spark-mint test-spark-wallet
test-spark-regtest:
$(MAKE) test-spark-backend-regtest
$(MAKE) test-spark-mint
$(MAKE) test-spark-wallet
test-spark-backend-regtest:
CASHU_SPARK_REGTEST=true \
MINT_BACKEND_BOLT11_SAT=FakeWallet \
MINT_BACKEND_BOLT11_USD=FakeWallet \
TOR=FALSE \
poetry run pytest tests/lightning/test_spark_regtest.py -v
test-spark-mint:
CASHU_SPARK_REGTEST=true \
MINT_BACKEND_BOLT11_SAT=SparkL2Wallet \
MINT_BACKEND_BOLT11_USD=FakeWallet \
TOR=FALSE \
$(MAKE) test-mint
test-spark-wallet:
CASHU_SPARK_REGTEST=true \
MINT_BACKEND_BOLT11_SAT=SparkL2Wallet \
MINT_BACKEND_BOLT11_USD=FakeWallet \
TOR=FALSE \
$(MAKE) test-wallet
install: package
python -m pip install --upgrade dist/*.whl
upload: package
poetry publish
install-pre-commit-hook:
@echo "Installing pre-commit hook to git"
@echo "Uninstall the hook with poetry run pre-commit uninstall"
poetry run pre-commit install
pre-commit:
poetry run pre-commit run --all-files
.PHONY: docker-build
docker-build:
rm -rf docker-build || true
mkdir -p docker-build
git clone . docker-build
cd docker-build
docker buildx build -f Dockerfile -t cashubtc/nutshell:$(VERSION) --platform linux/amd64 .
clear-postgres:
psql cashu -c "DROP SCHEMA public CASCADE;" -c "CREATE SCHEMA public;" -c "GRANT ALL PRIVILEGES ON SCHEMA public TO cashu;"