Skip to content

Commit 2bbb039

Browse files
committed
Merge remote-tracking branch 'origin/slip39-extendable-backups'
2 parents 3f9ff7c + 124f006 commit 2bbb039

35 files changed

+1776
-3533
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,28 @@ on:
1616
jobs:
1717
build:
1818

19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020
strategy:
2121
matrix:
2222
# Requires Python3 w/ Type Annotations
23-
python-version: ['3.9', '3.10', '3.11', '3.x']
23+
python-version: ['3.9', '3.10', '3.11', '3.12']
2424

2525
steps:
26-
- uses: actions/checkout@v2
26+
- name: Checkout repository code
27+
uses: actions/checkout@master
28+
- name: Update openssl
29+
run: |
30+
#sudo apt-get update
31+
#sudo apt-get -y install openssl
32+
openssl version
33+
openssl
2734
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v2
35+
uses: actions/setup-python@master
2936
with:
3037
python-version: ${{ matrix.python-version }}
3138
- name: Install dependencies
3239
run: |
33-
python3 -m pip install --upgrade pip
34-
python3 -m pip install -r requirements.txt
35-
python3 -m pip install -r requirements-serial.txt
36-
python3 -m pip install -r requirements-gui.txt
37-
python3 -m pip install -r requirements-wallet.txt
38-
python3 -m pip install -r requirements-tests.txt
40+
python3 -m pip install .[all,tests]
3941
- name: Lint with flake8
4042
run: |
4143
make analyze

GNUmakefile

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ CXFREEZE_EXT ?= win-$(CXFREEZE_ARCH)-$(CXFREEZE_VER)
4747
#SIGNTOOL ?= "/c/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86"
4848
SIGNTOOL ?= "c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe"
4949

50+
NIX_OPTS ?= --pure
5051

5152
# PY[3] is the target Python interpreter; require 3.11+. Detect if it is named python3 or python.
5253
PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
54+
PY3_V = $(shell $(PY3) -c "import sys; print('-'.join((next(iter(filter(None,sys.executable.split('/')))),sys.platform,sys.implementation.cache_tag)))" 2>/dev/null )
5355
VERSION = $(shell $(PY3) -c 'exec(open("slip39/version.py").read()); print( __version__ )')
56+
WHEEL = dist/slip39-$(VERSION)-py3-none-any.whl
5457
PLATFORM ?= $(shell $(PY3) -c "import sys; print( sys.platform )" )
5558
ifeq ($(PLATFORM),darwin)
5659
INSTALLER := pkg
@@ -61,23 +64,22 @@ else
6164
endif
6265

6366
# To see all pytest output, uncomment --capture=no, ...
64-
PYTESTOPTS = --capture=no --log-cli-level=WARNING
67+
PYTESTOPTS = -v --log-cli-level=WARNING # --capture=no # --doctest-modules
6568

6669
PY3TEST = $(PY3) -m pytest $(PYTESTOPTS)
6770

6871
# VirtualEnv: Build them in eg. ~/src/python-slip39-1.2.3/
6972
# o Will use the *current* git branch when creating a venv and populating it
7073

71-
VENV_LOCAL ?= ~/src/
72-
7374
GHUB_NAME = python-slip39
74-
GHUB_REPO = [email protected]:pjkundert/$(GHUB_NAME)
75-
GHUB_BRCH = $(shell git rev-parse --abbrev-ref HEAD )
76-
VENV_NAME = $(GHUB_NAME)-$(VERSION)
75+
76+
VENV_DIR = $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/.. )
77+
VENV_NAME = $(GHUB_NAME)-$(VERSION)-$(PY3_V)
78+
VENV = $(VENV_DIR)/$(VENV_NAME)
7779
VENV_OPTS = # --copies # Doesn't help; still references some system libs.
7880

7981

80-
.PHONY: all help test doctest analyze pylint build-check build install upload clean FORCE
82+
.PHONY: all help test doctest analyze pylint build install upload clean FORCE
8183

8284
all: help
8385

@@ -106,14 +108,6 @@ pylint:
106108
cd .. && pylint slip39 --disable=W,C,R
107109

108110

109-
build-check:
110-
@$(PY3) -m build --version \
111-
|| ( \
112-
echo -e "\n\n!!! Missing Python modules; run:"; \
113-
echo -e "\n\n $(PY3) -m pip install --break-system-packages --user --upgrade pip setuptools wheel build\n"; \
114-
false; \
115-
)
116-
117111
signing-check:
118112
$(SIGNTOOL)
119113

@@ -209,46 +203,30 @@ perry-kundert: GRANTS="{\"crypto-licensing-server\": {\
209203
# VirtualEnv build, install and activate
210204
#
211205

212-
venv: $(VENV_LOCAL)/$(VENV_NAME)
213-
venv-activate: $(VENV_LOCAL)/$(VENV_NAME)-activate
206+
venv: $(VENV)
207+
@echo; echo "*** Activating $< VirtualEnv for Interactive $(SHELL)"
208+
@bash --init-file $</bin/activate -i
214209

215-
$(VENV_LOCAL)/$(VENV_NAME):
216-
@git diff --quiet || ( \
217-
echo -e "\n\n!!! Git repo branch $(GHUB_BRCH) is dirty; cannot create venv!"; false \
218-
)
210+
$(VENV):
219211
@echo; echo "*** Building $@ VirtualEnv..."
220212
@rm -rf $@ && $(PY3) -m venv $(VENV_OPTS) $@ \
221-
&& cd $@ && git clone $(GHUB_REPO) -b $(GHUB_BRCH) \
222-
&& . ./bin/activate \
223-
&& make -C $(GHUB_NAME) install-tests install
224-
225-
# Activate a given VirtualEnv, and go to its python-slip39 installation
226-
# o Creates a custom venv-activate.sh script in the venv, and uses it start
227-
# start a sub-shell in that venv, with a CWD in the contained python-slip39 installation
228-
$(VENV_LOCAL)/$(VENV_NAME)-activate: $(VENV_LOCAL)/$(VENV_NAME)
229-
@echo; echo "*** Activating $@ VirtualEnv"
230-
@[ -s $</venv-activate.sh ] || ( \
231-
echo "PS1='[\u@\h \W)]\\$$ '"; \
232-
echo "[ ! -r ~/.git-completion.bash ] || source ~/.git-completion.bash"; \
233-
echo "[ ! -r ~/.git-prompt.sh ] || source ~/.git-prompt.sh && PS1='[\u@\h \W\$$(__git_ps1 \" (%s)\")]\\$$ '"; \
234-
echo "source $</bin/activate"; \
235-
echo "cd $</$(GHUB_NAME)"; \
236-
) > $</venv-activate.sh
237-
@bash --init-file $</venv-activate.sh -i
238-
239-
240-
wheel: deps dist/slip39-$(VERSION)-py3-none-any.whl
241-
242-
dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
213+
&& source $@/bin/activate \
214+
&& make install install-tests
215+
216+
217+
wheel: deps $(WHEEL)
218+
219+
$(WHEEL): FORCE
220+
$(PY3) -m pip install -r requirements-tests.txt
243221
$(PY3) -m build
244222
@ls -last dist
245223

246224
# Install from wheel, including all optional extra dependencies (except dev)
247-
install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE
248-
$(PY3) -m pip install --break-system-packages --user --force-reinstall $<[all]
225+
install: $(WHEEL) FORCE
226+
$(PY3) -m pip install --force-reinstall $<[all]
249227

250228
install-tests:
251-
$(PY3) -m pip install --upgrade --break-system-packages --user -r requirements-tests.txt
229+
$(PY3) -m pip install --upgrade -r requirements-tests.txt
252230

253231
# Building / Signing / Notarizing and Uploading the macOS or win32 App
254232
# o TODO: no signed and notarized package yet accepted for upload by macOS App Store
@@ -769,6 +747,8 @@ test-%:
769747
unit-%:
770748
$(PY3TEST) -k $*
771749

750+
nix-%:
751+
nix-shell $(NIX_OPTS) --run "make $*"
772752

773753
#
774754
# Target to allow the printing of 'make' variables, eg:

0 commit comments

Comments
 (0)