Skip to content

Commit e4e19ff

Browse files
committed
Merge branch 'feature-app'
2 parents 349cbc8 + ebed51a commit e4e19ff

24 files changed

+2029
-315
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
run: |
3333
python3 -m pip install --upgrade pip
3434
python3 -m pip install wheel
35-
if [ -f requirements.txt ]; then python3 -m pip install -r requirements.txt; fi
35+
python3 -m pip install -r requirements.txt
36+
python3 -m pip install -r requirements-serial.txt
3637
python3 -m pip install flake8 pytest
3738
- name: Lint with flake8
3839
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ dist/
2424
.vagrant
2525
.pytest_cache/
2626
.cache/
27+
*.spec
28+
.eggs

GNUmakefile

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,30 @@
22
# GNU 'make' file
33
#
44

5+
# Change to your own Apple Developer ID, if you want to code-sign the resultant .app
6+
DEVID ?= Developer ID Application: Perry Kundert (ZD8TVTCXDS)
7+
#DEVID ?= 3rd Party Mac Developer Application: Perry Kundert (ZD8TVTCXDS)
8+
BUNDLEID ?= ca.kundert.perry.SLIP39
9+
510
# PY[3] is the target Python interpreter. It must have pytest installed.
6-
PY3=python3
11+
PY3 ?= python3
712

813
VERSION=$(shell $(PY3) -c 'exec(open("slip39/version.py").read()); print( __version__ )')
914

1015
# To see all pytest output, uncomment --capture=no
11-
PYTESTOPTS=-vv # --capture=no --log-cli-level=INFO
16+
PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
17+
18+
PY3TEST = $(PY3) -m pytest $(PYTESTOPTS)
1219

13-
PY3TEST=TZ=$(TZ) $(PY3) -m pytest $(PYTESTOPTS)
20+
.PHONY: all help test doctest analyze pylint build-check build install upload clean FORCE
1421

15-
.PHONY: all test clean upload
16-
all: help
22+
all: help
1723

1824
help:
1925
@echo "GNUmakefile for cpppo. Targets:"
2026
@echo " help This help"
2127
@echo " test Run unit tests under Python3"
28+
@echo " build Build dist wheel and app under Python3"
2229
@echo " install Install in /usr/local for Python3"
2330
@echo " clean Remove build artifacts"
2431
@echo " upload Upload new version to pypi (package maintainer only)"
@@ -42,25 +49,52 @@ pylint:
4249

4350
build-check:
4451
@$(PY3) -m build --version \
45-
|| ( echo "\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade pip setuptools build\n" \
52+
|| ( echo "\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade pip setuptools wheel build\n" \
4653
&& false )
4754

48-
build: build-check clean
55+
build: clean wheel app
56+
57+
wheel: dist/slip39-$(VERSION)-py3-none-any.whl
58+
59+
dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
4960
$(PY3) -m build
5061
@ls -last dist
5162

52-
dist/slip39-$(VERSION)-py3-none-any.whl: build
63+
# Install from wheel, including all optional extra dependencies
64+
install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE
65+
$(PY3) -m pip install --force-reinstall $^[gui,serial,json]
5366

54-
install: dist/slip39-$(VERSION)-py3-none-any.whl
55-
$(PY3) -m pip install --force-reinstall $^
67+
# Generate, Sign and Zip the App package TODO: Code signing w/ Apple Developer ID
68+
app: dist/SLIP39.app-$(VERSION).zip
5669

70+
#(cd dist; zip -r SLIP39.app-$(VERSION).zip SLIP39.app)
71+
# Create a ZIP archive suitable for notarization.
72+
dist/SLIP39.app-$(VERSION).zip: dist/SLIP39.app
73+
rm -f $@
74+
/usr/bin/ditto -c -k --keepParent "$(PWD)/$<" "$(PWD)/$@"
75+
@ls -last dist
76+
77+
# Rebuild the app; ensure we discard any partial/prior build and app artifacts
78+
# --codesign-identity "$(DEVID)" # Nope; must change CFBundleShottVersionString before signing? Also different team IDs?
79+
dist/SLIP39.app: SLIP39.py FORCE
80+
rm -rf build $@*
81+
pyinstaller --noconfirm --windowed --onefile \
82+
--osx-bundle-identifier "$(BUNDLEID)" \
83+
--collect-data shamir_mnemonic $<
84+
sed -i "" -e "s/0.0.0/$(VERSION)/" "$@/Contents/Info.plist"
85+
cat $@/Contents/Info.plist
86+
codesign --force -s "$(DEVID)" $@
5787

5888
# Support uploading a new version of slip32 to pypi. Must:
5989
# o advance __version__ number in slip32/version.py
6090
# o log in to your pypi account (ie. for package maintainer only)
6191

62-
upload: build
63-
python3 -m twine upload --repository pypi dist/*
92+
upload-check:
93+
@$(PY3) -m twine --version \
94+
|| ( echo "\n*** Missing Python modules; run:\n\n $(PY3) -m pip install --upgrade twine\n" \
95+
&& false )
96+
upload: upload-check wheel
97+
python3 -m twine upload --repository pypi dist/slip39-$(VERSION)*
6498

6599
clean:
66100
@rm -rf MANIFEST *.png build dist auto *.egg-info $(shell find . -name '*.pyc' -o -name '__pycache__' )

MANIFEST.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
include LICENSE
33
include COPYING
44
include README.org
5-
include requirements.txt
6-
include requirements-tests.txt
5+
include README.pdf
6+
include README.txt
7+
include requirements*.txt
78
global-exclude *~

README.org

Lines changed: 161 additions & 121 deletions
Large diffs are not rendered by default.

README.pdf

6.34 KB
Binary file not shown.

0 commit comments

Comments
 (0)