From 6493e1798cfbc7f0500677b9ce86d84933608d26 Mon Sep 17 00:00:00 2001 From: Manu <3916435+m3nu@users.noreply.github.com> Date: Wed, 20 Jan 2021 12:59:37 +0800 Subject: [PATCH] Clean up supporting files (#771) --- .coveragerc | 4 -- .github/workflows/test.yml | 3 +- Makefile | 17 ++---- package/appdmg.json | 17 ------ package/borg.spec | 53 ------------------- .../fix_app_qt_folder_names_for_codesign.py | 7 +++ requirements.d/conda.yml | 20 ------- requirements.d/dev.txt | 1 + setup.cfg | 9 +++- 9 files changed, 20 insertions(+), 111 deletions(-) delete mode 100644 .coveragerc delete mode 100644 package/appdmg.json delete mode 100644 package/borg.spec delete mode 100644 requirements.d/conda.yml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 9e0c0f7f..00000000 --- a/.coveragerc +++ /dev/null @@ -1,4 +0,0 @@ -[run] -omit = tests/* -source=vorta -relative_files=true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 16830246..14f57600 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,6 @@ jobs: - name: Install Vorta run: | pip install . - pip install coverage pip install borgbackup pip install -r requirements.d/dev.txt # - name: Setup tmate session @@ -63,7 +62,7 @@ jobs: coverage run -m pytest - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 - env: + env: OS: ${{ runner.os }} python: ${{ matrix.python-version }} with: diff --git a/Makefile b/Makefile index 5e4df6a7..0570f91e 100644 --- a/Makefile +++ b/Makefile @@ -8,23 +8,12 @@ VERSION := $(shell python -c "from src.vorta._version import __version__; print( clean: rm -rf dist/* -dist/Vorta.app: +dist/Vorta.app: ## Build macOS app locally (without Borg) pyinstaller --clean --noconfirm package/vorta.spec - cp -R bin/darwin/Sparkle.framework dist/Vorta.app/Contents/Frameworks/ - cp -R ${BORG_SRC}/dist/borg-dir dist/Vorta.app/Contents/Resources/ - rm -rf build/vorta - rm -rf dist/vorta - -borg: ## Build Borg single-dir release for bundling in macOS - rm -rf ${BORG_SRC}/dist/* - cd ${BORG_SRC} && python setup.py clean && pip install -U -e . - cd ${BORG_SRC} && pyinstaller --clean --noconfirm ../vorta/package/borg.spec . - find ${BORG_SRC}/dist/borg-dir -type f \( -name \*.so -or -name \*.dylib -or -name borg.exe \) \ - -exec codesign --verbose --force --sign "${CERTIFICATE_NAME}" \ - --entitlements package/entitlements.plist --timestamp --deep --options runtime {} \; + cp -R /usr/local/Caskroom/sparkle/*/Sparkle.framework dist/Vorta.app/Contents/Frameworks/ + rm -rf build/vorta dist/vorta dist/Vorta.dmg: dist/Vorta.app ## Create notarized macOS DMG for distribution. - # Workaround for dots in filenames. See https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing-Qt python3 package/fix_app_qt_folder_names_for_codesign.py dist/Vorta.app cd dist && sh ../package/macos-package-app.sh diff --git a/package/appdmg.json b/package/appdmg.json deleted file mode 100644 index 9cd15f43..00000000 --- a/package/appdmg.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "title": "Vorta Backups", - "contents": [ - { "x": 448, "y": 144, "type": "link", "path": "/Applications" }, - { "x": 162, "y": 144, "type": "file", "path": "../dist/Vorta.app" } - ], - "format": "ULFO", - "code-sign": { - "signing-identity": "Developer ID Application: Manuel Riel (CNMSCAXT48)" - }, - "window": { - "size": { - "height": 300, - "width": 600 - } - } -} diff --git a/package/borg.spec b/package/borg.spec deleted file mode 100644 index 1b1453b2..00000000 --- a/package/borg.spec +++ /dev/null @@ -1,53 +0,0 @@ -# -*- mode: python -*- -# this pyinstaller spec file is used to build borg binaries on posix platforms -# adapted from Borg project to package noatrized folder-style app - -import os, sys - -## Pass borg source dir as last argument -basepath = os.path.abspath(os.path.join(sys.argv[-1])) - -block_cipher = None - -a = Analysis([os.path.join(basepath, 'src', 'borg', '__main__.py'), ], - pathex=[basepath, ], - binaries=[], - datas=[ - (os.path.join(basepath, 'src', 'borg', 'paperkey.html'), 'borg'), - ], - hiddenimports=[ - 'borg.platform.posix', - 'borg.platform.darwin', - ], - hookspath=[], - runtime_hooks=[], - excludes=[ - '_ssl', 'ssl', - ], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher) - -if sys.platform == 'darwin': - # do not bundle the osxfuse libraries, so we do not get a version - # mismatch to the installed kernel driver of osxfuse. - a.binaries = [b for b in a.binaries if 'libosxfuse' not in b[0]] - -pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) - -exe = EXE(pyz, - a.scripts, - exclude_binaries=True, - name='borg.exe', - debug=False, - strip=False, - upx=False, - console=True) - -coll = COLLECT(exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=False, - name='borg-dir') diff --git a/package/fix_app_qt_folder_names_for_codesign.py b/package/fix_app_qt_folder_names_for_codesign.py index e5a373c5..d9908ad2 100644 --- a/package/fix_app_qt_folder_names_for_codesign.py +++ b/package/fix_app_qt_folder_names_for_codesign.py @@ -1,4 +1,11 @@ # -*- coding: utf-8 -*- + +""" +Remove dots in filenames of libraries after PyInstaller. + +See https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing-Qt +""" + import os import shutil import sys diff --git a/requirements.d/conda.yml b/requirements.d/conda.yml deleted file mode 100644 index 870316ac..00000000 --- a/requirements.d/conda.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: vorta - -channels: - - conda-forge - - defaults - -dependencies: - - python=3.6.7 - - appdirs - - paramiko - - pyqt - - peewee - - python-dateutil - - keyring - - apscheduler - - sentry-sdk - - psutil - - pyobjc-core - - pyobjc-framework-Cocoa - - pyinstaller diff --git a/requirements.d/dev.txt b/requirements.d/dev.txt index c34657e3..e3be1394 100644 --- a/requirements.d/dev.txt +++ b/requirements.d/dev.txt @@ -1,3 +1,4 @@ +coverage flake8 pyinstaller pylint diff --git a/setup.cfg b/setup.cfg index ae688058..cf9f2da7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,12 +18,17 @@ classifiers = Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 Topic :: System :: Archiving :: Backup Topic :: System :: Systems Administration Topic :: Utilities long_description = file: README.md long_description_content_type = text/markdown license_file = LICENSE.txt +project_urls = + Bug Tracker = https://github.com/borgbase/vorta/issues + Documentation = https://docs.borgbase.com + Source Code = https://github.com/borgbase/vorta [options] python_requires = >= 3.6 @@ -61,7 +66,9 @@ filterwarnings = ignore::DeprecationWarning [coverage:run] -source = src +source = vorta +omit = tests/* +relative_files = true [flake8] ignore =