-
Notifications
You must be signed in to change notification settings - Fork 222
Fix tests and some of the code to work with Anki 2.1.50 #313
Conversation
Looking forward to it! I greatly appreciate the TLC you are doing here. The reason that I squash by default is that a PR is considered to be a logical unit of work. If we have some sort of unexpected, non-trivial break, the first thing that will happen is that the entire feature work (PR) will get reverted to get back to a working state. This is simply more difficult to do when there are many individual commits, you might miss some, etc. It gets even crazier if there are interleaved commits with that of other people! AnkiConnect is a "community" project, and has a very large number of contributors. It can get difficult to keep track of things even when only doing one PR at a time. That being said, you are absolutely welcome to smaller "units of work" and PR those. |
Actually, you can eat the cake and have it, too! GitHub will create a merge commit if you don't squash. That's like merging with the
This way, you can revert any of the individual commits, or the entire PR by reverting the merge commit. While having non-linear bits in history can be a bit confusing, being able to tell why some contributor added this or that piece of code, and being able to make use of P.S. what's TLC? :3 |
Good call, best of both worlds indeed. I don't actually mind doing history rewrite, but not sure if GitHub will let that happen with a PR. If you have a good idea how to make that happen, I'm all ears :) TLC = tender love and care! |
Aw. I do love Anki-Connect indeed 💖 I guess GitHub won't allow un-doing a squash from the web interface, but you can always merge a branch via git. If you do want to go through with it, I suppose you:
|
@oakkitten done, feel free to send newly rebased PR when you're ready |
* require Python 3.10 * prevent Anki from doing backups, again * restore cwd that deck exporter changes for some wild reason
* Import things from `aqt.qt` not `PyQt5`/`PyQt6` * When testing with Qt6, disable Anki's Qt5 compatibility mode * Depend on `pytest-anki` that is also Qt version agnostic
Also add a few tests for the buttons to make sure that they get actually added and enabled/disabled.
Consolidate Anki version checks across files
Environmental variables set in `setenv` also affect pip invocations. `HOME` determines where pip is placing its cache. Setting HOME to anything virtual env-specific means that every virtual environment is created with its own cache. This wastes time, data and disk space.
Something in Anki is setting stdout to Null. This is a problem because Anki itself is writing to it, particularly when printing warnings about the deprecated methods that we are using. This patches Anki using the same method that the upcoming Anki 2.1.51 is using.
Okay, great! This PR should be good. Seeing that 2.1.51 is out now, I'll just see if all works with that as well. (I'm not entirely sure if it's worth testing against every Anki version. 2.1.49 was stable but 2.1.50 apparently isn't, and 2.1.52 is already in the works... Who knows if it well be stable? Well, I guess this won't hurt, at least if we don't have to write too many hotfixes for the unstable versions?) |
ANki connect didn't work on Anki 2.1.50, but it worked on Anki 2.1.51 even without this fix. |
Yes, it mostly did (the method |
In addition to the tests environments added in #306, this adds two environments for Anki 2.1.50, to test with Qt5 and Qt6. Also, I fixed the way buttons look in the Edit dialog on 2.1.50 and added some tests for the buttons themselves. Also included is a fix for #308.
Essentially, this makes the tests pass, and I can add and view cards via Yomichan on Windows without issues now. There might still be some issues in the untested areas maybe.
This draft is based on the current master, which includes the squashed #306. I would be more than happy to rebase it on the original, unsquashed commits of #306. These were good commits, or so I want to believe 😔. (They say that you should never rewrite master, but I won't tell anyone if you don't.)
This PR is mostly OK but I'll give it a few days before marking as ready—just in case.