Compare commits

...

4 Commits

Author SHA1 Message Date
Florian Bach
27bd9531c4 Remove CI for python2 tests for MacOS.
macos-11 image is deprecated and will be removed next month,
macos-12 image doesn't have python2,
and actions/setup-python has removed python2 as well.

No longer running tests on MacOS on Python2.
2024-05-12 11:29:05 +02:00
Florian Bach
7f89a9c6d1 Fix pipeline again 2024-05-12 11:26:23 +02:00
Florian Bach
633768ed51 Fix deprecations in CI pipeline 2024-05-12 11:22:52 +02:00
Dave Vasilevsky
5a4d25e91d Portability improvements in scripts
* Not all systems have GNU sed, so don't assume `sed -i` works
* Not all systems have /bin/bash, so use `env` to find bash
2024-05-12 11:08:44 +02:00
4 changed files with 30 additions and 28 deletions

View File

@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install compilers
run: |
@ -33,11 +33,13 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] # 3.13-dev currently broken due to lxml
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# 3.5 is broken due to SSL issues? Todo.
# 3.13-dev currently broken due to lxml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install python requirements
@ -50,7 +52,7 @@ jobs:
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install python requirements
run: pip install -r ./.github/workflows/ci_test_requirements.txt
@ -62,7 +64,7 @@ jobs:
test-ubuntu-2004:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
@ -83,7 +85,7 @@ jobs:
test-ubuntu-2204-oscrypto:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
id: pip-stuff
@ -112,7 +114,7 @@ jobs:
test-ubuntu-2204-oscrypto-fork:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
@ -139,7 +141,7 @@ jobs:
test-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
@ -154,22 +156,14 @@ jobs:
test-mac:
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip3 install -r ./.github/workflows/ci_test_requirements.txt
# Install Python2 stuff
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
python2 get-pip.py
python2 -m pip --no-python-version-warning install -r ./.github/workflows/ci_test_requirements.txt
- name: Run tests (Python 3)
run: |
cd tests && python3 ./main.py && cd ..
- name: Run tests (Python 2)
run: |
cd tests && PYTHONWARNINGS=ignore python2 ./main.py && cd ..

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2021-2023 Leseratte10
# This file is part of the ACSM Input Plugin by Leseratte10
@ -7,6 +7,14 @@
# For more information, see:
# https://github.com/Leseratte10/acsm-calibre-plugin
sed_i() {
script="$1"
path="$2"
tmpfile="$path.tmp"
sed "$script" "$path" > "$tmpfile"
mv "$tmpfile" "$path"
}
[ ! -f calibre-plugin/asn1crypto.zip ] && ./package_modules.sh
[ ! -f calibre-plugin/oscrypto.zip ] && ./package_modules.sh
@ -25,15 +33,15 @@ base64 decrypt_win32.exe > decrypt_win32_b64.txt
base64 decrypt_win64.exe > decrypt_win64_b64.txt
# Base64-encode binaries and place them inside decryptor.py:
sed "/@@@CALIBRE_DECRYPTOR_WIN32_B64@@@/ {
sed_i "/@@@CALIBRE_DECRYPTOR_WIN32_B64@@@/ {
r decrypt_win32_b64.txt
d
}" -i ../keyextractDecryptor.py
}" ../keyextractDecryptor.py
sed "/@@@CALIBRE_DECRYPTOR_WIN64_B64@@@/ {
sed_i "/@@@CALIBRE_DECRYPTOR_WIN64_B64@@@/ {
r decrypt_win64_b64.txt
d
}" -i ../keyextractDecryptor.py
}" ../keyextractDecryptor.py
rm decrypt_win32_b64.txt decrypt_win64_b64.txt
rm decrypt_win32.exe decrypt_win64.exe
@ -57,10 +65,10 @@ for file in **/*.py;
do
#echo $file
# Inject Python2 compat code:
sed '/#@@CALIBRE_COMPAT_CODE@@/ {
sed_i '/#@@CALIBRE_COMPAT_CODE@@/ {
r __calibre_compat_code.py
d
}' -i $file
}' $file
done

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2021-2023 Leseratte10
# This file is part of the ACSM Input Plugin by Leseratte10

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2021-2023 Leseratte10
# This file is part of the ACSM Input Plugin by Leseratte10