Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
e8a3a7a
Update to poetry 1.3.2
glutanimate Jan 16, 2023
5603bbf
Switch to poetry groups
glutanimate Jan 16, 2023
46596b4
Add Qt core dependencies, move them into optional groups
glutanimate Jan 16, 2023
7b1ff01
Migrate to `uv`
glutanimate Apr 9, 2025
175980a
Bump version
glutanimate Apr 9, 2025
652f51a
Start migrating to `ruff`
glutanimate Apr 9, 2025
40b4a5a
Remove `autoflake`
glutanimate Apr 9, 2025
1e7a096
Update `pylint`, `mypy`, and bump min Python version to 3.9
glutanimate Apr 9, 2025
5134bd5
Add Anki configurations and bump min version to 2.1.54
glutanimate Apr 9, 2025
9f4d071
Remove 25.02 target for now
glutanimate Apr 9, 2025
7c71b27
Lock dev dependencies to 2.1.54 target by default
glutanimate Apr 9, 2025
7be1b2f
Move optional plugins to optional dependency group and bump versions
glutanimate Apr 9, 2025
3db69a3
Update pytest-qt
glutanimate Apr 9, 2025
d4d48b2
Return highest level did from install_deck
RisingOrange Jul 10, 2022
580e7f2
Catch backend io error and ignore.
andrewsanchez May 29, 2022
f619bdc
Run closures before unloading collection
RisingOrange Nov 2, 2023
6d38217
Use new `setup_auto_update` function on newer Anki versions
RisingOrange Nov 2, 2023
fd84a38
Run formatters
glutanimate Apr 9, 2025
7c0b6f4
Update CONTRIBUTORS
glutanimate Apr 9, 2025
524717a
Temporarily restrict Anki dev dep to <25.02
glutanimate Apr 9, 2025
16e655e
Fix type errors
glutanimate Apr 9, 2025
2579358
Rework `setup_auto_update` fix
glutanimate Apr 9, 2025
1544a4d
Pass profile path as `Path`
glutanimate Apr 9, 2025
380b68e
Add pyright to checks
glutanimate Apr 9, 2025
e366044
Configure pyright and resolve reported errors
glutanimate Apr 9, 2025
5e8554d
Inline circular imports
glutanimate Apr 9, 2025
f2afa77
Disable Anki version compat warning for now
glutanimate Apr 9, 2025
3a380a9
Reintroduce recommended plugins as dev dependency
glutanimate Apr 9, 2025
0398991
Fully Qt versions
glutanimate Apr 9, 2025
49dffce
Update CI pipeline
glutanimate Apr 9, 2025
73978f3
Comment out unused imports for now
glutanimate Apr 9, 2025
9c4fb38
Conditionally select base dir type
glutanimate Apr 9, 2025
632b17d
Bump PyQtWebEngine to 5.15.5
glutanimate Apr 9, 2025
818ceed
Try Ubuntu 24.04 runner
glutanimate Apr 9, 2025
3635166
Temporarily switch to Python 3.9.15 for 2.1.54
glutanimate Apr 9, 2025
d38ddf6
Try out Ubuntu 22.04
glutanimate Apr 9, 2025
2ba6afb
Try disabling chromium sandbox on Linux
glutanimate Apr 9, 2025
9470640
With 22.04 working, also try out 24.04
glutanimate Apr 9, 2025
f06e976
Bump copyright year
glutanimate Apr 9, 2025
05571b8
Update init version
glutanimate Apr 9, 2025
e6a600b
Refactor package structure
glutanimate Apr 9, 2025
4639c3c
Allow disabling web debugging even when debugging port set
glutanimate Apr 10, 2025
e3e213a
Temporarily switch to Qt6 imports
glutanimate Apr 10, 2025
aaa55a0
Switch dev env target to Qt6
glutanimate Apr 10, 2025
fa0e151
Switch CI to Qt6
glutanimate Apr 10, 2025
b50aa9a
Test on Anki 2.1.65, 23.12.1, 24.11
glutanimate Apr 10, 2025
2d6b625
Limit to 2.1.54 and 2.1.65 for now
glutanimate Apr 10, 2025
a03d783
Set pytest-qt Qt API, re-enable 23.12 and 24.11
glutanimate Apr 10, 2025
c776515
Disable matrix fail-fast for now
glutanimate Apr 10, 2025
00905a5
Simplify pytest setup to debug CI failure
glutanimate Apr 10, 2025
8d12c42
Try third-party action for setting up Qt dependencies
glutanimate Apr 10, 2025
5060021
Revert "Simplify pytest setup to debug CI failure"
glutanimate Apr 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

19 changes: 7 additions & 12 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ inputs:
description: "Python interpreter version"
required: true
anki:
description: "Anki version. Set this to 'prerelease' to install either the latest release or prerelease."
description: "Anki version extra dependency group, as specified in pyproject.toml"
required: true
pyqt:
description: "PyQt widget toolkit version"
required: true
pyqtwebengine:
description: "PyQt WebEngine version"
qt:
description: "Qt version extra dependency group, as specified in pyproject.toml"
required: true
chrome:
description: "Chrome version"
Expand All @@ -22,7 +19,7 @@ runs:
using: "composite"
steps:
- name: Checkout pytest-anki
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up environment
uses: ./.github/actions/setup_system
Expand All @@ -32,10 +29,8 @@ runs:

- name: Set up project
uses: ./.github/actions/setup_project

- name: Set up Anki
uses: ./.github/actions/setup_anki
with:
python: ${{ inputs.python }}
anki: ${{ inputs.anki }}
pyqt: ${{ inputs.pyqt }}
pyqtwebengine: ${{ inputs.pyqtwebengine }}
qt: ${{ inputs.qt }}

28 changes: 0 additions & 28 deletions .github/actions/setup_anki/action.yml

This file was deleted.

23 changes: 18 additions & 5 deletions .github/actions/setup_project/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
name: "Set up project"
description: "Set up project"

inputs:
python:
description: "Python interpreter version"
required: true
anki:
description: "Anki version extra dependency group, as specified in pyproject.toml"
required: true
qt:
description: "Qt version extra dependency group, as specified in pyproject.toml"
required: true

runs:
using: "composite"
steps:
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 1.1.8
virtualenvs-create: false
version: "0.6.13"
python-version: ${{ inputs.python }}
# enable-cache: true
# cache-dependency-glob: "uv.lock"

- name: Set up pytest-anki
shell: bash
run: |
make install
uv sync --extra ${{ inputs.anki }} --extra ${{ inputs.qt }} --no-group qt6 --no-group qt5
11 changes: 3 additions & 8 deletions .github/actions/setup_system/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ inputs:
runs:
using: "composite"
steps:
# Qt5 requires a number of X11-related dependencies to be installed system-wide.
# Rather than installing each individually, we install libqt5 on the machine which
# in turn takes care of installing all deps also needed for the PyPI version of Qt5
- name: Install xvfb / qt dependencies
shell: bash
run: |
sudo apt-get install libqt5gui5
- name: Install Qt dependencies
uses: tlambert03/setup-qt-libs@v1

- name: Set up chromedriver
shell: bash
Expand All @@ -32,6 +27,6 @@ runs:
rm "chromedriver_linux64.zip"

- name: Set up Python ${{ inputs.python }}
uses: actions/setup-python@v2.2.1
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
121 changes: 20 additions & 101 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,108 +15,28 @@ on:
- ".github/dependabot.yml"

jobs:
read-current-anki-matrix:
# Reads current Anki set-up from anki-current.json
runs-on: ubuntu-latest

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout pytest-anki
uses: actions/checkout@v2
- id: set-matrix
run: |
content=$(cat ./pytest_anki/anki-current.json)
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
content="{ \"include\": [ ${content} ] }"
echo "::set-output name=matrix::$content"

check-current-anki:
needs: read-current-anki-matrix
runs-on: ubuntu-18.04

strategy:
matrix: ${{ fromJSON(needs.read-current-anki-matrix.outputs.matrix) }}

steps:
- name: Checkout pytest-anki
uses: actions/checkout@v2

- name: Set up test environment
uses: ./.github/actions/setup
with:
python: ${{ matrix.python }}
chrome: ${{ matrix.chrome }}
anki: ${{ matrix.anki }}
pyqt: ${{ matrix.pyqt }}
pyqtwebengine: ${{ matrix.pyqtwebengine }}

- name: Run type checker for Anki ${{ matrix.anki }}
shell: bash
run: |
make check

- name: Run linter for Anki ${{ matrix.anki }}
shell: bash
run: |
make lint

test-current-anki:
needs: read-current-anki-matrix
runs-on: ubuntu-18.04

strategy:
matrix: ${{ fromJSON(needs.read-current-anki-matrix.outputs.matrix) }}

steps:
- name: Checkout pytest-anki
uses: actions/checkout@v2

- name: Set up test environment
uses: ./.github/actions/setup
with:
python: ${{ matrix.python }}
chrome: ${{ matrix.chrome }}
anki: ${{ matrix.anki }}
pyqt: ${{ matrix.pyqt }}
pyqtwebengine: ${{ matrix.pyqtwebengine }}

- name: Run tests for Anki ${{ matrix.anki }}
shell: bash
run: |
make test

test-old-anki:
runs-on: ubuntu-18.04
test-anki-matrix:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
# Version matrix follows static macOS builds as closely as possible.
# Some Qt package versions are not available on PyPI, so we need to make
# compromises here and there.
- anki: 2.1.44
python: 3.8.6
pyqt: 5.14.2
pyqtwebengine: 5.14.0
chrome: 77.0.3865.129
- anki: 2.1.35
python: 3.8.0
pyqt: 5.14.2
pyqtwebengine: 5.14.0
chrome: 77.0.3865.129
- anki: 2.1.28
python: 3.8.0
pyqt: 5.15.0
pyqtwebengine: 5.15.0
chrome: 80.0.3987.163
- anki: 2.1.26
python: 3.8.0
pyqt: 5.13.1
pyqtwebengine: 5.13.1
chrome: 73.0.3683.105
- anki: anki-2154
python: 3.9.15
qt: qt6-2154
chrome: 94.0.4606.126
- anki: anki-2165
python: 3.9.15
qt: qt6-2165
chrome: 108.0.5359.220
- anki: anki-2312
python: 3.9.15
qt: qt6-2312
chrome: 112.0.5615.213
- anki: anki-2411
python: 3.9.18
qt: qt6-2411
chrome: 112.0.5615.213

steps:
- name: Checkout pytest-anki
Expand All @@ -128,8 +48,7 @@ jobs:
python: ${{ matrix.python }}
chrome: ${{ matrix.chrome }}
anki: ${{ matrix.anki }}
pyqt: ${{ matrix.pyqt }}
pyqtwebengine: ${{ matrix.pyqtwebengine }}
qt: ${{ matrix.qt }}

- name: Run tests for Anki ${{ matrix.anki }}
shell: bash
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Michal Krassowski <https://github.com/krassowski>
Andrew Sanchez <https://andrewsanchez.me>
AMBOSS MD Inc. <https://www.amboss.com/>
BlueGreenMagick <https://github.com/BlueGreenMagick>
RisingOrange <https://github.com/risingorange>
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST_FLAGS ?= -n4

# Set up project
install:
poetry install
uv sync --extra anki-2154 --extra qt5-2154 --no-group qt6

# Run tests
test:
Expand All @@ -16,21 +16,21 @@ test:
# Run type checkers
check:
python -m mypy $(MONITORED_FOLDERS)
python -m pyright $(MONITORED_FOLDERS)

# Run code linters
lint:
python -m flake8 $(MONITORED_FOLDERS)
python -m black --check $(MONITORED_FOLDERS)
python -m ruff check $(MONITORED_FOLDERS)
python -m ruff format --check $(MONITORED_FOLDERS)

# Run code formatters
format:
python -m isort $(MONITORED_FOLDERS)
python -m autoflake --recursive --in-place --remove-all-unused-imports $(MONITORED_FOLDERS)
python -m black $(MONITORED_FOLDERS)
python -m ruff check --fix $(MONITORED_FOLDERS)
python -m ruff format $(MONITORED_FOLDERS)

# Build project
build:
poetry build
uv build

# Show help message
help:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Especially if you run your tests headlessly with `xvfb`, you might run into case

## Contributing

Contributions are welcome! To set up `pytest-anki` for development, please first make sure you have Python 3.8+ and [poetry](https://python-poetry.org/docs/) installed, then run the following steps:
Contributions are welcome! To set up `pytest-anki` for development, please first make sure you have Python 3.8+ and [poetry](https://python-poetry.org/docs/) installed (1.3.x or later), then run the following steps:

```
$ git clone https://github.com/glutanimate/pytest-anki.git
Expand All @@ -156,7 +156,7 @@ make lint
make test
```

This project uses `black`, `isort` and `autoflake` to enforce a consistent code style. To auto-format your code you can use:
This project uses `ruff` to enforce a consistent code style. To auto-format your code you can use:

```bash
make format
Expand All @@ -166,7 +166,7 @@ make format

*pytest-anki* is

*Copyright © 2019-2021 [Aristotelis P.](https://glutanimate.com/contact/) (Glutanimate) and [contributors](./CONTRIBUTORS)*
*Copyright © 2019-2025 [Aristotelis P.](https://glutanimate.com/contact/) (Glutanimate) and [contributors](./CONTRIBUTORS)*

*Copyright © 2017-2019 [Michal Krassowski](https://github.com/krassowski/anki_testing)*

Expand Down
Loading