Browse Source

Update for macos Qt version

- Update to include a pyinstaller based packaging
- Update requirements and requirements-extra
- Add icon for macos
- Add for instructions
Andrew Senetar 1 month ago
No known key found for this signature in database GPG Key ID: FEB896EB6CF6254B
5 changed files with 82 additions and 2 deletions
  1. BIN
  2. +53
  3. +27
  4. +1
  5. +1

images/dupeguru.icns View File

+ 53
- 0 View File

@@ -0,0 +1,53 @@
## How to build dupeGuru for macos

### Prerequisites

- [Python 3.6+][python]
- [Xcode 12.3][xcode] or just Xcode command line tools (older versions can be used if not interested in arm macs)
- [Homebrew][homebrew]
- [qt5](

#### Prerequisite setup
1. Install Xcode if desired
2. Install [Homebrew][homebrew], if not on the path after install (arm based Macs) create `~/.zshrc`
with `export PATH="/opt/homebrew/bin:$PATH"`. Will need to reload terminal or source the file to take
3. Install qt5 with `brew`. If you are using a version of macos without system python 3.6+ then you will
also need to install that via brew or with pyenv.

$ brew install qt5

NOTE: Using `brew` to install qt5 is to allow pyqt5 to build without a native wheel
available. If you are using an intel based mac you can probably skip this step.

4. May need to launch a new terminal to have everything working.

### With
OSX comes with a version of python 3 by default in newer versions of OSX. To produce universal
builds either the 3.8 version shipped in macos or 3.9.1 or newer needs to be used. If needing to
build pyqt5 from source then the first line below is needed, else it may be omitted. (Path shown is
for an arm mac.)

$ export PATH="/opt/homebrew/opt/qt/bin:$PATH"
$ cd <dupeGuru directory>
$ python3 -m venv ./env
$ source ./env/bin/activate
$ pip install -r requirements.txt
$ python
$ python

### Generate OSX Packages
The extra requirements need to be installed to run packaging: `pip install -r requirements-extra.txt`.
Run the following in the respective virtual environment.

$ python

This will produce a in the dist folder.

### Running tests
The complete test suite can be run with tox just like on linux. NOTE: The extra requirements need to
be installed to run unit tests: `pip install -r requirements-extra.txt`.


+ 27
- 0 View File

@@ -210,6 +210,31 @@ def package_windows():
print_and_do(cmd.format(version_array[0], version_array[1], version_array[2], bits))

def package_macos():
# include locale files if they are built otherwise exit as it will break
# the localization
if not op.exists("build/locale"):
print("Locale files are missing. Have you run \" --loc\"? Exiting...")
# include help files if they are built otherwise exit as they should be included?
if not op.exists("build/help"):
print("Help files are missing. Have you run \" --doc\"? Exiting...")
# run pyinstaller from here:
import PyInstaller.__main__

def main():
args = parse_args()
@@ -220,6 +245,8 @@ def main():
print("Packaging dupeGuru with UI qt")
if sys.platform == "win32":
elif sys.platform == "darwin":
if not args.arch_pkg:
distname =

+ 1
- 1
requirements-extra.txt View File

@@ -2,4 +2,4 @@ pytest>=5,<6
pyinstaller>=4.0,<5.0; sys_platform == 'win32'
pyinstaller>=4.0,<5.0; sys_platform != 'linux'

+ 1
- 1
requirements.txt View File

@@ -3,5 +3,5 @@ sphinx>=1.2.2
PyQt5 >=5.4,<6.0; sys_platform == 'win32'
PyQt5 >=5.4,<6.0; sys_platform != 'linux'
pywin32>=200; sys_platform == 'win32'