Skip to content

AllYarnsAreBeautiful/ayab-desktop

Repository files navigation

AYAB - All Yarns Are Beautiful

This is the GUI interface for AYAB.

For information on how to install the release version of the software, see http://manual.ayab-knitting.com

Running from Source & Development

The AYAB desktop software runs using Python 3.11.
The Python module dependencies are split across runtime dependencies, which are in requirements.build.txt and development dependencies, found in requirements.txt.

This repository uses pre-commit hooks. After cloning the repo and installing the development dependencies, you should run pre-commit install to set up the git hook scripts.

Platform-Specific Setup

Linux

For flashing the firmware, avrdude has to be available on your system.
To be able to work on GUI elements and translation files, you will also need Qt Dev & Localization Tools.

Debian/Ubuntu

    sudo apt install python3.11 python3.11-dev python3.11-venv
    sudo apt install libasound2-dev avrdude qt6-tools-dev-tools build-essential qt6-l10n-tools
    export PATH=/usr/lib/qt6/bin:$PATH

openSUSE

    sudo zypper install python311 python311-pip python311-virtualenv python311-devel
    sudo zypper install libasound2 alsa-devel avrdude qt6-tools qt6-tools-linguist
    export PATH=/usr/lib/qt6/bin:$PATH 

All Distributions

To be able to communicate with your Arduino, it might be necessary to add the rights for USB communication by adding your user to some groups.

    sudo usermod -aG tty [userName]
    sudo usermod -aG dialout [userName]
Windows

AYAB requires Windows version 10 or later.

Run Anaconda Powershell as administrator and install git.

    conda install git

Now you can download the git repository with:

    git clone https://github.com/AllYarnsAreBeautiful/ayab-desktop
    cd ayab-desktop

Next, create a virtual environment for AYAB:

    conda create --name ayab -c conda-forge python=3.11 pip

Activate the virtual environment. The command prompt should now display (ayab) at the beginning of each line.

    conda activate ayab

(You may skip the virtual environment setup below.)

To be able to work on GUI elements and translation files, the Qt Dev tools are needed.
Navigate to https://www.qt.io/download-open-source in a web browser and follow the installation instructions. From the available options, select "Custom install" and then "Qt 6.6.3". You will also need to download and install Perl from https://www.perl.org/get.html.

macOS

You can install Git using Homebrew:

    brew install git

You will also need the Xcode command line tools:

    xcode-select --install

To be able to work on GUI elements and translation files, the Qt Dev tools are needed also:

    brew install qt

Install python from the official universal2 installer. (Conda does not produce universal binaries)

If you encounter the pip SSL:TLSV1_ALERT_PROTOCOL_VERSION problem:

    curl https://bootstrap.pypa.io/get-pip.py | python

Universal Setup Steps

Once platform-specific setup is complete, download the git repository:

    git clone https://github.com/AllYarnsAreBeautiful/ayab-desktop
    cd ayab-desktop

Create a virtual environment for AYAB:

    python3.11 -m venv .venv 

Now activate the virtual environment. The command prompt should now display (.venv) at the beginning of each line.

    source .venv/bin/activate

Install the remaining prerequisites with:

    python -m pip install --upgrade pip
    pip install --upgrade setuptools
    pip install -r requirements.txt

Next, convert the PySide6 .ui files and generate the translation files:

    bash ./setup-environment.ps1

If you get errors about missing lrelease, you can skip this (if you do not need the translation files). To do so, comment out lines [23:26] of setup-environment.ps1.

Finally, you can start AYAB with

    fbs run

CI/CD on GitHub

Triggering a new build

A new build is triggered when a new tag is created, either starting with

  • v (i.e. v1.0.0), or
  • test (i.e. test230517)

Convention for the test-tag is to suffix the current date in the YYMMdd format. If there is already an existing test build for a single day, attach a letter. The test tags and releases will be manually removed from time for a better overview.

The tag can be pushed from your local environment, or via the "Draft a new Release" button on the GitHub website.

Choosing the firmware release to be bundled with the build

The CI automatically downloads a given firmware release from the ayab-firmware repo and packs it into the Desktop release. The name of the firmware release is chosen in this manifest file in the ayab-desktop repo.

Whenever building from source, you should ensure that the firmware is available as a compiled hex file is available at main/resources/base/ayab/firmware/firmware.hex. You can either compile the firmware and upload it through other means (e.g. VSCode with PlatformIO), or compile and then drop it into the right path in the desktop directory, making it available for the flash through AYAB desktop.