Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gui type hintsAdd GUI type hints to improve code readability #1260

Open
wants to merge 71 commits into
base: feature/gui-type-hints
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
92b2780
Update translations, remove iphoto_plist.py
arsenetar Jul 1, 2022
360dcec
Update to version 4.3.0, update changelog
arsenetar Jul 1, 2022
d369bcd
Updates from investigation of #1015
arsenetar Jul 8, 2022
97f490b
Fix typo in engine.py
arsenetar Jul 8, 2022
71af825
Move try/except of cache db to get() and put()
arsenetar Jul 8, 2022
916c520
Update translations from transifex
arsenetar Jul 8, 2022
1f1dfa8
Update version & changelog for 4.3.1 release
arsenetar Jul 8, 2022
db174d4
Update columns.po
muath-ye Aug 7, 2022
1827827
Add Keywords tag to desktop file
dktrkranz Aug 31, 2022
1eee3fd
Update core.po
fascox Sep 10, 2022
f1153c8
serialize/deserialize colors to/from bytes instead of strings
Dobatymo Sep 27, 2022
265d10b
Merge pull request #1026 from muath-ye/patch-1
arsenetar Sep 28, 2022
af1ae33
Merge pull request #1042 from fascox/patch-1
arsenetar Sep 28, 2022
4448b99
fix: Add W503 to flake8 extend-ignore
arsenetar Sep 28, 2022
c920412
Add webp image format support
eugenesan Nov 24, 2022
48862b6
Merge pull request #1036 from dktrkranz/desktopfile
arsenetar Dec 6, 2022
1db93fd
Merge pull request #1069 from eugenesan/master
arsenetar Dec 6, 2022
e30a135
feat: Add additional scan time options
arsenetar Jan 6, 2023
091cae0
feat: Add confirmation dialog when canceling job
arsenetar Jan 6, 2023
83f5e80
feat: Remove shelve picture cache
arsenetar Jan 6, 2023
2dd2a80
feat: Add pre-commit and commitlint
arsenetar Jan 10, 2023
6db2fa2
fix: Correct flake8 config
arsenetar Jan 10, 2023
0cf6c9a
ci: Update to include python 3.11 & pre-commit
arsenetar Jan 10, 2023
a5e31f1
Merge pull request #1088 from arsenetar/as/remove-shelve
arsenetar Jan 10, 2023
46d1afb
chore: Apply whitespace fixes from hooks
arsenetar Jan 10, 2023
78f4145
chore: Remove unused qtlib.pot file
arsenetar Jan 10, 2023
1e651a1
Merge pull request #1089 from arsenetar/as/pre-commit
arsenetar Jan 10, 2023
81daddd
refactor: Improve digest cache db method performance
arsenetar Jan 11, 2023
057be02
fix: Prevent exception during existence check
arsenetar Jan 12, 2023
c57042f
fix: Resolve issue with mock object for core test
arsenetar Jan 12, 2023
d81759f
fix: Specify maximum python version for deb
arsenetar Jan 12, 2023
8c5e18b
Merge remote-tracking branch 'upstream/master' into colors-bytes
arsenetar Jan 12, 2023
8125e3e
chore: Add rulers to vscode settings, format
arsenetar Jan 13, 2023
549eb7f
chore: Add vscode launch.json
arsenetar Jan 13, 2023
46521c8
feat: Add migration for picture cache db
arsenetar Jan 13, 2023
e41c916
Merge pull request #1049 from Dobatymo/colors-bytes
arsenetar Jan 27, 2023
6d8b86b
fix(core): Remove old directory state logic
arsenetar Feb 27, 2023
aade659
feat: Update translations from transifex
arsenetar Apr 27, 2023
7a4506e
Github -> GitHub (#1115)
danielchalmers Apr 27, 2023
a257dbf
fix(win): Shorten file description
arsenetar Apr 27, 2023
10405ad
fix(build): Clean prior qt/dg_rc.py file before build
arsenetar Apr 27, 2023
c5a71f6
feat: Upgrade dependencies
arsenetar Apr 27, 2023
322d29a
Merge pull request #1121 from arsenetar/as/upgrade-deps
arsenetar Apr 27, 2023
fe0e4be
RE: Rewrote some of the korean translation to be more understandable
lukehyun Jun 1, 2023
99ec4e0
fix: Minor cleanups and fixes
arsenetar Jun 8, 2023
18f32fd
chore(translations): Synchronize translations
arsenetar Jun 9, 2023
9ad84ad
Merge pull request #1130 from lukehyun/master
arsenetar Jun 9, 2023
8160fe4
Update requirements.txt
cebtenzzre Jul 16, 2023
f56bef6
Update python versions in tox.ini
cebtenzzre Jul 16, 2023
332b814
Do not package send2trash on Arch Linux
cebtenzzre Jul 16, 2023
03be82c
Merge pull request #1144 from Cebtenzzre/fix-arch-package
arsenetar Jul 18, 2023
4ef1d24
Merge pull request #1142 from cebtenzzre/fix-requirements
arsenetar Dec 2, 2023
4385b50
Merge pull request #1143 from cebtenzzre/fix-tox
arsenetar Dec 2, 2023
007404f
Use isolation_level=None mode for GNU Hurd
dktrkranz Feb 12, 2024
70d956b
Merge pull request #1197 from dktrkranz/Hurd
arsenetar Feb 19, 2024
85a4557
match all orientations (#1127)
brccabral Feb 19, 2024
9f22835
Use errno.EISDIR and errno.EACCESS instead of hardcoding values (#1196)
dktrkranz Feb 19, 2024
13dd00c
fix: Replace use of `imp` with `importlib`
arsenetar Feb 19, 2024
53d5ac0
fix: Linting Errors & VS Code config
arsenetar Feb 19, 2024
e3a612a
fix: Correct change that broke black formmating
arsenetar Feb 19, 2024
95e04c4
ci: Update .pre-commit-config.yaml
arsenetar Feb 19, 2024
6e87f53
chore: Regenerate translation source files
arsenetar Feb 19, 2024
253dfd8
chore: Pull existing language translations from Transifex
arsenetar Feb 19, 2024
3d866ce
ci: Add action to push translation source to transifex
arsenetar Feb 19, 2024
a95a9db
ci: Fix version for tx-push worklflow
arsenetar Feb 19, 2024
0815481
ci: Upgrade to latest actions & python versions
arsenetar Feb 19, 2024
a81069b
fix: Photo matching fixes
arsenetar May 11, 2024
e3bcf9d
chore: Update VS Code configuration
arsenetar May 11, 2024
3a97ba9
ci: Merge artifacts
arsenetar May 11, 2024
8f197ea
feat: Create longest and shortest path criteria (#1242)
Bostwickenator Aug 23, 2024
1d0db41
Resolved merge conflicts in image_viewer.py and preferences_dialog.py
mvnpavan88 Oct 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 28 additions & 47 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,42 @@ name: Default CI/CD

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Lint with flake8
run: |
flake8 .
format:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Check format with black
run: |
black .
python-version: "3.12"
- uses: pre-commit/[email protected]
test:
needs: [lint, format]
needs: [pre-commit]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
exclude:
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.7
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
include:
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
python-version: "3.12"
- os: macos-latest
python-version: "3.12"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -r requirements.txt -r requirements-extra.txt
- name: Build python modules
run: |
Expand All @@ -78,7 +49,17 @@ jobs:
pytest core hscommon
- name: Upload Artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: modules ${{ matrix.python-version }}
path: ${{ github.workspace }}/**/*.so
path: build/**/*.so
merge-artifacts:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: modules
pattern: modules*
delete-merged: true
26 changes: 26 additions & 0 deletions .github/workflows/tx-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Push translation source to Transifex
name: Transifex Sync

on:
push:
branches:
- master
paths:
- locale/*.pot

env:
TX_VERSION: "v1.6.10"

jobs:
push-source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Transifex Client
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- $TX_VERSION
- name: Update & Push Translation Sources
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: |
./tx push -s --use-git-timestamps
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ cython_debug/
# Visual Studio Code
.vscode/*
!.vscode/settings.json
#!.vscode/tasks.json
#!.vscode/launch.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

Expand All @@ -108,4 +108,4 @@ cocoa/autogen

*.waf*
.lock-waf*
/tags
/tags
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
exclude: ".*.json"
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
exclude: ^(.tox|env|build|dist|help|qt/dg_rc.py|pkg).*
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sonar.python.version=3.7, 3.8, 3.9, 3.10
sonar.python.version=3.7, 3.8, 3.9, 3.10, 3.11
1 change: 0 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ file_filter = locale/<lang>/LC_MESSAGES/ui.po
source_file = locale/ui.pot
source_lang = en
type = PO

6 changes: 4 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"recommendations": [
"redhat.vscode-yaml",
"ms-python.vscode-pylance",
"ms-python.python"
"ms-python.python",
"ms-python.black-formatter",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
// List of extensions recommended by VS Code that should not be recommended for
// users of this workspace.
"unwantedRecommendations": []
}
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "DupuGuru",
"type": "debugpy",
"request": "launch",
"program": "run.py",
"console": "integratedTerminal",
"subProcess": true,
"justMyCode": false
},
]
}
13 changes: 9 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"python.formatting.provider": "black",
"cSpell.words": [
"Dupras",
"hscommon"
],
"editor.rulers": [
88,
120
],
"python.languageServer": "Pylance",
"yaml.schemaStore.enable": true,
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": ".github/workflows/*.yml"
}
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.testing.pytestEnabled": true
}
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -619,4 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ PYRCC5 ?= pyrcc5
REQ_MINOR_VERSION = 7
PREFIX ?= /usr/local

# Window compatability via Msys2
# Window compatability via Msys2
# - venv creates Scripts instead of bin
# - compile generates .pyd instead of .so
# - venv with --sytem-site-packages has issues on windows as well...

ifeq ($(shell ${PYTHON} -c "import platform; print(platform.system())"), Windows)
BIN = Scripts
SO = *.pyd
VENV_OPTIONS =
VENV_OPTIONS =
else
BIN = bin
SO = *.so
Expand Down Expand Up @@ -43,7 +43,7 @@ mofiles = $(patsubst %.po,%.mo,$(pofiles))
vpath %.po $(localedirs)
vpath %.mo $(localedirs)

all: | env i18n modules qt/dg_rc.py
all: | env i18n modules qt/dg_rc.py
@echo "Build complete! You can run dupeGuru with 'make run'"

run:
Expand Down Expand Up @@ -82,7 +82,7 @@ qt/dg_rc.py: qt/dg.qrc
i18n: $(mofiles)

%.mo: %.po
msgfmt -o $@ $<
msgfmt -o $@ $<

modules: | env
$(VENV_PYTHON) build.py --modules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dupeGuru comes with a makefile that can be used to build and run:
$ python run.py

### Generating Debian/Ubuntu package
To generate packages the extra requirements in requirements-extra.txt must be installed, the
To generate packages the extra requirements in requirements-extra.txt must be installed, the
steps are as follows:

$ cd <dupeGuru directory>
Expand Down
2 changes: 1 addition & 1 deletion Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To build with a different python version 3.7 vs 3.8 or 32 bit vs 64 bit specify
It is possible to build dupeGuru with the makefile on windows using a compatable POSIX environment. The following steps have been tested using [msys2][msys2]. Before running make:
1. Install msys2 or other POSIX environment
2. Install PyQt5 globally via pip
3. Use the respective console for msys2 it is `msys2 msys`
3. Use the respective console for msys2 it is `msys2 msys`

Then the following execution of the makefile should work. Pass the correct value for PYTHON to the makefile if not on the path as python3.

Expand Down
1 change: 1 addition & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def build_normal():
print("Building localizations")
build_localizations()
print("Building Qt stuff")
Path("qt", "dg_rc.py").unlink(missing_ok=True)
print_and_do("pyrcc5 {} > {}".format(Path("qt", "dg.qrc"), Path("qt", "dg_rc.py")))
fix_qt_resource_file(Path("qt", "dg_rc.py"))
build_help()
Expand Down
17 changes: 17 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-conventional'],
/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {
'header-max-length': [2, 'always', 72],
'subject-case': [2, 'always', 'sentence-case'],
'scope-enum': [2, 'always'],
},
};

module.exports = Configuration;
2 changes: 1 addition & 1 deletion core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "4.2.1"
__version__ = "4.3.1"
__appname__ = "dupeGuru"
13 changes: 7 additions & 6 deletions core/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ class DupeGuru(Broadcaster):

NAME = PROMPT_NAME = "dupeGuru"

PICTURE_CACHE_TYPE = "sqlite" # set to 'shelve' for a ShelveCache

def __init__(self, view, portable=False):
if view.get_default(DEBUG_MODE_PREFERENCE):
logging.getLogger().setLevel(logging.DEBUG)
Expand All @@ -153,7 +151,8 @@ def __init__(self, view, portable=False):
"clean_empty_dirs": False,
"ignore_hardlink_matches": False,
"copymove_dest_type": DestType.RELATIVE,
"picture_cache_type": self.PICTURE_CACHE_TYPE,
"include_exists_check": True,
"rehash_ignore_mtime": False,
}
self.selected_dupes = []
self.details_panel = DetailsPanel(self)
Expand Down Expand Up @@ -183,8 +182,7 @@ def _recreate_result_table(self):
self.view.create_results_window()

def _get_picture_cache_path(self):
cache_type = self.options["picture_cache_type"]
cache_name = "cached_pictures.shelve" if cache_type == "shelve" else "cached_pictures.db"
cache_name = "cached_pictures.db"
return op.join(self.appdata, cache_name)

def _get_dupe_sort_key(self, dupe, get_group, key, delta):
Expand Down Expand Up @@ -555,7 +553,9 @@ def invoke_custom_command(self):
# a workaround to make the damn thing work.
exepath, args = match.groups()
path, exename = op.split(exepath)
p = subprocess.Popen(exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p = subprocess.Popen(
exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
output = p.stdout.read()
logging.info("Custom command %s %s: %s", exename, args, output)
else:
Expand Down Expand Up @@ -792,6 +792,7 @@ def start_scanning(self, profile_scan=False):
Scans folders selected in :attr:`directories` and put the results in :attr:`results`
"""
scanner = self.SCANNER_CLASS()
fs.filesdb.ignore_mtime = self.options["rehash_ignore_mtime"] is True
if not self.directories.has_any_file():
self.view.show_message(tr("The selected directories contain no scannable file."))
return
Expand Down
Loading