Skip to content

Commit 8a8696b

Browse files
committed
Add VirtualEnv support
1 parent 5422591 commit 8a8696b

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed

GNUmakefile

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ PYTESTOPTS = -vv # --capture=no --log-cli-level=INFO
2828

2929
PY3TEST = $(PY3) -m pytest $(PYTESTOPTS)
3030

31+
# VirtualEnv: Build them in ~/src/python-slip39-1.2.3/
32+
LOCAL ?= ~/src/
33+
34+
GHUB_NAME = python-slip39
35+
GHUB_REPO = [email protected]:pjkundert/$(GHUB_NAME)
36+
GHUB_BRCH = -b feature-dmg
37+
VENV_NAME = $(GHUB_NAME)-$(VERSION)
38+
VENV_OPTS = # --copies # Doesn't help; still references some system libs.
39+
40+
3141
.PHONY: all help test doctest analyze pylint build-check build install upload clean FORCE
3242

3343
all: help
@@ -68,6 +78,9 @@ dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
6878
@ls -last dist
6979

7080
# Install from wheel, including all optional extra dependencies
81+
install-dev:
82+
$(PY3) -m pip install --upgrade -r requirements-dev.txt
83+
7184
install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE
7285
$(PY3) -m pip install --force-reinstall $<[gui,serial,json]
7386

@@ -405,7 +418,7 @@ dist/SLIP39.app: SLIP39.spec \
405418
sed -I "" -E "s/version=.*/version='$(VERSION)',/" $<
406419
sed -I "" -E "s/'CFBundleVersion':.*/'CFBundleVersion':'$(VERSION)',/" $<
407420
sed -I "" -E "s/codesign_identity=.*/codesign_identity='$(DEVID)',/" $<
408-
pyinstaller --noconfirm $<
421+
pyinstaller --noconfirm --windowed --onefile $<
409422
echo "Checking signature (pyinstaller signed)..."; ./SLIP39.metadata/check-signature $@ || true
410423
codesign --verify $@
411424
# codesign --deep --force \
@@ -445,13 +458,14 @@ dist/SLIP39.app: SLIP39.spec \
445458

446459
SLIP39.spec: SLIP39.py
447460
@echo "\n\n!!! Rebuilding $@; Must be manually edited..."
448-
pyinstaller --noconfirm --windowed \
461+
pyinstaller --noconfirm --windowed --onefile \
449462
--codesign-identity "$(DEVID)" \
450463
--osx-bundle-identifier "$(BUNDLEID)" \
451464
--osx-entitlements-file ./SLIP39.metadata/entitlements.plist \
452465
--collect-data shamir_mnemonic \
453466
$<
454-
false
467+
@echo "!!! Regenerated $@: must be manually corrected!"
468+
false # Make the build fail if we've regenerated the .spec
455469

456470
#
457471
# macOS Icons
@@ -512,3 +526,23 @@ unit-%:
512526
print-%:
513527
@echo $* = $($*)
514528
@echo $*\'s origin is $(origin $*)
529+
530+
531+
#
532+
# VirtualEnv build, install and activate
533+
#
534+
535+
venv: $(LOCAL)/$(VENV_NAME)
536+
venv-activate: $(LOCAL)/$(VENV_NAME)-activate
537+
538+
539+
$(LOCAL)/$(VENV_NAME):
540+
@echo; echo "*** Building $@ VirtualEnv..."
541+
@rm -rf $@ && $(PY3) -m venv $(VENV_OPTS) $@ \
542+
&& cd $@ && git clone $(GHUB_REPO) $(GHUB_BRCH) \
543+
&& . ./bin/activate && make -C $(GHUB_NAME) install-dev install
544+
545+
# Activate a given VirtualEnv
546+
$(LOCAL)/$(VENV_NAME)-activate: $(LOCAL)/$(VENV_NAME)
547+
@echo; echo "*** Activating $@ VirtualEnv"
548+
. $</bin/activate

SLIP39.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exe = EXE(pyz,
3737
disable_windowed_traceback=False,
3838
target_arch=None,
3939
codesign_identity='Developer ID Application: Perry Kundert (ZD8TVTCXDS)',
40-
entitlements_file='SLIP39.metadata/entitlements.plist' )
40+
entitlements_file='./SLIP39.metadata/entitlements.plist' )
4141
coll = COLLECT(exe,
4242
a.binaries,
4343
a.zipfiles,
@@ -49,9 +49,9 @@ coll = COLLECT(exe,
4949
app = BUNDLE(coll,
5050
name='SLIP39.app',
5151
icon='images/SLIP39.icns',
52-
version='6.7.1',
52+
version='6.7.2',
5353
info_plist={
54-
'CFBundleVersion':'6.7.1',
54+
'CFBundleVersion':'6.7.2',
5555
'CFBundlePackageType':'APPL',
5656
'LSApplicationCategoryType':'public.app-category.finance',
5757
'LSMinimumSystemVersion':'10.15.0',

requirements-dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pip
2+
setuptools
3+
wheel
4+
build

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'serial', # slip39[serial]: Support serial I/O of generated wallet data
3535
'json', # slip39[json]: Support output of encrypted Ethereum JSON wallets
3636
'gui', # slip39[gui]: Support PySimpleGUI/tkinter Graphical UI App
37+
'dev', # slip39[dev]: All modules to support development
3738
]
3839
}
3940

slip39/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = ( 6, 7, 1 )
1+
__version_info__ = ( 6, 7, 2 )
22
__version__ = '.'.join( map( str, __version_info__ ))

0 commit comments

Comments
 (0)