|
41 | 41 | endif |
42 | 42 |
|
43 | 43 | # To see all pytest output, uncomment --capture=no, ... |
44 | | -PYTESTOPTS = #-vv --doctest-modules # --capture=no # --log-cli-level=INFO |
| 44 | +PYTESTOPTS = --capture=no --log-cli-level=WARNING |
45 | 45 |
|
46 | 46 | PY3TEST = $(PY3) -m pytest $(PYTESTOPTS) |
47 | 47 |
|
|
77 | 77 | $(PY3TEST) |
78 | 78 |
|
79 | 79 | analyze: |
80 | | - flake8 -j 1 --max-line-length=200 \ |
81 | | - --ignore=W503,E201,E202,E127,E221,E223,E226,E231,E241,E242,E251,E265,E272,E274 \ |
| 80 | + $(PY3) -m flake8 --color never -j 1 --max-line-length=250 \ |
| 81 | + --exclude slip39/tabulate \ |
| 82 | + --ignore=W503,E201,E202,E203,E127,E221,E223,E226,E231,E241,E242,E251,E265,E272,E274 \ |
82 | 83 | slip39 |
83 | 84 |
|
84 | 85 | pylint: |
@@ -127,6 +128,63 @@ slip39/layout/COVER.txt: |
127 | 128 | # Any build dependencies that are dynamically generated, and may need updating from time to time |
128 | 129 | deps: $(TXT) slip39/gui/SLIP-39.txt slip39/layout/COVER.txt |
129 | 130 |
|
| 131 | + |
| 132 | +# |
| 133 | +# Agent Keypairs, Product Licences |
| 134 | +# |
| 135 | + |
| 136 | +GLOBAL_OPTIONS = -vv |
| 137 | + |
| 138 | +CREDENTIALS = $(abspath $(HOME)/.crypto-licensing ) |
| 139 | + |
| 140 | +export CRYPTO_LIC_PASSWORD |
| 141 | +export CRYPTO_LIC_USERNAME |
| 142 | + |
| 143 | +.PHONY: slip-39 perry-kundert |
| 144 | +products: slip-39 \ |
| 145 | + perry-kundert \ |
| 146 | + |
| 147 | +slip-39: |
| 148 | + |
| 149 | + |
| 150 | +perry-kundert: CRYPTO_LIC_PASSWORD=password |
| 151 | +perry-kundert: slip39/invoice/payments_test/perry-kundert.crypto-license |
| 152 | +perry-kundert: GRANTS="{\"crypto-licensing-server\": {\ |
| 153 | + \"override\": { \ |
| 154 | + \"rate\": \"0.1%\", \ |
| 155 | + \"crypto\": { \ |
| 156 | + \"ETH\": \"0xe4909b66FD66DA7d86114695A1256418580C8767\", \ |
| 157 | + \"BTC\": \"bc1qygm3dlynmjxuflghr0hmq6r7wmff2jd5gtgz0q\" \ |
| 158 | + }\ |
| 159 | + }\ |
| 160 | +}}" |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | +# Create .crypto-keypair from seed; note: if the make rule fails, intermediate files are deleted. |
| 165 | +# We expect any password to be transmitted in CRYPTO_LIC_PASSWORD env. var. |
| 166 | +%.crypto-keypair: %.crypto-seed |
| 167 | + $(PY3) -m crypto_licensing $(GLOBAL_OPTIONS) \ |
| 168 | + --extra $(dir $(basename $@ )) \ |
| 169 | + --name $(notdir $(basename $@ )) \ |
| 170 | + --reverse-save \ |
| 171 | + registered \ |
| 172 | + --username $(USERNAME) \ |
| 173 | + --seed $$( cat $< ) |
| 174 | + |
| 175 | +# Create .crypto-license, signed by .crypto-keypair |
| 176 | +%.crypto-license : %.crypto-keypair |
| 177 | + $(PY3) -m crypto_licensing $(GLOBAL_OPTIONS) \ |
| 178 | + --extra $(dir $(basename $@ )) \ |
| 179 | + --name $(notdir $(basename $@ )) \ |
| 180 | + --reverse-save \ |
| 181 | + license \ |
| 182 | + --username $(USERNAME) --no-registering \ |
| 183 | + --client $(CLIENT) --client-pubkey $(CLIENT_PUBKEY) \ |
| 184 | + --grant $(GRANTS) \ |
| 185 | + --author $(AUTHOR) --domain $(DOMAIN) --product $(PRODUCT) $(LICENSE_OPTIONS) |
| 186 | + |
| 187 | + |
130 | 188 | # |
131 | 189 | # VirtualEnv build, install and activate |
132 | 190 | # |
@@ -167,7 +225,7 @@ dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE |
167 | 225 |
|
168 | 226 | # Install from wheel, including all optional extra dependencies (except dev) |
169 | 227 | install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE |
170 | | - $(PY3) -m pip install --force-reinstall $<[gui,wallet,serial] |
| 228 | + $(PY3) -m pip install --force-reinstall $<[all] |
171 | 229 |
|
172 | 230 | install-dev: |
173 | 231 | $(PY3) -m pip install --upgrade -r requirements-dev.txt |
@@ -527,6 +585,11 @@ dist/SLIP-39.app-checkids: SLIP-39.spec |
527 | 585 | # For details on Signing Apps: |
528 | 586 | # See: https://developer.apple.com/library/archive/technotes/tn2318/_index.html |
529 | 587 |
|
| 588 | +# For PyInstaller-specific hints: |
| 589 | +# https://gist.github.com/txoof/0636835d3cc65245c6288b2374799c43 |
| 590 | +# https://github.com/txoof/codesign |
| 591 | +# https://github.com/The-Nicholas-R-Barrow-Company-LLC/PyMacApp |
| 592 | + |
530 | 593 | # * In order for code signing to succeed, your code signing key(s) MUST have all of their dependent |
531 | 594 | # (issuer) keys downloaded to your Keychain, from https://www.apple.com/certificateauthority. |
532 | 595 | # - Use Keychain Access, right-click on your signing key and click Evaluate "...". |
@@ -647,16 +710,17 @@ upload-check: |
647 | 710 | || ( echo -e "\n\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade twine\n" \ |
648 | 711 | && false ) |
649 | 712 | upload: upload-check wheel |
650 | | - python3 -m twine upload --repository pypi dist/slip39-$(VERSION)* |
| 713 | + $(PY3) -m twine upload --repository pypi dist/slip39-$(VERSION)* |
651 | 714 |
|
652 | 715 | clean: |
653 | 716 | @rm -rf MANIFEST *.png build dist auto *.egg-info $(shell find . -name '__pycache__' ) |
654 | 717 |
|
655 | 718 |
|
656 | | -# Run only tests with a prefix containing the target string, eg test-blah |
| 719 | +# Run only tests with a prefix containing the target string, eg test-api |
657 | 720 | test-%: |
658 | | - slip39/*$*_test.py |
| 721 | + $(PY3TEST) $(shell find slip39 -name '*$**_test.py') |
659 | 722 |
|
| 723 | +# Run all tests with names matching the target string |
660 | 724 | unit-%: |
661 | 725 | $(PY3TEST) -k $* |
662 | 726 |
|
|
0 commit comments