forked from selfcustody/krux
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
137 lines (115 loc) · 4.84 KB
/
pyproject.toml
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
# 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 = "24.11.0"
description = "Open-source signing device firmware for Bitcoin"
authors = ["Jeff S <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.9.1"
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 = "^1.6.0"
mkdocs-material = "^9.5.28"
mkdocs-static-i18n = "^1.2.3"
pymdown-extensions = "^10.8.1"
mkdocs-macros-plugin = "^1.0.5"
# Simulator dependencies. Optional extras
numpy = { version = "^1.25.2", optional = true }
opencv-python = { version = "^4.8.0.74", optional = true }
Pillow = { version = "^10.0.1", optional = true }
pygame = { version = "^2.5.0", optional = true }
pyzbar = { version = "^0.1.9", optional = true }
# Flash dependencies. Optional extras
pyserial = { version = "^3.5", optional = true }
qrcode = "^7.4.2"
[tool.poetry.group.dev.dependencies]
black = "^24.4.2"
pylint = "^3.2.5"
pytest = "^8.2.2"
pytest-cov = "^5.0.0"
pytest-mock = "^3.14.0"
PyQRCode = "^1.2.1"
pycryptodome = "^3.17.0"
poethepoet = "^0.24.4"
dill = "^0.3.8"
[tool.poetry.extras]
docs = ["mkdocs", "mkdocs-material", "mkdocs-static-i18n", "pymdown-extensions"]
simulator = ["numpy", "opencv-python", "Pillow", "pygame", "pyzbar"]
flash = ["pyserial"]
[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"
# 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", "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"
# aliases
simulator.ref = "simulator-amigo"
simulator-m5.ref = "simulator-m5stickv"
# git tasks
git-update = "git submodule update --init --recursive"
git-pull = "git pull [email protected]:selfcustody/krux.git"
git-pull-https = "git pull https://github.com/selfcustody/krux.git"
# flash tasks
flash-cmd = "python firmware/Kboot/build/ktool.py -b 1500000 build/kboot.kfpkg"
flash.ref = "flash-cmd -B goE"
flash-dock.ref = "flash-cmd -B dan"
# task for bdftokff?
# python bdftokff.py True
# task for sign_release?
# python sign_release.py