From 6fe73c1979877fde2875edb609afc7a95a821648 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Tue, 1 Aug 2023 11:29:10 -0400 Subject: [PATCH] Transition to Python 3.8 (#557) * Python 3.8 * Update requirements.txt * use tag for python3.8 ayab fork --------- Co-authored-by: dl1com <1631996+dl1com@users.noreply.github.com> --- .github/workflows/build-multi-os.yml | 10 +++++----- .github/workflows/python_tests.yml | 2 +- .gitlab-ci.yml | 4 ++-- README.md | 10 +++++----- linux-build/appimage/AppRun | 2 +- requirements.txt | 6 ++---- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-multi-os.yml b/.github/workflows/build-multi-os.yml index b91dc3e8..fceeb21f 100644 --- a/.github/workflows/build-multi-os.yml +++ b/.github/workflows/build-multi-os.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.6] + python-version: [3.8] steps: - name: Checkout code uses: actions/checkout@v3 @@ -185,7 +185,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.6] + python-version: [3.8] steps: - name: Checkout code uses: actions/checkout@v3 @@ -316,7 +316,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.6] + python-version: [3.8] steps: - name: Checkout code uses: actions/checkout@v3 @@ -423,7 +423,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.6] + python-version: [3.8] steps: - name: Checkout repo into AppDir uses: actions/checkout@v3 @@ -439,7 +439,7 @@ jobs: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT echo "python=python${{matrix.python-version}}" >> $GITHUB_OUTPUT echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT - echo "python-appimage=python${{matrix.python-version}}.15-cp36-cp36m-manylinux2014_x86_64.AppImage" >> $GITHUB_OUTPUT + echo "python-appimage=python${{matrix.python-version}}.17-cp38-cp38-manylinux2014_x86_64.AppImage" >> $GITHUB_OUTPUT - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 443deec4..c0f896ae 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.6] + python-version: [3.8] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c2f1596..57ac54c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ build:osx: when: always paths: - dist/release/ - script: + script: - mac-build/build.sh after_script: - ls -lisa dist/release @@ -37,7 +37,7 @@ build:osx: - tags build:linux: - image: python:3.6 + image: python:3.8 tags: - linux - docker diff --git a/README.md b/README.md index f48a3484..8039ba51 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ For information on how to install the release version of the software, see ## Running from Source & Development -The AYAB desktop software runs using Python 3.6. This is not the current +The AYAB desktop software runs using Python 3.8. This is not the current version of Python, so it is recommended to install the software to a virtual environment. Miniconda provides a virtual environment that is platform-independent and easy to use: download the lastest version from @@ -51,7 +51,7 @@ To install the development version you can checkout the git repository. Create a virtual environment for AYAB: - conda create --name ayab -c conda-forge python=3.6 pip + conda create --name ayab -c conda-forge python=3.8 pip Now activate the virtual environment. The command prompt should now display `(ayab)` at the beginning of each line. @@ -82,7 +82,7 @@ Now you can download the git repository with: Next, create a virtual environment for AYAB: - conda create --name ayab -c conda-forge python=3.6 pip + conda create --name ayab -c conda-forge python=3.8 pip Activate the virtual environment. The command prompt should now display `(ayab)` at the beginning of each line. @@ -110,7 +110,7 @@ Now start AYAB with: *If on Apple Silicon (M1 & M2 chips)* -* You will need to install the virtual environment using the x86_64 versions of packages due to the requirement of Python 3.6 (which has no build in Conda due to it predating Apple silicon). In order to do this, you need to set the terminal to fetch packages built for x86_64 architectures rather than the native arm64. In Applications, go to the Utilities folder and right click on the Terminal app, and choosing `Get Info`. Select the `Open using Rosetta` checkbox and close the window. Check that the change has taken place by opening the terminal and entering the command `arch`. This should return `i386` if everything went correctly. +* You will need to install the virtual environment using the x86_64 versions of packages due to the requirement of Python 3.8 (which has no build in Conda due to it predating Apple silicon). In order to do this, you need to set the terminal to fetch packages built for x86_64 architectures rather than the native arm64. In Applications, go to the Utilities folder and right click on the Terminal app, and choosing `Get Info`. Select the `Open using Rosetta` checkbox and close the window. Check that the change has taken place by opening the terminal and entering the command `arch`. This should return `i386` if everything went correctly. * Installing both native and rosetta versions of packages can cause conflicts. You can remove conflicting packages from homebrew by specifying architecture and using the remove command: `arch=arm64 brew remove xyz`. You can install Git using Homebrew: @@ -128,7 +128,7 @@ Next download the git repository: Create a virtual environment for AYAB: - conda create --name ayab -c conda-forge python=3.6 pip + conda create --name ayab -c conda-forge python=3.8 pip Now activate the virtual environment. The command prompt should now display `(ayab)` at the beginning of each line. diff --git a/linux-build/appimage/AppRun b/linux-build/appimage/AppRun index f8d0d9df..fbe835a0 100755 --- a/linux-build/appimage/AppRun +++ b/linux-build/appimage/AppRun @@ -11,4 +11,4 @@ export TK_LIBRARY="${APPDIR}/usr/share/tcltk/tk8.5" export TKPATH="${TK_LIBRARY}" cd $APPDIR -opt/python3.6/bin/fbs run +opt/python3.8/bin/fbs run diff --git a/requirements.txt b/requirements.txt index 2797c92d..2a70b656 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,11 @@ -fbs~=1.2 -PyInstaller~=3.4 -pyqt5==5.9.2 +fbs @ git+https://github.com/AllYarnsAreBeautiful/fbs@1.2.1-py38 Pillow==7.1.2 pyserial~=3.4 sliplib==0.4.0 pytest==5.4.1 mock==3.0.5 bitarray-hardbyte==1.1.0 -simpleaudio==1.0.2 +simpleaudio==1.0.4 wave==0.0.2 numpy requests