Skip to content

Commit 0f1e00b

Browse files
committed
Update from setup.py to pyproject.toml
o Remove 'all' extra; specifically install [gui,serial,wallet,invoice] o Preserve requirements-tests.txt and -dev.txt; see Makefile o Remove all cx_Freeze and most pyinstaller cruft
1 parent 4c3cc05 commit 0f1e00b

12 files changed

+177
-454
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SHELL = /bin/bash
1313

1414
# Change to your own Apple Developer ID, if you want to code-sign the resultant .app
1515

16+
ALL = gui,serial,wallet,invoice
1617

1718
1819
TEAMID ?= ZD8TVTCXDS
@@ -376,14 +377,13 @@ $(VENV):
376377

377378
wheel: deps $(WHEEL)
378379

379-
$(WHEEL): FORCE
380-
$(PYTHON) -m pip install -r requirements-dev.txt
380+
$(WHEEL): install-dev FORCE
381381
$(PYTHON) -m build
382382
@ls -last dist
383383

384384
# Install from wheel, including all optional extra dependencies (except dev). Always use the venv (or global)
385385
install: $(WHEEL) FORCE
386-
$(PYTHON) -m pip install --no-user --force-reinstall $<[all]
386+
$(PYTHON) -m pip install --no-user --force-reinstall $<[$(ALL)]
387387

388388
install-%: # ...-dev, -tests
389389
$(PYTHON) -m pip install --no-user --upgrade -r requirements-$*.txt

SLIP-39-description.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Creating Ethereum, Bitcoin and other accounts is complex and fraught
2+
with potential for loss of funds.
3+
4+
A BIP-39 seed recovery phrase helps, but a *single* lapse in security
5+
dooms the account (and all derived accounts, in fact). If someone finds
6+
your recovery phrase (or you lose it), the accounts derived from that
7+
seed are /gone/.
8+
9+
The SLIP-39 standard allows you to split the seed between 1, 2, or more
10+
groups of several mnemonic recovery phrases. This is better, but
11+
creating such accounts is difficult; presently, only the Trezor supports
12+
these, and they can only be created "manually". Writing down 5 or more
13+
sets of 20 words is difficult, error-prone and time consuming.
14+
15+
# Hardware Wallet "Seed" Configuration
16+
17+
> Your keys, your Bitcoin. Not your keys, not your Bitcoin.
18+
>
19+
> ---Andreas Antonopoulos
20+
21+
The [python-slip39] project (and the [SLIP-39 macOS/win32 App]) exists
22+
to assist in the safe creation, backup and documentation of
23+
[Hierarchical Deterministic (HD) Wallet] seeds and derived accounts,
24+
with various SLIP-39 sharing parameters. It generates the new random
25+
wallet seed, and generates the expected standard Ethereum account(s)
26+
(at [derivation path] *m/44'/60'/0'/0/0* by default) and Bitcoin
27+
accounts (at Bech32 derivation path *m/84'/0'/0'/0/0* by default),
28+
with wallet address and QR code (compatible with Trezor and Ledger
29+
derivations). It produces the required SLIP-39 phrases, and outputs a
30+
single PDF containing all the required printable cards to document the
31+
seed (and the specified derived accounts).
32+
33+
On an secure (ideally air-gapped) computer, new seeds can /safely/ be
34+
generated (*without trusting this program*) and the PDF saved to a USB
35+
drive for printing (or directly printed without the file being saved
36+
to disk.). Presently, `slip39' can output example ETH, BTC, LTC,
37+
DOGE, BNB, and XRP addresses derived from the seed, to /illustrate/
38+
what accounts are associated with the backed-up seed. Recovery of the
39+
seed to a [Trezor Safe 3] is simple, by entering the mnemonics right
40+
on the device.
41+
42+
We also support the backup of existing insecure and unreliable 12- or
43+
24-word BIP-39 Mnemonic Phrases as SLIP-39 Mnemonic cards, for
44+
existing BIP-39 hardware wallets like the [Ledger Nano], etc.!
45+
Recover from your existing BIP-39 Seed Phrase Mnemonic, select "Using
46+
BIP-39" (and enter your BIP-39 passphrase), and generate a set of
47+
SLIP-39 Mnemonic cards. Later, use the SLIP-39 App to recover from
48+
your SLIP-39 Mnemonic cards, click "Using BIP-39" to get your BIP-39
49+
Mnemonic back, and use it (and your passphrase) to recover your
50+
accounts to your Ledger (or other) hardware wallet.
51+
52+
Output of BIP-38 or JSON encrypted Paper Wallets is also supported,
53+
for import into standard software cryptocurrency wallets.

flake.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@
4040

4141
# All Python versions with packages
4242
#python310Env
43-
python311Env
43+
#python311Env
4444
python312Env
45-
python313Env
45+
#python313Env
4646
#python314Env
4747
];
4848

4949
shellHook = ''
5050
echo "Welcome to the multi-Python development environment!"
5151
echo "Available Python interpreters:"
52-
echo " python (default): $(python --version 2>&1 || echo 'not available')"
53-
#echo " python3.10: $(python3.10 --version 2>&1 || echo 'not available')"
54-
echo " python3.11: $(python3.11 --version 2>&1 || echo 'not available')"
55-
echo " python3.12: $(python3.12 --version 2>&1 || echo 'not available')"
56-
echo " python3.13: $(python3.13 --version 2>&1 || echo 'not available')"
57-
#echo " python3.14: $(python3.14 --version 2>&1 || echo 'not available')"
52+
echo " python (default): $(python --version 2>/dev/null || echo 'not available')"
53+
echo " python3.10: $(python3.10 --version 2>/dev/null || echo 'not available')"
54+
echo " python3.11: $(python3.11 --version 2>/dev/null || echo 'not available')"
55+
echo " python3.12: $(python3.12 --version 2>/dev/null || echo 'not available')"
56+
echo " python3.13: $(python3.13 --version 2>/dev/null || echo 'not available')"
57+
echo " python3.14: $(python3.14 --version 2>/dev/null || echo 'not available')"
5858
echo ""
5959
echo "All versions have pytest, coincurve, scikit-learn, pycryptodome, and pynacl installed."
6060
'';

pyproject.toml

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,107 @@
11
[build-system]
2-
requires = ["setuptools >= 40.9.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools >= 40.9.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "slip39"
7+
dynamic = ["version"]
8+
description = "Standards-compliant SLIP-39 cryptocurrency seed generation and recovery, compatible with Trezor hardware wallets"
9+
readme = {file = "SLIP-39-description.md", content-type = "text/markdown"}
10+
requires-python = ">=3.9"
11+
keywords = ["Ethereum", "Bitcoin", "Dogecoin", "Litecoin", "cryptocurrency", "SLIP-39", "BIP-39", "seed", "recovery", "PDF", "BIP-38", "paper", "wallet"]
12+
license = "GPL-3.0-or-later OR LicenseRef-Proprietary"
13+
license-files = ["LICENSE", "COPYING"]
14+
authors = [
15+
{ name = "Perry Kundert", email = "[email protected]" }
16+
]
17+
classifiers = [
18+
"Programming Language :: Python :: 3",
19+
"Development Status :: 5 - Production/Stable",
20+
"Intended Audience :: Developers",
21+
"Intended Audience :: Financial and Insurance Industry",
22+
"Environment :: Console",
23+
"Topic :: Security :: Cryptography",
24+
"Topic :: Office/Business :: Financial",
25+
]
26+
27+
dependencies = [
28+
"base58 >=2.0.1,<3",
29+
"chacha20poly1305 >=0.0.3",
30+
"click >=8.1.3,<9",
31+
"crypto-licensing >=5.2.3,<6",
32+
"fpdf2 >=2.7.6,<3",
33+
"shamir-mnemonic-slip39 >=0.4.0,<0.5",
34+
"hdwallet-slip39 >=4.0.3,<5",
35+
"tabulate-slip39 >=0.10.6",
36+
"mnemonic >=0.21,<1",
37+
"qrcode >=7.3",
38+
]
39+
40+
[project.optional-dependencies]
41+
gui = [
42+
"FreeSimpleGUI >=5.2,<6",
43+
]
44+
45+
serial = [
46+
"pyserial >=3.5",
47+
]
48+
49+
wallet = [
50+
"eth-account >=0.11.3,<0.12",
51+
]
52+
53+
invoice = [
54+
"eth-account >=0.11.3,<0.12",
55+
"py-solc-x >=1.1.1,<1.2",
56+
"pycryptodome >=3.16,<4",
57+
"requests >=2.20,<3",
58+
"dkimpy[ed25519] >=1.0.5,<2",
59+
"web3[tester] ==6.20.4",
60+
"eth-tester[py-evm] >=0.11.0b1,<0.12.0b1",
61+
"py-geth >=3.14.0,<4",
62+
]
63+
64+
tests = [
65+
"aiosmtpd >=1.4,<2",
66+
"numpy",
67+
"flake8",
68+
"pyinstaller >=6.1",
69+
"pytest >=7.4.2,<8",
70+
"pytest-cov >=4.1.0,<5",
71+
]
72+
73+
dev = [
74+
"build",
75+
"setuptools",
76+
"wheel",
77+
]
78+
79+
[project.urls]
80+
"Bug Tracker" = "https://github.com/pjkundert/python-slip39/issues"
81+
Homepage = "https://github.com/pjkundert/python-slip39"
82+
83+
[project.scripts]
84+
slip39 = "slip39.main:main"
85+
slip39-recovery = "slip39.recovery.main:main"
86+
slip39-generator = "slip39.generator.main:main"
87+
slip39-gui = "slip39.gui.main:main"
88+
slip39-cli = "slip39.cli:cli"
89+
90+
[tool.setuptools]
91+
zip-safe = true
92+
include-package-data = true
93+
94+
[tool.setuptools.packages.find]
95+
where = ["."]
96+
include = ["slip39*"]
97+
98+
[tool.setuptools.package-data]
99+
slip39 = [
100+
"layout/*.png",
101+
"layout/*.txt",
102+
"layout/font/*.ttf",
103+
"gui/*.txt",
104+
]
105+
106+
[tool.setuptools.dynamic]
107+
version = {attr = "slip39.version.__version__"}

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
build
2-
cx_Freeze >=6.12
32
setuptools
43
wheel

requirements-gui.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-invoice.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

requirements-serial.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements-tests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
aiosmtpd >=1.4, <2
22
numpy
33
build
4-
cx_Freeze >=6.12
54
flake8
65
pyinstaller >=6.1
76
pytest >=7.4.2,<8

requirements-wallet.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)