From 4837823bcefe39de7cee03c9dfe576ec01092957 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Mon, 1 Apr 2024 21:59:57 -0700 Subject: [PATCH] Remove GitHub specific workflow --- .github/workflows/tests.yml | 89 ------------------------------------- tox-install-command | 20 --------- tox.ini | 86 ----------------------------------- 3 files changed, 195 deletions(-) delete mode 100644 .github/workflows/tests.yml delete mode 100644 tox-install-command delete mode 100644 tox.ini diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index c2b0f5c..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Tests - -on: [push, pull_request, workflow_dispatch] - -jobs: - run-tests: - name: ${{ matrix.name }} - runs-on: ubuntu-latest - strategy: - matrix: - include: - - name: Anki 2.1.45 - python: 3.8 - environment: py38-anki2.1.45 - - name: Anki 2.1.46 - python: 3.8 - environment: py38-anki2.1.46 - - name: Anki 2.1.47 - python: 3.8 - environment: py38-anki2.1.47 - - name: Anki 2.1.48 - python: 3.8 - environment: py38-anki2.1.48 - - name: Anki 2.1.49 - python: 3.8 - environment: py38-anki2.1.49 - - name: Anki 2.1.50 (Qt5) - python: 3.9 - environment: py39-anki2.1.50-qt5 - - name: Anki 2.1.50 (Qt6) - python: 3.9 - environment: py39-anki2.1.50-qt6 - - name: Anki 2.1.51 (Qt5) - python: 3.9 - environment: py39-anki2.1.51-qt5 - - name: Anki 2.1.51 (Qt6) - python: 3.9 - environment: py39-anki2.1.51-qt6 - - name: Anki 2.1.52 (Qt5) - python: 3.9 - environment: py39-anki2.1.52-qt5 - - name: Anki 2.1.52 (Qt6) - python: 3.9 - environment: py39-anki2.1.52-qt6 - - name: Anki 2.1.53 (Qt5) - python: 3.9 - environment: py39-anki2.1.53-qt5 - - name: Anki 2.1.53 (Qt6) - python: 3.9 - environment: py39-anki2.1.53-qt6 - - name: Anki 2.1.54 (Qt5) - python: 3.9 - environment: py39-anki2.1.54-qt5 - - name: Anki 2.1.54 (Qt6) - python: 3.9 - environment: py39-anki2.1.54-qt6 - - name: Anki 2.1.55 (Qt5) - python: 3.9 - environment: py39-anki2.1.55-qt5 - - name: Anki 2.1.55 (Qt6) - python: 3.9 - environment: py39-anki2.1.55-qt6 - - name: Anki 2.1.56 (Qt5) - python: 3.9 - environment: py39-anki2.1.56-qt5 - - name: Anki 2.1.56 (Qt6) - python: 3.9 - environment: py39-anki2.1.56-qt6 - fail-fast: false - - steps: - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y pyqt5-dev-tools xvfb jq - - - name: Setup Python ${{ matrix.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - name: Install tox - run: pip install 'tox==3.28.0' - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Run tests - run: tox -vvve ${{ matrix.environment }} -- --forked --verbose diff --git a/tox-install-command b/tox-install-command deleted file mode 100644 index d75f3f3..0000000 --- a/tox-install-command +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -eux -trap '[[ -v SERVER_PID ]] && pkill -P $SERVER_PID' EXIT -print_first_group() { perl -snle 'm/$re/; print $1; exit 0' -- -re="$1"; } - -envname="$1" -toxworkdir="$2" -packages=("${@:3}") - -version=$(print_first_group 'anki([\d\.a-z]+)' <<< "$envname") -upload_time=$(curl https://pypi.org/pypi/anki/json \ - | jq --arg v "$version" -r '.releases[$v][0].upload_time_iso_8601') -cutoff_time=$(date --utc -d "$upload_time +1 hour" '+%Y-%m-%dT%H:%M:%S') - -coproc SERVER { "$toxworkdir"/.tox/bin/python -um pypi_timemachine "$cutoff_time"; } -index_url=$(print_first_group '(http\S+)' <&"${SERVER[0]}") - -python -m pip install --index-url "$index_url" "anki==$version" "$AQT==$version" -python -m pip install "${packages[@]}" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 84f4173..0000000 --- a/tox.ini +++ /dev/null @@ -1,86 +0,0 @@ -# For testing, you will need: -# * PyQt5 dev tools -# * tox -# * X virtual framebuffer--to test without GUI -# -# Install these by running: -# $ sudo apt install pyqt5-dev-tools xvfb -# $ python3 -m pip install --user --upgrade tox -# -# Then, to run tests against multiple anki versions: -# $ tox -# -# To run tests slightly less safely, but faster: -# $ tox -- --no-tear-down-profile-after-each-test -# -# To run tests more safely, but *much* slower: -# $ tox -- --forked - -# Test tool cheat sheet: -# * Test several environments in parallel: -# $ tox -p auto -# -# * To activate one of the test environments: -# $ source .tox/py38-anki49/bin/activate -# -# * Stop on first failure: -# $ xvfb-run python -m pytest -x -# -# * See stdout/stderr (doesn't work with --forked!): -# $ xvfb-run python -m pytest -s -# -# * Run some specific tests: -# $ xvfb-run python -m pytest -k "test_cards.py or test_guiBrowse" -# -# * To run with visible GUI in WSL2 -# (Make sure to disable access control in your X server, such as VcXsrv): -# $ DISPLAY=$(ip route list default | awk '{print $3}'):0 python -m pytest -# -# * Environmental variables of interest: -# LIBGL_ALWAYS_INDIRECT=1 -# QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu" -# QT_DEBUG_PLUGINS=1 -# ANKIDEV=1 - -# Note: pypi packages anki and aqt do not pin their dependencies. -# To tests against historically accurate dependencies, we use a “time machine” -# that prevents pip from using packages that were uploaded after a specified date. - -[tox] -minversion = 3.24 -skipsdist = true -skip_install = true -requires = - pypi-timemachine -envlist = - py38-anki2.1.{45,46,47,48,49} - py39-anki2.1.{50,51,52,53,54,55,56}-qt{5,6} - -[testenv:.tox] -install_command = - python -m pip install {packages} - -[testenv] -install_command = - bash tox-install-command {envname} {toxworkdir} {packages} - -commands = - env HOME={envtmpdir}/home xvfb-run python -m pytest {posargs} - -setenv = - DISABLE_QT5_COMPAT=1 - QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox - - !qt{5,6}: AQT=aqt - qt5: AQT=aqt[qt5] - qt6: AQT=aqt[qt6] - -allowlist_externals = - bash - env - xvfb-run - -deps = - pytest==7.1.1 - pytest-forked==1.4.0 - pytest-anki @ git+https://github.com/oakkitten/pytest-anki.git@a0d27aa5