forked from selfcustody/krux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (145 loc) · 6.36 KB
/
pyproject.toml
File metadata and controls
170 lines (145 loc) · 6.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# The MIT License (MIT)
# Copyright (c) 2021-2023 Krux contributors
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
[tool.poetry]
name = "krux"
version = "25.10.1"
description = "Open-source signing device firmware for Bitcoin"
authors = ["Jeff S <jeffreesun@protonmail.com>"]
readme = "README.md"
license = "MIT"
[tool.poetry.dependencies]
python = "^3.12.3"
translate = "^3.6.1"
embit = { path = "./vendor/embit/", develop = true }
ur = { path = "./vendor/foundation-ur-py/", develop = true }
urtypes = { path = "./vendor/urtypes/", develop = true }
# Docs site dependencies. Optional extras
mkdocs = { version = "^1.6.1", optional = true }
mkdocs-material = { version = "^9.6.18", optional = true }
mkdocs-static-i18n = { version = "^1.3.0", optional = true }
pymdown-extensions = { version = "^10.16.1", optional = true }
mkdocs-macros-plugin = { version = "^1.3.9", optional = true }
# Simulator dependencies. Optional extras
numpy = { version = "^2.3.2", optional = true }
opencv-python = { version = "^4.11.0.86", optional = true }
Pillow = { version = "^11.3.0", optional = true }
pygame = { version = "^2.6.1", optional = true }
pyzbar = { version = "^0.1.9", optional = true }
# Flash dependencies. Optional extras
pyserial = { version = "^3.5", optional = true }
# Sign release script via QR Codes. Optional extras
qrcode = { version = "^8.2", optional = true }
[tool.poetry.group.dev.dependencies]
black = "^25.1.0"
pylint = "^4.0.2"
pytest = "^8.4.2"
pytest-cov = "^5.0.0"
pytest-mock = "^3.15.0"
PyQRCode = "^1.2.1"
pycryptodome = "^3.23.0"
poethepoet = "^0.37.0"
vulture = "^2.14"
[tool.poetry.extras]
docs = ["mkdocs", "mkdocs-material", "mkdocs-static-i18n", "pymdown-extensions", "mkdocs-macros-plugin"]
simulator = ["numpy", "opencv-python", "Pillow", "pygame", "pyzbar"]
flash = ["pyserial"]
sign = ["qrcode"]
[tool.poe.tasks]
# format tasks
format-src = "black src"
format-tests = "black tests"
format-scripts = "black firmware/font firmware/scripts i18n/*.py"
format = ["format-src", "format-tests", "format-scripts"]
# aliases
black.ref = "format"
format-test.ref = "format-tests"
# pylint tasks
lint-src = "pylint src"
lint-scripts = "pylint firmware/font/*.py firmware/scripts/*.py i18n/*.py"
lint = ["lint-src", "lint-scripts"]
# aliases
pylint.ref = "lint"
# vulture tasks
vulture-src = "vulture src"
vulture.ref = "vulture-src vulture_whitelist.py"
vulture-make = { shell = "vulture src --make-whitelist > vulture_whitelist.py" }
vulture-whitelist.ref = "vulture-make"
# test tasks
test-clean = """python -c 'import shutil, os; os.path.exists("htmlcov") and shutil.rmtree("htmlcov")'"""
test-cov = "pytest --cache-clear --cov src/krux --cov-report html ./tests --cov-context=test --cov-report term-missing"
test-verbose = "pytest --cache-clear --cov src/krux --cov-report html --show-capture all --capture tee-sys -r A ./tests"
test-simple = "pytest --cache-clear ./tests"
# aliases
tests = ["test-clean", "test-cov"]
test.ref = "tests"
pytest.ref = "tests"
# pre commit task (do formatting, linting and tests)
pre-commit = ["format", "lint", "i18n validate", "vulture", "test-simple"]
pre-release = ["format", "lint", "i18n validate", "i18n-build", "update-glyphs", "vulture", "test-simple"]
# run docs locally
docs = "poetry run mkdocs serve"
# translations tasks
i18n = "python i18n/i18n.py"
i18n-bake = "python i18n/i18n.py clean prettify bake"
format-translations = "black src/krux/translations/*.py"
i18n-build = ["i18n-bake", "format-translations", "i18n validate"]
# aliases
translations.ref = "i18n-build"
# simulator tasks
# tasks below accept additional arguments
simulator-amigo = "python simulator/simulator.py --device maixpy_amigo"
simulator-m5stickv = "python simulator/simulator.py --device maixpy_m5stickv"
simulator-dock = "python simulator/simulator.py --device maixpy_dock"
simulator-yahboom = "python simulator/simulator.py --device maixpy_yahboom"
simulator-cube = "python simulator/simulator.py --device maixpy_cube"
simulator-wonder-mv = "python simulator/simulator.py --device maixpy_wonder_mv"
simulator-tzt = "python simulator/simulator.py --device maixpy_tzt"
simulator-wonder-k = "python simulator/simulator.py --device maixpy_wonder_k"
# aliases
simulator.ref = "simulator-amigo"
simulator-m5.ref = "simulator-m5stickv"
simulator-mv.ref = "simulator-wonder-mv"
simulator-wonder.ref = "simulator-wonder-mv"
simulator-wondermv.ref = "simulator-wonder-mv"
simulator-wonderk.ref = "simulator-wonder-k"
simulator-k.ref = "simulator-wonder-k"
# git tasks
git-update = "git submodule update --init --recursive"
git-pull = "git pull git@github.com:selfcustody/krux.git"
git-pull-https = "git pull https://github.com/selfcustody/krux.git"
# ktool tasks
ktool-cmd = "python firmware/Kboot/build/ktool.py -b 2000000"
flash-cmd.ref = "ktool-cmd build/kboot.kfpkg"
flash.ref = "flash-cmd -B goE"
flash-dock.ref = "flash-cmd -B dan"
boot-cmd.ref = "ktool-cmd -s build/firmware.bin"
boot.ref = "boot-cmd -B goE"
boot-dock.ref = "boot-cmd -B dan"
terminal.ref = "ktool-cmd -T" # for yahboom add param: --reset
erase.ref = "ktool-cmd -B goE -E"
erase-dock.ref = "ktool-cmd -B dan -E"
# task for bdftokff font glyphs update
update-glyphs = "python ./firmware/font/bdftokff.py True"
glyphs.ref = "update-glyphs"
fonts.ref = "update-glyphs"
# task for sign_release?
# python sign_release.py
# task for missing glyphs
missing-glyphs = "python ./firmware/font/missing_glyphs.py"
fonts-missing.ref = "missing-glyphs"
missing.ref = "missing-glyphs"