diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 3d928a8..940cb71 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -10,11 +10,11 @@ jobs: AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 (64bit) + - name: Set up Python 3.10 (64bit) uses: actions/setup-python@v2 with: - python-version: 3.9 - architecture: x64 + python-version: "3.10" + architecture: "x64" - name: Install Python dependencies (64bit) run: | python --version @@ -43,8 +43,8 @@ jobs: - name: Set up Python 3.8 (32bit and legacy) uses: actions/setup-python@v2 with: - python-version: 3.8 - architecture: x86 + python-version: "3.8" + architecture: "x86" - name: Install Python dependencies (32bit and legacy) run: | python --version @@ -73,8 +73,8 @@ jobs: # We need the official Python, because the GA ones only support newer macOS versions # The deployment target is picked up by the Python build tools automatically # If updated, make sure to also set LSMinimumSystemVersion in SABnzbd.spec - PYTHON_VERSION: 3.9.7 - MACOSX_DEPLOYMENT_TARGET: 10.9 + PYTHON_VERSION: "3.10.0" + MACOSX_DEPLOYMENT_TARGET: "10.9" steps: - uses: actions/checkout@v2 - name: Cache Python download @@ -85,15 +85,17 @@ jobs: key: macOS-Python-${{ env.PYTHON_VERSION }} - name: Get Python if: steps.cache-python-download.outputs.cache-hit != 'true' - run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg -o ~/python.pkg + run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o ~/python.pkg - name: Install Python run: sudo installer -pkg ~/python.pkg -target / - name: Install Python dependencies + # We need to build the PyInstaller bootloader from sources: + # https://github.com/pyinstaller/pyinstaller/issues/6235 run: | python3 --version pip3 install --upgrade pip wheel pip3 install --upgrade -r requirements.txt - pip3 install --upgrade -r builder/requirements.txt + pip3 install --upgrade -r builder/requirements.txt --no-binary pyinstaller - name: Import macOS codesign certificates uses: apple-actions/import-codesign-certs@v1 if: env.SIGNING_AUTH diff --git a/builder/package.py b/builder/package.py index ccaccea..e945d8e 100644 --- a/builder/package.py +++ b/builder/package.py @@ -26,7 +26,6 @@ import subprocess import tarfile import pkginfo import github -from distutils.dir_util import copy_tree VERSION_FILE = "sabnzbd/version.py" @@ -185,8 +184,7 @@ if __name__ == "__main__": # Run PyInstaller and check output run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"]) - # Use special distutils function to merge the main and console directories - copy_tree("dist/SABnzbd-console", "dist/SABnzbd") + shutil.copytree("dist/SABnzbd-console", "dist/SABnzbd", dirs_exist_ok=True) safe_remove("dist/SABnzbd-console") # Remove unwanted DLL's @@ -361,7 +359,7 @@ if __name__ == "__main__": # Copy all folders and files to the new folder for source_folder in extra_folders: - copy_tree(source_folder, os.path.join(src_folder, source_folder)) + shutil.copytree(source_folder, os.path.join(src_folder, source_folder), dirs_exist_ok=True) # Copy all files for source_file in extra_files: diff --git a/builder/requirements.txt b/builder/requirements.txt index ffba04d..07231fd 100644 --- a/builder/requirements.txt +++ b/builder/requirements.txt @@ -1,5 +1,5 @@ # Basic build requirements -pyinstaller==4.2 +pyinstaller setuptools pkginfo certifi diff --git a/tests/test_postproc.py b/tests/test_postproc.py index 895956b..1942d05 100644 --- a/tests/test_postproc.py +++ b/tests/test_postproc.py @@ -9,7 +9,6 @@ tests.test_postproc- Tests of various functions in newspack, among which rar_ren """ import shutil -from distutils.dir_util import copy_tree from unittest import mock from sabnzbd.postproc import * @@ -35,8 +34,7 @@ class TestPostProc: # create a fresh copy try: - # shutil.copytree(sourcedir, workingdir) gives problems on AppVeyor, so: - copy_tree(sourcedir, workingdir) + shutil.copytree(sourcedir, workingdir) except: pytest.fail("Could not create copy of files for rar_renamer")