From 52961db95e1da577bc4575d737472dae3081b90b Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Sat, 14 Nov 2026 01:29:49 +0100 Subject: [PATCH 1/5] test: pin the versions of the test dependencies --- .github/dependabot.yml | 14 ++++++++++++++ .github/workflows/test.yml | 6 +++--- .gitignore | 1 + README.md | 14 +++++--------- tests/requirements.txt | 8 ++++++++ 5 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 tests/requirements.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 433a991..9a43b40 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,20 @@ updates: commit-message: prefix: ci + # The versions of the tools that run the tests, in tests/requirements.txt. One pull request for all of them. + - package-ecosystem: pip + directory: /tests + schedule: + interval: weekly + cooldown: + default-days: 7 + commit-message: + prefix: test + groups: + tests: + patterns: + - "*" + # The versions of the tools that build the site, in docs/mkdocs/requirements.in. One pull request for the tools that # have to move together (mkdocstrings needs matching versions of autorefs, griffe and pymdown-extensions) and one # for the rest. The Docs workflow builds the site with --strict and fails on an update that does not work. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc7b839..7130aef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: run: | sudo apt update sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 lcov python3-scikit-build-core - pip3 install pybind11-stubgen==2.5.5 pytest pytest-rerunfailures pytest-cov pytest-timeout pyproject-metadata --break-system-packages + pip3 install -r tests/requirements.txt pybind11-stubgen==2.5.5 pyproject-metadata --break-system-packages - name: Install expat run: | @@ -247,7 +247,7 @@ jobs: - name: Install pytest and dependencies shell: bash run: | - python -m pip install pytest pytest-rerunfailures pytest-timeout pytest-cov typing_extensions scikit-build-core + python -m pip install -r tests/requirements.txt scikit-build-core - name: Setup MSYS2 MINGW64 uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0 @@ -454,7 +454,7 @@ jobs: # monero-project and monero-cpp take brew's openssl unless they are given another one, so # they get it on the command line, and the module finds it in the environment echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - pip3 install pytest pytest-rerunfailures pytest-timeout pytest-cov setuptools wheel scikit-build-core --break-system-packages + pip3 install -r tests/requirements.txt setuptools wheel scikit-build-core --break-system-packages # static, against openssl@3: the unbound of brew is built with OpenSSL 4 - name: Install unbound diff --git a/.gitignore b/.gitignore index c8af73c..91def4d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build/* dist __pycache__ .pytest_cache +.venv _CPack_Packages *.deb *egg-info diff --git a/README.md b/README.md index 358a2ef..affbba2 100644 --- a/README.md +++ b/README.md @@ -241,17 +241,13 @@ For example: `export LD_PRELOAD=/path/to/libjemalloc.so.2` then run your app. It ## Running Python tests -1. Install `pytest`: +1. Install the test dependencies, with the versions that the CI runs the tests with ([tests/requirements.txt](tests/requirements.txt)), in a virtual environment: ```bash - # With PIP - - pip3 install pytest pytest-rerunfailures pytest-timeout pytest-cov --break-system-packages - ``` - ```bash - # System-wide installation Ubuntu/Debian - - sudo apt install -y python3-pytest python3-pytest-rerunfailures python3-pytest-timeout python3-pytest-cov + python3 -m venv .venv + . .venv/bin/activate + pip install -r tests/requirements.txt ``` + The `monero` module has to be importable in it: install it in the environment (`pip install .`), or set `PYTHONPATH` to the folder that has the built module. 2. Clone the project repository: ```bash git clone --recurse-submodules https://github.com/libmonero/monero-python.git diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..8b73c13 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,8 @@ +# The versions that the tests run with, in CI (.github/workflows/test.yml) and locally: pip install -r tests/requirements.txt +# Dependabot proposes the updates. +coverage==7.17.3 +pytest==9.2.0 +pytest-cov==7.1.0 +pytest-rerunfailures==16.7 +pytest-timeout==2.4.0 +typing_extensions==4.16.0 From 4f46259898465935a6fb34b438b7786db6218d3c Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Sat, 14 Nov 2026 01:33:19 +0100 Subject: [PATCH 2/5] test: write the class fixtures as class methods --- pytest.ini | 2 +- tests/test_monero_daemon_interface.py | 3 ++- tests/test_monero_daemon_rpc.py | 12 +++++++----- tests/test_monero_rpc_connection.py | 10 ++++++---- tests/test_monero_utils.py | 3 ++- tests/test_monero_wallet_common.py | 9 ++++++--- tests/test_monero_wallet_full.py | 6 ++++-- tests/test_monero_wallet_interface.py | 3 ++- tests/test_monero_wallet_keys.py | 6 ++++-- tests/test_monero_wallet_rpc.py | 5 +++-- tests/utils/base_test_class.py | 9 ++++++--- 11 files changed, 43 insertions(+), 25 deletions(-) diff --git a/pytest.ini b/pytest.ini index aedddee..e34c231 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -minversion = 6.0 +minversion = 9.0 required_plugins = pytest-rerunfailures pytest-timeout pytest-cov addopts = -s -v --reruns 5 --reruns-delay 10 --only-rerun "Daemon is busy" log_level = INFO diff --git a/tests/test_monero_daemon_interface.py b/tests/test_monero_daemon_interface.py index 9802f80..eab8c29 100644 --- a/tests/test_monero_daemon_interface.py +++ b/tests/test_monero_daemon_interface.py @@ -13,7 +13,8 @@ class TestMoneroDaemonInterface(BaseTestClass): """Daemon interface bindings unit tests.""" @pytest.fixture(scope="class") - def daemon(self) -> MoneroDaemon: + @classmethod + def daemon(cls) -> MoneroDaemon: """Test daemon interface instance.""" return MoneroDaemon() diff --git a/tests/test_monero_daemon_rpc.py b/tests/test_monero_daemon_rpc.py index 3ee1cab..3bb96f2 100644 --- a/tests/test_monero_daemon_rpc.py +++ b/tests/test_monero_daemon_rpc.py @@ -43,17 +43,19 @@ def before_all(self) -> None: IntegrationTestUtils.setup(WalletType.RPC) @pytest.fixture(scope="class") - def daemon(self) -> MoneroDaemonRpc: + @classmethod + def daemon(cls) -> MoneroDaemonRpc: """Test rpc daemon instance""" return Utils.get_daemon_rpc() @pytest.fixture(scope="class") - def wallet(self) -> MoneroWalletRpc: + @classmethod + def wallet(cls) -> MoneroWalletRpc: """Test rpc wallet instance""" - if self._test_wallet is None: - self._test_wallet = Utils.get_wallet_rpc() + if cls._test_wallet is None: + cls._test_wallet = Utils.get_wallet_rpc() - return self._test_wallet + return cls._test_wallet #endregion diff --git a/tests/test_monero_rpc_connection.py b/tests/test_monero_rpc_connection.py index 090ba03..698ec41 100644 --- a/tests/test_monero_rpc_connection.py +++ b/tests/test_monero_rpc_connection.py @@ -21,15 +21,17 @@ class TestMoneroRpcConnection(BaseTestClass): # Node rpc connection fixture @pytest.fixture(scope="class") - def node_connection(self) -> MoneroRpcConnection: + @classmethod + def node_connection(cls) -> MoneroRpcConnection: """Rpc connection test instance.""" - return MoneroRpcConnection(Utils.DAEMON_RPC_URI, Utils.DAEMON_RPC_USERNAME, Utils.DAEMON_RPC_PASSWORD, timeout_ms=self.TIMEOUT_MS) + return MoneroRpcConnection(Utils.DAEMON_RPC_URI, Utils.DAEMON_RPC_USERNAME, Utils.DAEMON_RPC_PASSWORD, timeout_ms=cls.TIMEOUT_MS) # Wallet rpc connection fixture @pytest.fixture(scope="class") - def wallet_connection(self) -> MoneroRpcConnection: + @classmethod + def wallet_connection(cls) -> MoneroRpcConnection: """Rpc connection test instance.""" - return MoneroRpcConnection(Utils.WALLET_RPC_URI, Utils.WALLET_RPC_USERNAME, Utils.WALLET_RPC_PASSWORD, timeout_ms=self.TIMEOUT_MS) + return MoneroRpcConnection(Utils.WALLET_RPC_URI, Utils.WALLET_RPC_USERNAME, Utils.WALLET_RPC_PASSWORD, timeout_ms=cls.TIMEOUT_MS) #endregion diff --git a/tests/test_monero_utils.py b/tests/test_monero_utils.py index bea7a0d..1d704e6 100644 --- a/tests/test_monero_utils.py +++ b/tests/test_monero_utils.py @@ -62,7 +62,8 @@ def parse(cls, parser: ConfigParser) -> TestMoneroUtils.Config: #region Fixtures @pytest.fixture(scope="class") - def config(self) -> TestMoneroUtils.Config: + @classmethod + def config(cls) -> TestMoneroUtils.Config: parser: ConfigParser = ConfigParser() parser.read('tests/config/test_monero_utils.ini') return TestMoneroUtils.Config.parse(parser) diff --git a/tests/test_monero_wallet_common.py b/tests/test_monero_wallet_common.py index f6b2417..e8b406f 100644 --- a/tests/test_monero_wallet_common.py +++ b/tests/test_monero_wallet_common.py @@ -171,7 +171,8 @@ def is_random_wallet_config(cls, config: Optional[MoneroWalletConfig]) -> bool: # Test wallet configuration @pytest.fixture(scope="class") - def test_config(self) -> BaseTestMoneroWallet.Config: + @classmethod + def test_config(cls) -> BaseTestMoneroWallet.Config: """Test configuration.""" parser: ConfigParser = ConfigParser() parser.read('tests/config/test_monero_wallet_common.ini') @@ -179,13 +180,15 @@ def test_config(self) -> BaseTestMoneroWallet.Config: # Test daemon fixture @pytest.fixture(scope="class") - def daemon(self) -> MoneroDaemonRpc: + @classmethod + def daemon(cls) -> MoneroDaemonRpc: """Test rpc daemon instance.""" return TestUtils.get_daemon_rpc() # Test wallet fixture @pytest.fixture(scope="class") - def wallet(self) -> MoneroWallet: + @classmethod + def wallet(cls) -> MoneroWallet: """Test wallet instance.""" pytest.skip("No wallet test instance setup") diff --git a/tests/test_monero_wallet_full.py b/tests/test_monero_wallet_full.py index 8785fc7..70672a1 100644 --- a/tests/test_monero_wallet_full.py +++ b/tests/test_monero_wallet_full.py @@ -36,8 +36,9 @@ def get_wallet_type(cls) -> WalletType: return WalletType.FULL @pytest.fixture(scope="class") + @classmethod @override - def wallet(self) -> MoneroWalletFull: + def wallet(cls) -> MoneroWalletFull: """Test rpc wallet instance""" return Utils.get_wallet_full() @@ -710,7 +711,8 @@ class TestMoneroWalletFullOffline(BaseTestClass): """Full wallet unit tests that run against a disconnected wallet, no daemon needed.""" @pytest.fixture(scope="class") - def wallet(self) -> MoneroWalletFull: + @classmethod + def wallet(cls) -> MoneroWalletFull: """Shared disconnected full wallet.""" return Utils.get_wallet_full_offline() diff --git a/tests/test_monero_wallet_interface.py b/tests/test_monero_wallet_interface.py index aabcd8d..9b49bb3 100644 --- a/tests/test_monero_wallet_interface.py +++ b/tests/test_monero_wallet_interface.py @@ -19,7 +19,8 @@ class TestMoneroWalletInterface(BaseTestClass): """Wallet interface binding calls unit tests.""" @pytest.fixture(scope="class") - def wallet(self) -> MoneroWallet: + @classmethod + def wallet(cls) -> MoneroWallet: """Test wallet instance.""" return MoneroWallet() diff --git a/tests/test_monero_wallet_keys.py b/tests/test_monero_wallet_keys.py index 9f09b2f..9295bb5 100644 --- a/tests/test_monero_wallet_keys.py +++ b/tests/test_monero_wallet_keys.py @@ -26,14 +26,16 @@ class TestMoneroWalletKeys(BaseTestMoneroWallet): #region Fixtures @pytest.fixture(scope="class") + @classmethod @override - def wallet(self) -> MoneroWalletKeys: + def wallet(cls) -> MoneroWalletKeys: """Test keys wallet instance""" return Utils.get_wallet_keys() @pytest.fixture(scope="class") + @classmethod @override - def daemon(self) -> MoneroDaemonRpc: + def daemon(cls) -> MoneroDaemonRpc: return MoneroDaemon() # type: ignore #endregion diff --git a/tests/test_monero_wallet_rpc.py b/tests/test_monero_wallet_rpc.py index 1be9793..71f479a 100644 --- a/tests/test_monero_wallet_rpc.py +++ b/tests/test_monero_wallet_rpc.py @@ -29,10 +29,11 @@ def get_wallet_type(cls) -> WalletType: #region Overrides @pytest.fixture(scope="class") + @classmethod @override - def wallet(self) -> MoneroWalletRpc: + def wallet(cls) -> MoneroWalletRpc: """Test rpc wallet instance.""" - return self.get_test_wallet() + return cls.get_test_wallet() @classmethod @override diff --git a/tests/utils/base_test_class.py b/tests/utils/base_test_class.py index 894b8c2..596b91a 100644 --- a/tests/utils/base_test_class.py +++ b/tests/utils/base_test_class.py @@ -13,15 +13,18 @@ class BaseTestClass(ABC): # Setup and teardown of test class @pytest.fixture(scope="class", autouse=True) - def global_setup_and_teardown(self) -> Generator[None, Any, None]: + @classmethod + def global_setup_and_teardown(cls) -> Generator[None, Any, None]: """Executed once before all tests. :returns Generator[None, Any, None]: yields control to the test class after setup, then runs teardown once all tests in the class have completed. """ - self.before_all() + # the hooks are methods of an instance, which is not the one of a test: what they set on it would be seen by none + instance: BaseTestClass = cls() + instance.before_all() yield - self.after_all() + instance.after_all() # Setup and teardown of each test @pytest.fixture(autouse=True) From c685dd6370c601b7953dd0c1eaf551d254c09ad6 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Sat, 14 Nov 2026 01:34:46 +0100 Subject: [PATCH 3/5] build: pin the python build tools and keep pybind11 at 2.x --- .github/dependabot.yml | 17 +++++++++++++++++ .github/workflows/build-macos.yml | 11 ++--------- .github/workflows/build-windows.yml | 3 ++- .github/workflows/test.yml | 14 +++++--------- pyproject.toml | 2 +- requirements-build.txt | 14 ++++++++++++++ 6 files changed, 41 insertions(+), 20 deletions(-) create mode 100644 requirements-build.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9a43b40..06f27a9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,23 @@ updates: commit-message: prefix: ci + # The versions of the tools that build the module, in requirements-build.txt. pybind11 stays at 2.x. One pull request for all of them. + - package-ecosystem: pip + directory: / + schedule: + interval: weekly + cooldown: + default-days: 7 + commit-message: + prefix: build + ignore: + - dependency-name: pybind11 + update-types: ["version-update:semver-major"] + groups: + build: + patterns: + - "*" + # The versions of the tools that run the tests, in tests/requirements.txt. One pull request for all of them. - package-ecosystem: pip directory: /tests diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 31f6d8e..99610b4 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -10,6 +10,7 @@ on: - 'CMakeLists.txt' - 'bin/check_macho_hardening.sh' - 'bin/install_unbound_macos.sh' + - 'requirements-build.txt' workflow_dispatch: workflow_call: @@ -57,20 +58,12 @@ jobs: # monero-project and monero-cpp take brew's openssl unless they are given another one, so # they get it on the command line, and the module finds it in the environment echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - pip3 install pytest pytest-cov setuptools wheel scikit-build-core --break-system-packages + pip3 install -r requirements-build.txt --break-system-packages # static, against openssl@3: the unbound of brew is built with OpenSSL 4 - name: Install unbound run: bin/install_unbound_macos.sh - - name: Install pybind11 v2.13.6 - run: | - pip3 install pybind11==2.13.6 pybind11-stubgen --break-system-packages - - - name: Install delocate - run: | - pip3 install delocate --break-system-packages - - name: Restore ccache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index cb9f45f..9ce0288 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -9,6 +9,7 @@ on: - '.github/workflows/build-windows.yml' - 'CMakeLists.txt' - 'bin/check_pe_hardening.sh' + - 'requirements-build.txt' workflow_dispatch: workflow_call: @@ -51,7 +52,7 @@ jobs: - name: Install Python build dependencies shell: bash run: | - python -m pip install scikit-build-core delvewheel + python -m pip install -r requirements-build.txt - name: Setup MSYS2 MINGW64 uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7130aef..4269c8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,8 +56,8 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 lcov python3-scikit-build-core - pip3 install -r tests/requirements.txt pybind11-stubgen==2.5.5 pyproject-metadata --break-system-packages + sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip lcov + pip3 install -r tests/requirements.txt -r requirements-build.txt --break-system-packages - name: Install expat run: | @@ -118,7 +118,7 @@ jobs: - name: Install monero-python run: | mkdir -p build - cmake -B build -DENABLE_COVERAGE=ON + cmake -B build -DENABLE_COVERAGE=ON -Dpybind11_DIR="$(python3 -m pybind11 --cmakedir)" cmake --build build cp build/monero.cpython-312-x86_64-linux-gnu.so ~/.local/lib/python3.12/site-packages/ @@ -247,7 +247,7 @@ jobs: - name: Install pytest and dependencies shell: bash run: | - python -m pip install -r tests/requirements.txt scikit-build-core + python -m pip install -r tests/requirements.txt -r requirements-build.txt - name: Setup MSYS2 MINGW64 uses: msys2/setup-msys2@ec48f7c5447b3140e2b088413ae3a55687bccb6e # v2.33.0 @@ -454,16 +454,12 @@ jobs: # monero-project and monero-cpp take brew's openssl unless they are given another one, so # they get it on the command line, and the module finds it in the environment echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - pip3 install -r tests/requirements.txt setuptools wheel scikit-build-core --break-system-packages + pip3 install -r tests/requirements.txt -r requirements-build.txt --break-system-packages # static, against openssl@3: the unbound of brew is built with OpenSSL 4 - name: Install unbound run: bin/install_unbound_macos.sh - - name: Install pybind11 v2.13.6 - run: | - pip3 install pybind11==2.13.6 pybind11-stubgen --break-system-packages - - name: Restore ccache uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: diff --git a/pyproject.toml b/pyproject.toml index 072a184..b52ca01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [] [build-system] requires = [ "scikit-build-core>=0.10", - "pybind11>=2.12", + "pybind11>=2.12,<3", "cmake>=3.20", "ninja" ] diff --git a/requirements-build.txt b/requirements-build.txt new file mode 100644 index 0000000..48ebe7e --- /dev/null +++ b/requirements-build.txt @@ -0,0 +1,14 @@ +# The versions of the python tools that build the module, in CI and locally: pip install -r requirements-build.txt +# Dependabot proposes the updates, except pybind11 which stays at 2.x (see .github/dependabot.yml). +# +# pybind11 is 2.13.6 on every platform, the one of the MSYS2 package that Windows installs with pacman, so it is not here for Windows. The +# deb packages build with the pybind11 of their distribution, which is 2.x from jammy (2.9) to trixie (2.13). +pybind11==2.13.6; sys_platform != "win32" +# not newer, a new version can report more (see bin/lint_bindings.py) +pybind11-stubgen==2.5.5; sys_platform != "win32" +scikit-build-core==1.1.2 +setuptools==84.2.1 +wheel==0.48.0 +# repair the wheels +delvewheel==1.13.2; sys_platform == "win32" +delocate==0.13.0; sys_platform == "darwin" From 7507ecd195a1b37a8d9109eebe3ba5a165f8b063 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Sat, 14 Nov 2026 03:32:10 +0100 Subject: [PATCH 4/5] ci: install the python tools in a venv on macOS --- .github/workflows/build-macos.yml | 6 +++++- .github/workflows/test.yml | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 99610b4..3cd3e9f 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -58,7 +58,11 @@ jobs: # monero-project and monero-cpp take brew's openssl unless they are given another one, so # they get it on the command line, and the module finds it in the environment echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - pip3 install -r requirements-build.txt --break-system-packages + # a virtual environment: the python of brew has packages that pip can not replace, such as wheel and typing_extensions on the + # Intel runner (they have no RECORD file), and the versions of the requirements files are pinned. The next steps find it first in the PATH + python3 -m venv "$RUNNER_TEMP/venv" + echo "$RUNNER_TEMP/venv/bin" >> "$GITHUB_PATH" + "$RUNNER_TEMP/venv/bin/pip" install -r requirements-build.txt # static, against openssl@3: the unbound of brew is built with OpenSSL 4 - name: Install unbound diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4269c8d..f96c392 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -454,7 +454,11 @@ jobs: # monero-project and monero-cpp take brew's openssl unless they are given another one, so # they get it on the command line, and the module finds it in the environment echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" - pip3 install -r tests/requirements.txt -r requirements-build.txt --break-system-packages + # a virtual environment: the python of brew has packages that pip can not replace, such as wheel and typing_extensions on the + # Intel runner (they have no RECORD file), and the versions of the requirements files are pinned. The next steps find it first in the PATH + python3 -m venv "$RUNNER_TEMP/venv" + echo "$RUNNER_TEMP/venv/bin" >> "$GITHUB_PATH" + "$RUNNER_TEMP/venv/bin/pip" install -r tests/requirements.txt -r requirements-build.txt # static, against openssl@3: the unbound of brew is built with OpenSSL 4 - name: Install unbound @@ -497,7 +501,7 @@ jobs: - name: Install monero-python run: | mkdir -p build - pip3 install --no-build-isolation -vvv . --break-system-packages + pip3 install --no-build-isolation -vvv . - name: Show ccache statistics if: ${{ !cancelled() }} From cbb05113db3f202bc52f38e507bd4509555fafce Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Sat, 14 Nov 2026 03:43:46 +0100 Subject: [PATCH 5/5] tests: show debug messages on rerun --- conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conftest.py b/conftest.py index cd04095..45ccd68 100644 --- a/conftest.py +++ b/conftest.py @@ -2,6 +2,7 @@ import logging +from os import environ from os.path import splitext from typing import TYPE_CHECKING, Generator, Optional, cast @@ -31,6 +32,11 @@ def pytest_runtest_logreport(report: pytest.TestReport) -> None: def pytest_configure(config: pytest.Config) -> None: + # a job re-run with "Enable debug logging" sets RUNNER_DEBUG=1, show the debug messages in the console too + if environ.get("RUNNER_DEBUG") == "1": + config.option.log_level = "DEBUG" + config.option.log_cli_level = "DEBUG" + # timestamp the log file so each run keeps its own log_file: str = cast(str, config.getini("log_file")) if not log_file: