- When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
- Any changes you make (unless they are very minor) should be covered by Unit tests.
- You should test your changes by running the modified version of the plugin with your installation of Anki.
If you want to add new library dependency - add them to the Pipfile
.
The dependency management is implemented using https://pipenv.org/
The config window is build using QtDesigner, which you can get by running
sudo apt install qtcreator
on Linux, or simply download from https://build-system.fman.io/qt-designer-download
In Qt Designer you can create UI files using a simple GUI, and save them as a .ui
file in the ui_files
folder.
Run pip install PyQt5
to get the pyuic5
on your system.
Then the pyuic5
module can be used to convert them to python.
See the generate_ui.sh
script for examples, and all new UI files should be added there for automation.
This script is run automatically when packaging the extension in package_plugin.sh
but needs to be done manually if the UI files are changed in the dev environment.
- If you have the production version of CrowdAnki installed - remove it from Anki.
- Run
fetch_dependencies.sh
- this will download the dependencies required for CrowdAnki to operate and put them into thecrowd_anki/dist
directory. - Add a symlink to the Anki plugins directory (you can find it via
Tools>Add-ons>View Files
) pointing tocrowd_anki
directory (you should not name the symlinkcrowd_anki
though, see #62).
At this point if you start Anki - it'd be using your development version of CrowdAnki.
If you made some changes to the plugin while Anki is running and want to test them - you need to
restart Anki, as plugins are loaded on Anki startup.
CrowdAnki is using Mamba as a test runner. And it makes use of expects assertion library.
The combination of these two tools allows you to write beautiful Spec-style tests in Python.
- Install required dependencies:
pipenv install --dev
- Running tests
- From CLI -
pipenv run mamba ./
- If you want to run them from IDE - do so by executing the
tests/mamba_runner.py
- From CLI -
- Add more to https://github.com/Stvad/CrowdAnki/tree/master/test 😉
This guide is using some shell scripts, using them is not a hard requirement, but being able to run them
would make your life easier.
You can achieve that in a variety of ways: