build: scripts to not require electrum to be installed
This commit is contained in:
@@ -14,7 +14,7 @@ set -e
|
||||
mkdir -p signed >/dev/null 2>&1
|
||||
mkdir -p signed/stripped >/dev/null 2>&1
|
||||
|
||||
version=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||
version=$("$CONTRIB"/print_electrum_version.py)
|
||||
|
||||
echo "Found $(ls dist/*.exe | wc -w) files to verify."
|
||||
|
||||
|
||||
22
contrib/print_electrum_version.py
Executable file
22
contrib/print_electrum_version.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python3
|
||||
# For usage in shell, to get the version of electrum, without needing electrum installed.
|
||||
# For example:
|
||||
# $ VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||
# instead of
|
||||
# $ VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||
|
||||
import importlib.util
|
||||
import os
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
version_file_path = os.path.join(project_root, "electrum", "version.py")
|
||||
|
||||
# load version.py; needlessly complicated alternative to "imp.load_source":
|
||||
version_spec = importlib.util.spec_from_file_location('version', version_file_path)
|
||||
version_module = version = importlib.util.module_from_spec(version_spec)
|
||||
version_spec.loader.exec_module(version_module)
|
||||
|
||||
print(version.ELECTRUM_VERSION)
|
||||
|
||||
@@ -79,7 +79,7 @@ if [ ! -z "$RELEASEMANAGER" ] ; then
|
||||
fi
|
||||
|
||||
|
||||
VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||
VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||
info "VERSION: $VERSION"
|
||||
REV=$(git describe --tags)
|
||||
info "REV: $REV"
|
||||
|
||||
@@ -34,7 +34,7 @@ if [ -z "$ELECTRUM_SIGNING_WALLET" ] || [ -z "$ELECTRUM_SIGNING_ADDRESS" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||
VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||
info "VERSION: $VERSION"
|
||||
|
||||
set -x
|
||||
|
||||
@@ -16,7 +16,7 @@ fi
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
|
||||
VERSION=$("$CONTRIB"/print_electrum_version.py)
|
||||
echo "$VERSION"
|
||||
|
||||
if [ -z "$ELECBUILD_UPLOADFROM" ]; then
|
||||
|
||||
Reference in New Issue
Block a user