-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
treewide: make snagfactory an optional package feature
The Kivy dependency is causing issues for some users. These users are not necessarily interested in snagfactory and only want to use snagboot and snagflash. Add an optional "gui" dependency group and move the Kivy dependency to this new group. Snagfactory will not be available unless this dependency group is selected during installation. Signed-off-by: Romain Gantois <[email protected]>
- Loading branch information
Showing
6 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
#!/bin/env sh | ||
|
||
PACKAGE_VERSION_PATTERN='([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?' | ||
VENV=$(python3 -c "import sys;print(sys.prefix != sys.base_prefix)") | ||
EXTRA="" | ||
if [ "$VENV" = "False" ]; then | ||
EXTRA="--user" | ||
fi | ||
|
||
snagboot_version=$(grep "__version__" src/snagrecover/__init__.py | grep -E -o "$PACKAGE_VERSION_PATTERN") | ||
|
||
python3 -m pip install $EXTRA build || exit 1 | ||
|
||
#old binaries in dist can confuse build | ||
rm -f dist/snagboot-*.whl dist/snagboot*.tar.gz | ||
python3 -m build || exit 2 | ||
|
||
python3 -m pip install $EXTRA dist/snagboot-*-py3-none-any.whl --force-reinstall || exit 3 | ||
if [ "$1" = "--with-gui" ]; then | ||
GUI_FEATURE="[gui]" | ||
else | ||
GUI_FEATURE="" | ||
fi | ||
|
||
python3 -m pip install $EXTRA "dist/snagboot-$snagboot_version-py3-none-any.whl$GUI_FEATURE" --force-reinstall || exit 3 | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,11 @@ where = ["src"] | |
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "snagrecover.__version__"} | ||
optional-dependencies.gui = {file = ["src/snagfactory/gui-requirements.txt"]} | ||
|
||
[project] | ||
name = "snagboot" | ||
dynamic = ["version"] | ||
dynamic = ["version", "optional-dependencies"] | ||
authors = [ | ||
{ name="Romain Gantois", email="[email protected]" }, | ||
] | ||
|
@@ -34,7 +35,7 @@ dependencies = [ | |
"crccheck >= 1.3.0", | ||
"pylibfdt >= 1.7.0.post1", | ||
"swig >= 4.1.1", | ||
"kivy == 2.3.0", | ||
"packaging >= 24.2" | ||
] | ||
|
||
[project.urls] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kivy == 2.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters