From 3df77025194952afa43d32ce331a9bcf417272d5 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 18 May 2025 07:10:55 +0200 Subject: [PATCH] tests: fix and enable windows CI, fixes #8728 thanks a lot to @sothix for helping with this! removed pytest-forked, is not found anymore: error: target not found: mingw-w64-ucrt-x86_64-python-pytest-forked use a virtual env to avoid mixup of user with system packages. remove old workaround for setuptools (SETUPTOOLS_USE_DISTUTILS: stdlib). fix pip install use --system-site-packages as a workaround for broken pip install python-cffi. do not upgrade pip setuptools build wheel use python -m pytest to use the one from the venv --- .github/workflows/ci.yml | 19 ++++++++++++++----- scripts/msys2-install-deps | 4 +--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78332a954..e190a3a4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,14 +195,12 @@ jobs: windows: - if: false # build temporary disabled + if: true # can be used to temporary disable build runs-on: windows-latest timeout-minutes: 120 needs: linux env: - # Needed for setuptools < 70.2.0 to work, see: https://www.msys2.org/docs/python/#known-issues - # SETUPTOOLS_USE_DISTUTILS: stdlib PY_COLORS: 1 defaults: @@ -217,11 +215,20 @@ jobs: with: msystem: UCRT64 update: true - - name: Install dependencies + - name: Install system packages run: ./scripts/msys2-install-deps development + - name: Build python venv + run: | + # building cffi / argon2-cffi in the venv fails, so we try to use the system packages + python -m venv --system-site-packages env + . env/bin/activate + # python -m pip install --upgrade pip + # pip install --upgrade setuptools build wheel + pip install pyinstaller==6.11.1 - name: Build run: | # build borg.exe + . env/bin/activate pip install -e . pyinstaller -y scripts/borg.exe.spec # build sdist and wheel in dist/... @@ -233,4 +240,6 @@ jobs: - name: Run tests run: | ./dist/borg.exe -V - pytest -n4 --benchmark-skip -vv -rs -k "not remote" + . env/bin/activate + borg -V + python -m pytest -n4 --benchmark-skip -vv -rs -k "not remote" diff --git a/scripts/msys2-install-deps b/scripts/msys2-install-deps index 4408f077d..963754fa6 100644 --- a/scripts/msys2-install-deps +++ b/scripts/msys2-install-deps @@ -1,9 +1,7 @@ #!/bin/bash pacman -S --needed --noconfirm git mingw-w64-ucrt-x86_64-{toolchain,pkgconf,zstd,lz4,xxhash,openssl,rclone,python-msgpack,python-argon2_cffi,python-platformdirs,python,cython,python-setuptools,python-wheel,python-build,python-pkgconfig,python-packaging,python-pip,python-paramiko} -python -m pip install --upgrade pip -pip install pyinstaller==6.11.1 if [ "$1" = "development" ]; then - pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-python-{pytest,pytest-benchmark,pytest-cov,pytest-forked,pytest-xdist} + pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-python-{pytest,pytest-benchmark,pytest-cov,pytest-xdist} fi