From 452d1604bd527afd1e0c31e58b9543386ded9515 Mon Sep 17 00:00:00 2001 From: glubsy Date: Sun, 6 Dec 2020 18:36:52 +0100 Subject: [PATCH 1/5] Make icon path relative * Removes the hardcoded path to the icon in the .desktop file * Allows themes to override the default application icon (icons are searched for in theme paths first) * Debian: create symbolic link in /usr/share/pixmaps that points to the icon file * Arch: the same thing is done by PKGBUILD maintainers downstream --- pkg/arch/dupeguru.json | 2 +- pkg/debian/Makefile | 1 + pkg/debian/dupeguru.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/arch/dupeguru.json b/pkg/arch/dupeguru.json index 0f83f7bd..9817da61 100644 --- a/pkg/arch/dupeguru.json +++ b/pkg/arch/dupeguru.json @@ -3,5 +3,5 @@ "longname": "dupeGuru", "execname": "dupeguru", "arch": "any", - "iconpath": "/usr/share/dupeguru/dgse_logo_128.png" + "iconpath": "dupeguru" } diff --git a/pkg/debian/Makefile b/pkg/debian/Makefile index 401c3bc9..5309f39e 100644 --- a/pkg/debian/Makefile +++ b/pkg/debian/Makefile @@ -8,4 +8,5 @@ all: chmod +x src/run.py cp -R src/ "$(CURDIR)/debian/{pkgname}/usr/share/{execname}" cp "$(CURDIR)/debian/{execname}.desktop" "$(CURDIR)/debian/{pkgname}/usr/share/applications" + ln -s "/usr/share/{execname}/dgse_logo_128.png" "$(CURDIR)/debian/{pkgname}/usr/pixmaps/{execname}.png" ln -s "/usr/share/{execname}/run.py" "$(CURDIR)/debian/{pkgname}/usr/bin/{execname}" diff --git a/pkg/debian/dupeguru.json b/pkg/debian/dupeguru.json index 0f83f7bd..9817da61 100644 --- a/pkg/debian/dupeguru.json +++ b/pkg/debian/dupeguru.json @@ -3,5 +3,5 @@ "longname": "dupeGuru", "execname": "dupeguru", "arch": "any", - "iconpath": "/usr/share/dupeguru/dgse_logo_128.png" + "iconpath": "dupeguru" } From d53951752559c1232b51df91658a6c7b88354ae7 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Mon, 28 Dec 2020 20:59:01 -0600 Subject: [PATCH 2/5] Update Windows Requirements & CI - Merge windows requirements into requirements.txt and requirements-extra.txt - Update tox.ini to always use build.py - Update build.py to have module only option - Update tox.ini to text python 3.9 - Update .travis.yml to test 3.8 and 3.9 on newer Ubuntu LTS -Update .travis.yml to work with changes to windows tox (also update windows to 3.8) --- .travis.yml | 24 ++++++++---------------- Windows.md | 4 +--- build.py | 8 ++++++++ requirements-extra.txt | 1 + requirements.txt | 4 +++- tox.ini | 24 ++++-------------------- 6 files changed, 25 insertions(+), 40 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cde9668..3d2b0fbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,6 @@ install: script: tox matrix: include: - - os: "linux" - dist: "xenial" - python: "3.8" - script: - - tox -e style - os: "linux" dist: "xenial" python: "3.6" @@ -17,18 +12,15 @@ matrix: dist: "xenial" python: "3.7" - os: "linux" - dist: "xenial" + dist: "focal" python: "3.8" + - os: "linux" + dist: "focal" + python: "3.9" - os: "windows" language: shell - python: "3.7" - env: "PATH=/c/python37:/c/python37/Scripts:$PATH" + python: "3.8" + env: "PATH=/c/python38:/c/python39/Scripts:$PATH" before_install: - - choco install python --version=3.7.6 - - choco install make - - cp /c/python37/python.exe /c/python37/python3.exe - before_script: - - pip3 install -r requirements-windows.txt - - python3 build.py - script: - - tox -e WINDOWS + - choco install python --version=3.8.6 + - cp /c/python38/python.exe /c/python38/python3.exe diff --git a/Windows.md b/Windows.md index 339ec10d..66d2b391 100644 --- a/Windows.md +++ b/Windows.md @@ -21,7 +21,7 @@ To build with a different python version 3.5 vs 3.7 or 32 bit vs 64 bit specify $ cd $ py -3.7 -m venv .\env $ .\env\Scripts\activate - $ pip install -r requirements.txt -r requirements-windows.txt + $ pip install -r requirements.txt $ python build.py $ python run.py @@ -37,8 +37,6 @@ Then the following execution of the makefile should work. Pass the correct valu $ make PYTHON='py -3.7' $ make run -NOTE: Install PyQt5 & cx-Freeze with requirements-windows.txt into the venv before running the packaging scripts in the section below. - ### Generate Windows Installer Packages You need to use the respective x86 or x64 version of python to build the 32 bit and 64 bit versions. The build scripts will automatically detect the python architecture for you. When using build.py make sure the resulting python works before continuing to package.py. NOTE: package.py looks for the 'makensis' executable in the default location for a 64 bit windows system. Run the following in the respective virtual environment. diff --git a/build.py b/build.py index 425f8fc8..a583f959 100644 --- a/build.py +++ b/build.py @@ -54,6 +54,12 @@ def parse_args(): dest="normpo", help="Normalize all PO files (do this before commit).", ) + parser.add_option( + "--modules", + action="store_true", + dest="modules", + help="Build the python modules.", + ) (options, args) = parser.parse_args() return options @@ -182,6 +188,8 @@ def main(): build_mergepot() elif options.normpo: build_normpo() + elif options.modules: + build_pe_modules() else: build_normal() diff --git a/requirements-extra.txt b/requirements-extra.txt index cf2b4ad8..1bf68f94 100644 --- a/requirements-extra.txt +++ b/requirements-extra.txt @@ -2,3 +2,4 @@ pytest>=5,<6 flake8 tox-travis black +pyinstaller>=3.4,<4.0; sys_platform == 'win32' \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 97fa8f44..e53b5793 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,6 @@ Send2Trash>=1.3.0 sphinx>=1.2.2 polib>=1.0.4 hsaudiotag3k>=1.1.3 -distro>=1.5.0 \ No newline at end of file +distro>=1.5.0 +PyQt5 >=5.4,<6.0; sys_platform == 'win32' +pywin32>=200; sys_platform == 'win32' \ No newline at end of file diff --git a/tox.ini b/tox.ini index fb929642..1323d36d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,35 +1,19 @@ [tox] -envlist = style,py36,py37,py38 +envlist = py36,py37,py38,py39 skipsdist = True skip_missing_interpreters = True [testenv] -whitelist_externals = - make setenv = PYTHON="{envpython}" commands = - make modules - py.test core hscommon + python build.py --modules + flake8 + {posargs:py.test core hscommon} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/requirements-extra.txt -[testenv:style] -deps = - {[testenv]deps} - flake8 -commands = - flake8 - -[testenv:WINDOWS] -deps = - {[testenv]deps} - -r{toxinidir}/requirements-windows.txt -commands = - python build.py - python package.py - [flake8] exclude = .tox,env,build,cocoalib,cocoa,help,./qt/dg_rc.py,cocoa/run_template.py,./pkg max-line-length = 120 From c30c3400d41364ce93ddd84bb38f6f27a3af5661 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Mon, 28 Dec 2020 21:07:49 -0600 Subject: [PATCH 3/5] Fix typo in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d2b0fbb..22520be0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: - os: "windows" language: shell python: "3.8" - env: "PATH=/c/python38:/c/python39/Scripts:$PATH" + env: "PATH=/c/python38:/c/python38/Scripts:$PATH" before_install: - choco install python --version=3.8.6 - cp /c/python38/python.exe /c/python38/python3.exe From e822a67b3881888992da24ee653a1e43e2e3c4de Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Mon, 28 Dec 2020 21:18:16 -0600 Subject: [PATCH 4/5] Force correct python environment for tox on windows --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 22520be0..e8d96966 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,4 @@ matrix: before_install: - choco install python --version=3.8.6 - cp /c/python38/python.exe /c/python38/python3.exe + script: tox -e py38 From c8cfa954d598f52b9b0a773b59772a3bb2fc57a1 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Mon, 28 Dec 2020 22:51:09 -0600 Subject: [PATCH 5/5] Minor packaging cleanups - Fix issue with newline in pkg/debian/source/format - Update pyinstaller requirement to support python 3.8/3.9 --- pkg/debian/source/format | 2 +- requirements-extra.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/debian/source/format b/pkg/debian/source/format index 89ae9db8..9f674278 100644 --- a/pkg/debian/source/format +++ b/pkg/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (native) \ No newline at end of file diff --git a/requirements-extra.txt b/requirements-extra.txt index 1bf68f94..c7eedf21 100644 --- a/requirements-extra.txt +++ b/requirements-extra.txt @@ -2,4 +2,4 @@ pytest>=5,<6 flake8 tox-travis black -pyinstaller>=3.4,<4.0; sys_platform == 'win32' \ No newline at end of file +pyinstaller>=4.0,<5.0; sys_platform == 'win32' \ No newline at end of file