2025-09-03 16:03:14 +00:00
|
|
|
# unittests using the 'latest' runtime python-dependencies
|
2021-09-13 16:20:54 +00:00
|
|
|
task:
|
|
|
|
|
container:
|
|
|
|
|
image: $ELECTRUM_IMAGE
|
|
|
|
|
cpu: 1
|
2023-01-26 14:47:39 +00:00
|
|
|
memory: 2G
|
2021-09-13 16:20:54 +00:00
|
|
|
matrix:
|
2025-09-03 16:03:14 +00:00
|
|
|
- name: "unittests: py$ELECTRUM_PYTHON_VERSION"
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
|
|
|
|
ELECTRUM_IMAGE: python:$ELECTRUM_PYTHON_VERSION
|
|
|
|
|
matrix:
|
2022-02-08 12:43:04 +01:00
|
|
|
- env:
|
|
|
|
|
ELECTRUM_PYTHON_VERSION: 3.10
|
2021-09-13 16:20:54 +00:00
|
|
|
- env:
|
2023-02-20 12:00:38 +00:00
|
|
|
ELECTRUM_PYTHON_VERSION: 3.11
|
2023-12-24 05:38:06 +00:00
|
|
|
- env:
|
|
|
|
|
ELECTRUM_PYTHON_VERSION: 3.12
|
2024-10-18 15:10:03 +00:00
|
|
|
- env:
|
|
|
|
|
ELECTRUM_PYTHON_VERSION: 3.13
|
2025-09-03 16:03:14 +00:00
|
|
|
- name: "unittests: py3.13, debug-mode"
|
2023-02-20 12:00:38 +00:00
|
|
|
env:
|
2025-03-04 15:50:36 +00:00
|
|
|
ELECTRUM_PYTHON_VERSION: 3.13
|
2023-02-20 12:00:38 +00:00
|
|
|
# enable additional checks:
|
|
|
|
|
PYTHONASYNCIODEBUG: "1"
|
|
|
|
|
PYTHONDEVMODE: "1"
|
2021-09-13 16:20:54 +00:00
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
2022-02-15 18:08:59 +01:00
|
|
|
fingerprint_script: echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS_CI && cat $ELECTRUM_REQUIREMENTS
|
2021-09-13 16:20:54 +00:00
|
|
|
tag_script:
|
|
|
|
|
- git tag
|
2024-05-28 17:13:17 +00:00
|
|
|
libsecp_build_cache:
|
|
|
|
|
folder: contrib/_saved_secp256k1_build
|
|
|
|
|
fingerprint_script: sha256sum ./contrib/make_libsecp256k1.sh
|
|
|
|
|
populate_script:
|
2025-09-03 14:49:34 +00:00
|
|
|
- apt-get update
|
2024-05-28 17:13:17 +00:00
|
|
|
- apt-get -y install automake libtool
|
|
|
|
|
- ./contrib/make_libsecp256k1.sh
|
|
|
|
|
- mkdir contrib/_saved_secp256k1_build
|
|
|
|
|
- cp electrum/libsecp256k1.so.* contrib/_saved_secp256k1_build/
|
2025-09-03 14:49:34 +00:00
|
|
|
install_script:
|
|
|
|
|
- apt-get update
|
|
|
|
|
# qml test reqs:
|
|
|
|
|
- apt-get -y install libgl1 libegl1 libxkbcommon0 libdbus-1-3
|
|
|
|
|
- pip install -r $ELECTRUM_REQUIREMENTS_CI
|
|
|
|
|
# electrum itself:
|
2024-10-07 15:59:09 +00:00
|
|
|
- export ELECTRUM_ECC_DONT_COMPILE=1
|
2025-09-03 14:49:34 +00:00
|
|
|
- pip install ".[tests,qml_gui]"
|
|
|
|
|
version_script:
|
2025-09-03 16:03:14 +00:00
|
|
|
- python3 --version
|
2025-09-03 14:49:34 +00:00
|
|
|
- pip freeze --all
|
|
|
|
|
pytest_script:
|
|
|
|
|
- >
|
|
|
|
|
coverage run --source=electrum \
|
|
|
|
|
"--omit=electrum/gui/*,electrum/plugins/*,electrum/scripts/*" \
|
|
|
|
|
-m pytest tests -v
|
|
|
|
|
- coverage report
|
2021-09-13 16:20:54 +00:00
|
|
|
coveralls_script:
|
2021-09-28 16:30:41 +02:00
|
|
|
- if [ ! -z "$COVERALLS_REPO_TOKEN" ] ; then coveralls ; fi
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2024-10-01 10:24:58 +02:00
|
|
|
LD_LIBRARY_PATH: contrib/_saved_secp256k1_build/
|
2022-11-03 23:46:55 +00:00
|
|
|
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
|
2022-02-15 18:08:59 +01:00
|
|
|
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
|
2021-09-13 19:51:56 +02:00
|
|
|
# following CI_* env vars are set up for coveralls
|
|
|
|
|
CI_NAME: "CirrusCI"
|
2021-09-13 20:22:29 +02:00
|
|
|
CI_BUILD_NUMBER: $CIRRUS_BUILD_ID
|
|
|
|
|
CI_JOB_ID: $CIRRUS_TASK_ID
|
2021-09-13 19:51:56 +02:00
|
|
|
CI_BUILD_URL: "https://cirrus-ci.com/task/$CIRRUS_TASK_ID"
|
|
|
|
|
CI_BRANCH: $CIRRUS_BRANCH
|
|
|
|
|
CI_PULL_REQUEST: $CIRRUS_PR
|
|
|
|
|
# in addition, COVERALLS_REPO_TOKEN is set as an "override" in https://cirrus-ci.com/settings/...
|
2023-04-24 13:14:58 +00:00
|
|
|
depends_on:
|
2023-09-06 16:24:11 +00:00
|
|
|
- "linter: Flake8 Mandatory"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
2025-09-03 16:03:14 +00:00
|
|
|
# unittests using the ~same frozen dependencies that are used in the released binaries
|
|
|
|
|
# note: not using pinned pyqt here, due to "qml_gui" extra
|
|
|
|
|
task:
|
|
|
|
|
container:
|
|
|
|
|
image: $ELECTRUM_IMAGE
|
|
|
|
|
cpu: 1
|
|
|
|
|
memory: 2G
|
|
|
|
|
name: "unittests: py3.10, frozen-deps"
|
|
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
|
|
|
|
fingerprint_script: echo $ELECTRUM_IMAGE && cat contrib/requirements/requirements*.txt && cat contrib/deterministic-build/requirements*.txt
|
|
|
|
|
tag_script:
|
|
|
|
|
- git tag
|
|
|
|
|
libsecp_build_cache:
|
|
|
|
|
folder: contrib/_saved_secp256k1_build
|
|
|
|
|
fingerprint_script: sha256sum ./contrib/make_libsecp256k1.sh
|
|
|
|
|
populate_script:
|
|
|
|
|
- apt-get update
|
|
|
|
|
- apt-get -y install automake libtool
|
|
|
|
|
- ./contrib/make_libsecp256k1.sh
|
|
|
|
|
- mkdir contrib/_saved_secp256k1_build
|
|
|
|
|
- cp electrum/libsecp256k1.so.* contrib/_saved_secp256k1_build/
|
|
|
|
|
install_script:
|
|
|
|
|
- apt-get update
|
|
|
|
|
# qml test reqs:
|
|
|
|
|
- apt-get -y install libgl1 libegl1 libxkbcommon0 libdbus-1-3
|
|
|
|
|
- pip install -r contrib/deterministic-build/requirements-build-base.txt
|
|
|
|
|
- pip install -r contrib/requirements/requirements-ci.txt
|
|
|
|
|
# electrum itself:
|
|
|
|
|
- export ELECTRUM_ECC_DONT_COMPILE=1
|
|
|
|
|
- pip install -r contrib/deterministic-build/requirements.txt -r contrib/deterministic-build/requirements-binaries.txt
|
|
|
|
|
- pip install ".[tests,qml_gui]"
|
|
|
|
|
version_script:
|
|
|
|
|
- python3 --version
|
|
|
|
|
- pip freeze --all
|
|
|
|
|
pytest_script:
|
|
|
|
|
- pytest tests -v
|
|
|
|
|
env:
|
|
|
|
|
ELECTRUM_IMAGE: python:3.10
|
|
|
|
|
LD_LIBRARY_PATH: contrib/_saved_secp256k1_build/
|
|
|
|
|
depends_on:
|
|
|
|
|
- "linter: Flake8 Mandatory"
|
|
|
|
|
|
2021-09-13 16:20:54 +00:00
|
|
|
task:
|
2023-09-06 16:21:18 +00:00
|
|
|
name: "locale: upload to crowdin"
|
2021-09-13 16:20:54 +00:00
|
|
|
container:
|
|
|
|
|
image: $ELECTRUM_IMAGE
|
|
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
|
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
2022-02-15 18:08:59 +01:00
|
|
|
fingerprint_script: echo Locale && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS_CI
|
2021-09-13 16:20:54 +00:00
|
|
|
install_script:
|
|
|
|
|
- apt-get update
|
2025-04-07 17:16:02 +00:00
|
|
|
- apt-get -y install gettext qt6-l10n-tools
|
2022-02-15 18:08:59 +01:00
|
|
|
- pip install -r $ELECTRUM_REQUIREMENTS_CI
|
2021-09-13 16:20:54 +00:00
|
|
|
- pip install requests
|
2025-04-14 18:08:31 +00:00
|
|
|
submodules_script:
|
|
|
|
|
- git submodule update --init
|
2021-09-13 16:20:54 +00:00
|
|
|
locale_script:
|
2025-04-10 17:45:21 +00:00
|
|
|
- contrib/locale/push_locale.py
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2025-01-10 13:16:04 +00:00
|
|
|
ELECTRUM_IMAGE: python:3.10
|
2022-11-03 23:46:55 +00:00
|
|
|
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
|
2021-09-14 20:17:10 +02:00
|
|
|
# in addition, crowdin_api_key is set as an "override" in https://cirrus-ci.com/settings/...
|
2021-09-13 16:20:54 +00:00
|
|
|
depends_on:
|
2025-09-03 16:03:14 +00:00
|
|
|
- "unittests: py3.10"
|
2021-09-13 16:20:54 +00:00
|
|
|
only_if: $CIRRUS_BRANCH == 'master'
|
|
|
|
|
|
|
|
|
|
task:
|
2023-11-02 19:03:15 +01:00
|
|
|
name: "Regtest functional tests"
|
2021-12-28 04:46:47 +00:00
|
|
|
compute_engine_instance:
|
|
|
|
|
image_project: cirrus-images
|
|
|
|
|
image: family/docker-builder
|
|
|
|
|
platform: linux
|
2021-09-13 16:20:54 +00:00
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
|
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
2021-12-28 04:46:47 +00:00
|
|
|
fingerprint_script: echo Regtest && echo docker_builder && cat $ELECTRUM_REQUIREMENTS
|
2021-09-13 16:20:54 +00:00
|
|
|
bitcoind_cache:
|
|
|
|
|
folder: /tmp/bitcoind
|
|
|
|
|
populate_script: mkdir -p /tmp/bitcoind
|
|
|
|
|
install_script:
|
|
|
|
|
- apt-get update
|
2024-04-11 16:37:27 +00:00
|
|
|
- apt-get -y install curl jq bc
|
2025-02-05 13:15:00 +00:00
|
|
|
- python3 -m pip install --user --upgrade pip
|
2024-04-11 16:37:27 +00:00
|
|
|
# install electrum
|
2024-10-07 15:59:09 +00:00
|
|
|
- export ELECTRUM_ECC_DONT_COMPILE=1 # we build manually to make caching it easier
|
fix failing pip installs in regtest CI
It seems like the OS version of the CI image has been bumped, the regtest of PR https://github.com/spesmilo/electrum/pull/10073 fails for me with this error:
```
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 111702 files and directories currently installed.)
Preparing to unpack .../jq_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking jq (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Preparing to unpack .../libjq1_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Setting up libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) ...
Setting up jq (1.7.1-3ubuntu0.24.04.1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.5) ...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
python3 -m pip install --user --upgrade pip
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
```
This should make the pip installs work again, however not sure how to test it *on* the CI? i it locally and it seems to work on Ubuntu 24.04 with this patch.
2025-07-22 17:03:21 +02:00
|
|
|
- python3 -m pip install .[tests] --ignore-installed # ignore installed system installed attrs
|
2025-06-13 23:53:29 +00:00
|
|
|
# install e-x some commits after 1.18.0 tag
|
|
|
|
|
- python3 -m pip install git+https://github.com/spesmilo/electrumx.git@0b260d4345242cc41e316e97d7de10ae472fd172
|
2021-09-13 16:20:54 +00:00
|
|
|
- "BITCOIND_VERSION=$(curl https://bitcoincore.org/en/download/ | grep -E -i --only-matching 'Latest version: [0-9\\.]+' | grep -E --only-matching '[0-9\\.]+')"
|
|
|
|
|
- BITCOIND_FILENAME=bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
|
|
|
|
|
- BITCOIND_PATH=/tmp/bitcoind/$BITCOIND_FILENAME
|
|
|
|
|
- BITCOIND_URL=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/$BITCOIND_FILENAME
|
|
|
|
|
- tar -xaf $BITCOIND_PATH || (rm -f /tmp/bitcoind/* && curl --output $BITCOIND_PATH $BITCOIND_URL && tar -xaf $BITCOIND_PATH)
|
|
|
|
|
- cp -a bitcoin-$BITCOIND_VERSION/* /usr/
|
2024-04-11 16:37:27 +00:00
|
|
|
libsecp_build_cache:
|
|
|
|
|
folder: contrib/_saved_secp256k1_build
|
|
|
|
|
fingerprint_script: sha256sum ./contrib/make_libsecp256k1.sh
|
|
|
|
|
populate_script:
|
|
|
|
|
- apt-get -y install automake libtool
|
|
|
|
|
- ./contrib/make_libsecp256k1.sh
|
|
|
|
|
- mkdir contrib/_saved_secp256k1_build
|
|
|
|
|
- cp electrum/libsecp256k1.so.* contrib/_saved_secp256k1_build/
|
2021-09-13 16:20:54 +00:00
|
|
|
bitcoind_service_background_script:
|
2024-02-16 17:41:34 +01:00
|
|
|
- tests/regtest/run_bitcoind.sh
|
2021-09-13 16:20:54 +00:00
|
|
|
electrumx_service_background_script:
|
2024-02-16 17:41:34 +01:00
|
|
|
- tests/regtest/run_electrumx.sh
|
2021-09-13 16:20:54 +00:00
|
|
|
regtest_script:
|
|
|
|
|
- sleep 10s
|
2024-02-16 17:41:34 +01:00
|
|
|
- python3 -m unittest tests/regtest.py
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2024-10-01 10:24:58 +02:00
|
|
|
LD_LIBRARY_PATH: contrib/_saved_secp256k1_build/
|
2022-02-15 18:08:59 +01:00
|
|
|
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
|
fix failing pip installs in regtest CI
It seems like the OS version of the CI image has been bumped, the regtest of PR https://github.com/spesmilo/electrum/pull/10073 fails for me with this error:
```
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 111702 files and directories currently installed.)
Preparing to unpack .../jq_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking jq (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Preparing to unpack .../libjq1_1.7.1-3ubuntu0.24.04.1_amd64.deb ...
Unpacking libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) over (1.7.1-3build1) ...
Setting up libjq1:amd64 (1.7.1-3ubuntu0.24.04.1) ...
Setting up jq (1.7.1-3ubuntu0.24.04.1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.5) ...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
python3 -m pip install --user --upgrade pip
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
```
This should make the pip installs work again, however not sure how to test it *on* the CI? i it locally and it seems to work on Ubuntu 24.04 with this patch.
2025-07-22 17:03:21 +02:00
|
|
|
PIP_BREAK_SYSTEM_PACKAGES: 1
|
2021-09-13 16:20:54 +00:00
|
|
|
# ElectrumX exits with an error without this:
|
|
|
|
|
ALLOW_ROOT: 1
|
2023-11-02 19:03:15 +01:00
|
|
|
depends_on:
|
|
|
|
|
- "linter: Flake8 Mandatory"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
|
|
|
|
task:
|
|
|
|
|
container:
|
|
|
|
|
image: $ELECTRUM_IMAGE
|
|
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
|
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
|
|
|
|
fingerprint_script: echo Flake8 && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS
|
|
|
|
|
install_script:
|
ci: enable more flake8 stuff
```
$ export ELECTRUM_LINTERS=E9,E101,E129,E273,E274,E703,E71,E722,F5,F6,F7,F8,W191,W29,B
$ export ELECTRUM_LINTERS_IGNORE=B007,B009,B010,B019,B036,F541,F841
$ flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
./electrum/commands.py:98:1: F811 redefinition of unused 'format_satoshis' from line 48
def format_satoshis(x):
^
./electrum/commands.py:437:9: F811 redefinition of unused 'Mnemonic' from line 62
from .mnemonic import Mnemonic
^
./electrum/gui/qt/wizard/wallet.py:37:5: F811 redefinition of unused 'Daemon' from line 14
from electrum.daemon import Daemon
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'Optional' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'TYPE_CHECKING' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/plugin.py:966:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/plugin.py:1040:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/util.py:44:1: F811 redefinition of unused 'json' from line 26
import json
^
./electrum/util.py:46:1: F811 redefinition of unused 'NamedTuple' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:46:1: F811 redefinition of unused 'Optional' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:1456:56: F811 redefinition of unused 'traceback' from line 34
async def __aexit__(self, exc_type, exc_value, traceback):
^
./electrum/wallet_db.py:536:9: F811 redefinition of unused 'LOCAL' from line 46
LOCAL = 1
^
./electrum/wallet_db.py:537:9: F811 redefinition of unused 'REMOTE' from line 46
REMOTE = -1
^
./tests/test_bitcoin.py:28:1: F811 redefinition of unused 'bitcoin' from line 9
from electrum import crypto, constants, bitcoin
^
./tests/test_txbatcher.py:11:1: F811 redefinition of unused 'Transaction' from line 7
from electrum.transaction import Transaction, PartialTxInput, PartialTxOutput, TxOutpoint
^
./tests/test_wallet_vertical.py:20:1: F811 redefinition of unused 'Transaction' from line 10
from electrum.transaction import Transaction, PartialTxOutput, tx_from_any, Sighash
^
16 F811 redefinition of unused 'format_satoshis' from line 48
16
```
2025-04-02 16:16:05 +00:00
|
|
|
- pip install "flake8==7.2.0" "flake8-bugbear==24.12.12"
|
2021-09-13 16:20:54 +00:00
|
|
|
flake8_script:
|
2023-04-23 02:33:05 +00:00
|
|
|
- flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2025-01-10 13:16:04 +00:00
|
|
|
ELECTRUM_IMAGE: python:3.10
|
2022-02-15 18:08:59 +01:00
|
|
|
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
|
2021-09-13 16:20:54 +00:00
|
|
|
matrix:
|
2023-09-06 16:21:18 +00:00
|
|
|
- name: "linter: Flake8 Mandatory"
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2022-10-31 16:13:22 +00:00
|
|
|
# list of error codes:
|
|
|
|
|
# - https://flake8.pycqa.org/en/latest/user/error-codes.html
|
|
|
|
|
# - https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
|
2023-04-23 02:33:05 +00:00
|
|
|
# - https://github.com/PyCQA/flake8-bugbear/tree/8c0e7eb04217494d48d0ab093bf5b31db0921989#list-of-warnings
|
ci: enable more flake8 stuff
```
$ export ELECTRUM_LINTERS=E9,E101,E129,E273,E274,E703,E71,E722,F5,F6,F7,F8,W191,W29,B
$ export ELECTRUM_LINTERS_IGNORE=B007,B009,B010,B019,B036,F541,F841
$ flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/"
./electrum/commands.py:98:1: F811 redefinition of unused 'format_satoshis' from line 48
def format_satoshis(x):
^
./electrum/commands.py:437:9: F811 redefinition of unused 'Mnemonic' from line 62
from .mnemonic import Mnemonic
^
./electrum/gui/qt/wizard/wallet.py:37:5: F811 redefinition of unused 'Daemon' from line 14
from electrum.daemon import Daemon
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'Optional' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/lntransport.py:14:1: F811 redefinition of unused 'TYPE_CHECKING' from line 12
from typing import NamedTuple, List, Tuple, Mapping, Optional, TYPE_CHECKING, Union, Dict, Set, Sequence
^
./electrum/plugin.py:966:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/plugin.py:1040:13: F811 redefinition of unused 'hid' from line 593
import hid
^
./electrum/util.py:44:1: F811 redefinition of unused 'json' from line 26
import json
^
./electrum/util.py:46:1: F811 redefinition of unused 'NamedTuple' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:46:1: F811 redefinition of unused 'Optional' from line 29
from typing import NamedTuple, Optional
^
./electrum/util.py:1456:56: F811 redefinition of unused 'traceback' from line 34
async def __aexit__(self, exc_type, exc_value, traceback):
^
./electrum/wallet_db.py:536:9: F811 redefinition of unused 'LOCAL' from line 46
LOCAL = 1
^
./electrum/wallet_db.py:537:9: F811 redefinition of unused 'REMOTE' from line 46
REMOTE = -1
^
./tests/test_bitcoin.py:28:1: F811 redefinition of unused 'bitcoin' from line 9
from electrum import crypto, constants, bitcoin
^
./tests/test_txbatcher.py:11:1: F811 redefinition of unused 'Transaction' from line 7
from electrum.transaction import Transaction, PartialTxInput, PartialTxOutput, TxOutpoint
^
./tests/test_wallet_vertical.py:20:1: F811 redefinition of unused 'Transaction' from line 10
from electrum.transaction import Transaction, PartialTxOutput, tx_from_any, Sighash
^
16 F811 redefinition of unused 'format_satoshis' from line 48
16
```
2025-04-02 16:16:05 +00:00
|
|
|
ELECTRUM_LINTERS: E9,E101,E129,E273,E274,E703,E71,E722,F5,F6,F7,F8,W191,W29,B
|
|
|
|
|
ELECTRUM_LINTERS_IGNORE: B007,B009,B010,B019,B036,F541,F841
|
2023-09-06 16:21:18 +00:00
|
|
|
- name: "linter: Flake8 Non-Mandatory"
|
2021-09-13 16:20:54 +00:00
|
|
|
env:
|
2023-04-23 02:33:05 +00:00
|
|
|
ELECTRUM_LINTERS: E,F,W,C90,B
|
|
|
|
|
ELECTRUM_LINTERS_IGNORE: ""
|
2021-09-13 16:20:54 +00:00
|
|
|
allow_failures: true
|
|
|
|
|
|
2025-05-09 16:54:23 +00:00
|
|
|
task:
|
|
|
|
|
name: "linter: ban unicode"
|
|
|
|
|
container:
|
|
|
|
|
image: python:3.10
|
|
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
|
|
|
|
main_script:
|
|
|
|
|
- contrib/ban_unicode.py
|
2024-01-16 15:48:45 +00:00
|
|
|
|
|
|
|
|
# Cron jobs configured in https://cirrus-ci.com/settings/...
|
|
|
|
|
# - job "nightly" on branch "master" at "0 30 2 * * ?" (every day at 02:30Z)
|
2021-09-13 16:20:54 +00:00
|
|
|
task:
|
2023-09-06 16:21:18 +00:00
|
|
|
name: "build: Windows"
|
2024-01-16 15:48:45 +00:00
|
|
|
matrix:
|
|
|
|
|
- trigger_type: manual
|
|
|
|
|
only_if: $CIRRUS_CRON == ""
|
|
|
|
|
- trigger_type: automatic
|
|
|
|
|
only_if: $CIRRUS_CRON == "nightly"
|
2021-09-13 16:20:54 +00:00
|
|
|
container:
|
|
|
|
|
dockerfile: contrib/build-wine/Dockerfile
|
|
|
|
|
cpu: 1
|
2024-10-07 19:01:10 +00:00
|
|
|
memory: 3G
|
2022-11-04 00:37:20 +00:00
|
|
|
pip_cache:
|
2024-09-06 16:09:01 +00:00
|
|
|
folders:
|
2024-10-04 13:57:31 +00:00
|
|
|
- contrib/build-wine/.cache/win*/wine_pip_cache
|
2022-11-04 00:37:20 +00:00
|
|
|
fingerprint_script:
|
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/deterministic-build/*.txt
|
|
|
|
|
- git ls-files -s contrib/build-wine/
|
2022-11-04 05:52:27 +00:00
|
|
|
build2_cache:
|
2024-09-06 16:09:01 +00:00
|
|
|
folders:
|
2024-10-04 13:57:31 +00:00
|
|
|
- contrib/build-wine/.cache/win*/build
|
2022-11-04 00:37:20 +00:00
|
|
|
fingerprint_script:
|
2022-11-04 04:20:30 +00:00
|
|
|
- echo $CIRRUS_TASK_NAME
|
2022-11-04 00:37:20 +00:00
|
|
|
- cat contrib/make_libsecp256k1.sh | sha256sum
|
|
|
|
|
- cat contrib/make_libusb.sh | sha256sum
|
|
|
|
|
- cat contrib/make_zbar.sh | sha256sum
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/build-wine/
|
2021-09-13 16:20:54 +00:00
|
|
|
build_script:
|
|
|
|
|
- cd contrib/build-wine
|
|
|
|
|
- ./make_win.sh
|
|
|
|
|
binaries_artifacts:
|
|
|
|
|
path: "contrib/build-wine/dist/*"
|
|
|
|
|
env:
|
|
|
|
|
CIRRUS_WORKING_DIR: /opt/wine64/drive_c/electrum
|
2022-08-22 12:20:28 +00:00
|
|
|
CIRRUS_DOCKER_CONTEXT: contrib/build-wine
|
2023-04-24 13:14:58 +00:00
|
|
|
depends_on:
|
2025-09-03 16:03:14 +00:00
|
|
|
- "unittests: py3.10"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
2022-10-04 16:41:11 +02:00
|
|
|
task:
|
2023-09-06 16:21:18 +00:00
|
|
|
name: "build: Android (QML $APK_ARCH)"
|
2024-01-16 15:48:45 +00:00
|
|
|
matrix:
|
|
|
|
|
- trigger_type: manual
|
|
|
|
|
only_if: $CIRRUS_CRON == ""
|
|
|
|
|
- trigger_type: automatic
|
|
|
|
|
only_if: $CIRRUS_CRON == "nightly"
|
2023-10-02 19:06:58 +02:00
|
|
|
timeout_in: 90m
|
2022-10-04 16:41:11 +02:00
|
|
|
container:
|
|
|
|
|
dockerfile: contrib/android/Dockerfile
|
|
|
|
|
cpu: 8
|
|
|
|
|
memory: 24G
|
2022-11-04 16:16:12 +00:00
|
|
|
env:
|
|
|
|
|
APK_ARCH: arm64-v8a
|
2022-11-04 00:37:20 +00:00
|
|
|
packages_tld_folder_cache:
|
|
|
|
|
folder: packages
|
|
|
|
|
fingerprint_script:
|
|
|
|
|
- echo $CIRRUS_TASK_NAME && cat contrib/deterministic-build/requirements.txt && cat contrib/make_packages.sh
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/android/
|
2022-11-03 17:28:08 +00:00
|
|
|
p4a_cache:
|
|
|
|
|
folders:
|
|
|
|
|
- ".buildozer/android/platform/build-$APK_ARCH/packages"
|
|
|
|
|
- ".buildozer/android/platform/build-$APK_ARCH/build"
|
|
|
|
|
fingerprint_script:
|
|
|
|
|
# note: should *at least* depend on Dockerfile and p4a_recipes/, but contrib/android/ is simplest
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/android/
|
2022-11-03 17:28:08 +00:00
|
|
|
- echo "qml $APK_ARCH"
|
2022-10-04 16:41:11 +02:00
|
|
|
build_script:
|
2022-11-03 17:28:08 +00:00
|
|
|
- ./contrib/android/make_apk.sh qml "$APK_ARCH" debug
|
2022-10-04 16:41:11 +02:00
|
|
|
binaries_artifacts:
|
|
|
|
|
path: "dist/*"
|
2023-04-24 13:14:58 +00:00
|
|
|
depends_on:
|
2025-09-03 16:03:14 +00:00
|
|
|
- "unittests: py3.10"
|
2022-10-04 16:41:11 +02:00
|
|
|
|
2023-01-02 12:41:22 +00:00
|
|
|
## mac build disabled, as Cirrus CI no longer supports Intel-based mac builds
|
|
|
|
|
#task:
|
2023-09-06 16:21:18 +00:00
|
|
|
# name: "build: macOS"
|
2023-01-02 12:41:22 +00:00
|
|
|
# macos_instance:
|
|
|
|
|
# image: catalina-xcode-11.3.1
|
|
|
|
|
# env:
|
|
|
|
|
# TARGET_OS: macOS
|
|
|
|
|
# pip_cache:
|
|
|
|
|
# folder: ~/Library/Caches/pip
|
|
|
|
|
# fingerprint_script:
|
|
|
|
|
# - echo $CIRRUS_TASK_NAME
|
|
|
|
|
# - git ls-files -s contrib/deterministic-build/*.txt
|
|
|
|
|
# - git ls-files -s contrib/osx/
|
|
|
|
|
# build2_cache:
|
|
|
|
|
# folder: contrib/osx/.cache
|
|
|
|
|
# fingerprint_script:
|
|
|
|
|
# - echo $CIRRUS_TASK_NAME
|
|
|
|
|
# - cat contrib/make_libsecp256k1.sh | shasum -a 256
|
|
|
|
|
# - cat contrib/make_libusb.sh | shasum -a 256
|
|
|
|
|
# - cat contrib/make_zbar.sh | shasum -a 256
|
|
|
|
|
# - git ls-files -s contrib/osx/
|
|
|
|
|
# install_script:
|
|
|
|
|
# - git fetch --all --tags
|
|
|
|
|
# build_script:
|
|
|
|
|
# - ./contrib/osx/make_osx.sh
|
|
|
|
|
# sum_script:
|
|
|
|
|
# - ls -lah dist
|
|
|
|
|
# - shasum -a 256 dist/*.dmg
|
|
|
|
|
# binaries_artifacts:
|
|
|
|
|
# path: "dist/*"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
|
|
|
|
task:
|
2023-09-06 16:21:18 +00:00
|
|
|
name: "build: AppImage"
|
2024-01-16 15:48:45 +00:00
|
|
|
matrix:
|
|
|
|
|
- trigger_type: manual
|
|
|
|
|
only_if: $CIRRUS_CRON == ""
|
|
|
|
|
- trigger_type: automatic
|
|
|
|
|
only_if: $CIRRUS_CRON == "nightly"
|
2021-09-13 16:20:54 +00:00
|
|
|
container:
|
|
|
|
|
dockerfile: contrib/build-linux/appimage/Dockerfile
|
|
|
|
|
cpu: 2
|
2022-12-03 23:46:25 +00:00
|
|
|
memory: 2G
|
2022-11-04 00:37:20 +00:00
|
|
|
pip_cache:
|
2022-11-04 05:20:25 +00:00
|
|
|
folder: contrib/build-linux/appimage/.cache/pip_cache
|
2022-11-04 00:37:20 +00:00
|
|
|
fingerprint_script:
|
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/deterministic-build/*.txt
|
|
|
|
|
- git ls-files -s contrib/build-linux/appimage/
|
2022-11-04 05:20:25 +00:00
|
|
|
build2_cache:
|
|
|
|
|
folder: contrib/build-linux/appimage/.cache/appimage
|
|
|
|
|
fingerprint_script:
|
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
|
|
|
|
- cat contrib/make_libsecp256k1.sh | sha256sum
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/build-linux/appimage/
|
2021-09-13 16:20:54 +00:00
|
|
|
build_script:
|
|
|
|
|
- ./contrib/build-linux/appimage/make_appimage.sh
|
|
|
|
|
binaries_artifacts:
|
|
|
|
|
path: "dist/*"
|
2022-08-22 12:20:28 +00:00
|
|
|
env:
|
|
|
|
|
CIRRUS_DOCKER_CONTEXT: contrib/build-linux/appimage
|
2023-04-24 13:14:58 +00:00
|
|
|
depends_on:
|
2025-09-03 16:03:14 +00:00
|
|
|
- "unittests: py3.10"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
|
|
|
|
task:
|
|
|
|
|
container:
|
|
|
|
|
dockerfile: contrib/build-linux/sdist/Dockerfile
|
|
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
2022-11-04 00:37:20 +00:00
|
|
|
pip_cache:
|
|
|
|
|
folder: ~/.cache/pip
|
|
|
|
|
fingerprint_script:
|
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
2022-11-04 06:10:06 +00:00
|
|
|
- git ls-files -s contrib/deterministic-build/*.txt
|
|
|
|
|
- git ls-files -s contrib/build-linux/sdist/
|
2021-09-13 16:20:54 +00:00
|
|
|
build_script:
|
|
|
|
|
- ./contrib/build-linux/sdist/make_sdist.sh
|
|
|
|
|
binaries_artifacts:
|
|
|
|
|
path: "dist/*"
|
2022-01-04 12:00:00 +00:00
|
|
|
matrix:
|
2023-09-06 16:21:18 +00:00
|
|
|
- name: "build: tarball"
|
|
|
|
|
- name: "build: source-only tarball"
|
2022-01-04 12:00:00 +00:00
|
|
|
env:
|
|
|
|
|
OMIT_UNCLEAN_FILES: 1
|
2023-04-24 13:14:58 +00:00
|
|
|
depends_on:
|
2025-09-03 16:03:14 +00:00
|
|
|
- "unittests: py3.10"
|
2021-09-13 16:20:54 +00:00
|
|
|
|
|
|
|
|
task:
|
2023-09-06 16:21:18 +00:00
|
|
|
name: "check submodules"
|
2021-09-13 16:20:54 +00:00
|
|
|
container:
|
2025-01-10 13:16:04 +00:00
|
|
|
image: python:3.10
|
2021-09-13 16:20:54 +00:00
|
|
|
cpu: 1
|
|
|
|
|
memory: 1G
|
|
|
|
|
fetch_script:
|
|
|
|
|
- git fetch --all --tags
|
|
|
|
|
check_script:
|
|
|
|
|
- ./contrib/deterministic-build/check_submodules.sh
|
|
|
|
|
only_if: $CIRRUS_TAG != ''
|