forked from CounterpartyXCP/picopayments-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (90 loc) · 3.85 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
PY_VERSION := 3
WHEEL_DIR := $(HOME)/tmp/wheelhouse
PIP := env/bin/pip
PY := env/bin/python
PEP8 := env/bin/pep8
AUTOPEP8 := env/bin/autopep8
COVERAGE := env/bin/coverage
PYTEST := env/bin/py.test
USE_WHEELS := 0
ifeq ($(USE_WHEELS), 0)
WHEEL_INSTALL_ARGS := # void
else
WHEEL_INSTALL_ARGS := --use-wheel --no-index --find-links=$(WHEEL_DIR)
endif
export VIRTUALENV_PATH=env/bin/
export COUNTERPARTY_URL=http://127.0.0.1:14000/api/
help:
@echo "COMMANDS:"
@echo " clean Remove all generated files."
@echo " setup Setup development environment."
@echo " shell Open ipython from the development environment."
@echo " test Run tests."
@echo " lint Run analysis tools."
@echo " wheel Build package wheel & save in $(WHEEL_DIR)."
@echo " wheels Build dependency wheels & save in $(WHEEL_DIR)."
@echo " publish Build and upload package to pypi.python.org"
@echo " graphs Generate graphs"
@echo ""
@echo "VARIABLES:"
@echo " PY_VERSION Version of python to use. Default: $(PY_VERSION)"
@echo " WHEEL_DIR Where you save wheels. Default: $(WHEEL_DIR)."
@echo " USE_WHEELS Install packages from wheel dir, off by default."
clean:
rm -rf env
rm -rf build
rm -rf dist
rm -rf __pycache__
rm -rf htmlcov
rm -rf *.egg
rm -rf *.egg-info
find | grep -i ".*\.pyc$$" | xargs -r -L1 rm
virtualenv: clean
virtualenv -p /usr/bin/python$(PY_VERSION) env
$(PIP) install wheel
fetch_wheel: virtualenv
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) $(PACKAGE)
wheels: virtualenv
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r requirements.txt
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r requirements_tests.txt
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r requirements_develop.txt
wheel: setup
$(PY) setup.py bdist_wheel
mv dist/*.whl $(WHEEL_DIR)
setup: virtualenv
$(PIP) install $(WHEEL_INSTALL_ARGS) -r requirements.txt
$(PIP) install $(WHEEL_INSTALL_ARGS) -r requirements_tests.txt
$(PIP) install $(WHEEL_INSTALL_ARGS) -r requirements_develop.txt
$(PY) setup.py develop
sandbox: setup
$(PY) tools/sandbox.py
shell: install
env/bin/ipython
test: setup
$(AUTOPEP8) --in-place --aggressive --aggressive --recursive picopayments_hub
$(AUTOPEP8) --in-place --aggressive --aggressive --recursive examples
$(AUTOPEP8) --in-place --aggressive --aggressive --recursive tests
$(PEP8) picopayments_hub
$(PEP8) examples
$(PEP8) tests
$(PYTEST) --ignore=env --verbose --cov-config=.coveragerc --cov-report=term-missing --cov=./picopayments_hub -vv
# $(PYTEST) --ignore=env --verbose --cov-config=.coveragerc --cov-report=term-missing --cov=./picopayments_hub -vv --capture=no --pdb tests/cron_test.py::test_cron_check_for_expire_before_commit
# $(PYTEST) --ignore=env --verbose --cov-config=.coveragerc --cov-report=term-missing --cov=./picopayments_hub -vv --capture=no --pdb tests/standard_usage_test.py
# $(PYTEST) --ignore=env --verbose --cov-config=.coveragerc --cov-report=term-missing --cov=./picopayments_hub -vv --capture=no --pdb tests/api_mph_sync_test.py::test_validate_handles_exist
publish: test
$(PY) setup.py register bdist_wheel upload
view_readme: setup graphs
env/bin/restview README.rst
graphs:
ditaa schema.ditaa schema.png
bitcoind_startserver:
bitcoind -testnet -daemon -txindex # -reindex
bitcoind_getinfo:
bitcoin-cli --rpcuser=bitcoinrpcuser --rpcpassword=bitcoinrpcpass --rpcport=18332 getinfo
bitcoind_stopserver:
bitcoin-cli --rpcuser=bitcoinrpcuser --rpcpassword=bitcoinrpcpass --rpcport=18332 stop
counterparty_startserver: bitcoind_startserver
# requires "pip install counterparty-cli==1.1.2"
env/bin/counterparty-server --testnet --backend-port=18332 --backend-user=bitcoinrpcuser --backend-password=bitcoinrpcpass start
# Break in case of bug!
# import pudb; pu.db