Github messages for voidlinux
 help / color / mirror / Atom feed
From: ArsenArsen <ArsenArsen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] picard: fix typeerrors with python 3.10
Date: Sun, 17 Oct 2021 14:14:35 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33601@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]

There is a new pull request by ArsenArsen against master on the void-packages repository

https://github.com/ArsenArsen/void-packages picard-py3.10-fix
https://github.com/void-linux/void-packages/pull/33601

picard: fix typeerrors with python 3.10
backport of 452bba954c30d5a642f03c02411529f511bda786 in the picard
upstream repository: https://github.com/metabrainz/picard

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [x] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->

#### Does it build and run successfully? 
- [x] I built this PR locally for my native architecture, (x86_64-glibc)
- [x] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [x] aarch64-musl
  - [x] aarch64-glibc
  - [x] x86_64-musl

A patch file from https://github.com/void-linux/void-packages/pull/33601.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-picard-py3.10-fix-33601.patch --]
[-- Type: text/x-diff, Size: 4076 bytes --]

From bb833374e1e1cfd9b7aa9354f41a541feaba11db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Sun, 17 Oct 2021 13:53:37 +0200
Subject: [PATCH] picard: fix typeerrors with python 3.10

backport of 452bba954c30d5a642f03c02411529f511bda786 in the picard
upstream repository: https://github.com/metabrainz/picard
---
 ...0001-Fix-TypeErrors-with-Python-3.10.patch | 64 +++++++++++++++++++
 srcpkgs/picard/template                       |  2 +-
 2 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/picard/patches/0001-Fix-TypeErrors-with-Python-3.10.patch

diff --git a/srcpkgs/picard/patches/0001-Fix-TypeErrors-with-Python-3.10.patch b/srcpkgs/picard/patches/0001-Fix-TypeErrors-with-Python-3.10.patch
new file mode 100644
index 000000000000..29afe48c07fd
--- /dev/null
+++ b/srcpkgs/picard/patches/0001-Fix-TypeErrors-with-Python-3.10.patch
@@ -0,0 +1,64 @@
+From 1a462bf718f9fc4b24a0c8daefe5c7d547712ae9 Mon Sep 17 00:00:00 2001
+From: Louis Sautier <sautier.louis@gmail.com>
+Date: Fri, 27 Aug 2021 00:43:48 +0200
+Subject: [PATCH] Fix TypeErrors with Python 3.10
+
+Without these changes, running Picard with Python 3.10 results in errors
+such as:
+  File "./picard/ui/coverartbox.py", line 74, in __init__
+    self.shadow = self.shadow.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
+TypeError: arguments did not match any overloaded call:
+  scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
+  scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float'
+---
+ picard/ui/coverartbox.py | 2 +-
+ picard/ui/itemviews.py   | 6 +++---
+ picard/util/__init__.py  | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/picard/ui/coverartbox.py b/picard/ui/coverartbox.py
+index 2457de5f..cd0cce2a 100644
+--- a/picard/ui/coverartbox.py
++++ b/picard/ui/coverartbox.py
+@@ -136,7 +136,7 @@ class CoverArtThumbnail(ActiveLabel):
+             event.acceptProposedAction()
+ 
+     def scaled(self, *dimensions):
+-        return (self.pixel_ratio * dimension for dimension in dimensions)
++        return (round(self.pixel_ratio * dimension) for dimension in dimensions)
+ 
+     def show(self):
+         self.set_data(self.data, True)
+diff --git a/picard/ui/itemviews.py b/picard/ui/itemviews.py
+index cddbf50a..bb88e984 100644
+--- a/picard/ui/itemviews.py
++++ b/picard/ui/itemviews.py
+@@ -137,9 +137,9 @@ def get_match_color(similarity, basecolor):
+     c1 = (basecolor.red(), basecolor.green(), basecolor.blue())
+     c2 = (223, 125, 125)
+     return QtGui.QColor(
+-        c2[0] + (c1[0] - c2[0]) * similarity,
+-        c2[1] + (c1[1] - c2[1]) * similarity,
+-        c2[2] + (c1[2] - c2[2]) * similarity)
++        int(c2[0] + (c1[0] - c2[0]) * similarity),
++        int(c2[1] + (c1[1] - c2[1]) * similarity),
++        int(c2[2] + (c1[2] - c2[2]) * similarity))
+ 
+ 
+ class MainPanel(QtWidgets.QSplitter):
+diff --git a/picard/util/__init__.py b/picard/util/__init__.py
+index e47af34c..d12ef890 100644
+--- a/picard/util/__init__.py
++++ b/picard/util/__init__.py
+@@ -333,7 +333,7 @@ def throttle(interval):
+             else:
+                 decorator.args = args
+                 decorator.kwargs = kwargs
+-                QtCore.QTimer.singleShot(r, later)
++                QtCore.QTimer.singleShot(int(r), later)
+                 decorator.is_ticking = True
+             mutex.unlock()
+ 
+-- 
+2.32.0
+
diff --git a/srcpkgs/picard/template b/srcpkgs/picard/template
index 9692fc33773e..000e1fb194f3 100644
--- a/srcpkgs/picard/template
+++ b/srcpkgs/picard/template
@@ -1,7 +1,7 @@
 # Template file for 'picard'
 pkgname=picard
 version=2.5
-revision=3
+revision=4
 wrksrc="${pkgname}-release-${version}"
 build_style=python3-module
 make_install_args="--disable-autoupdate"

             reply	other threads:[~2021-10-17 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-17 12:14 ArsenArsen [this message]
2021-10-17 12:30 ` [PR PATCH] [Updated] " ArsenArsen
2021-10-17 12:32 ` ArsenArsen
2021-10-17 12:40 ` [PR PATCH] [Merged]: " paper42

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33601@inbox.vuxu.org \
    --to=arsenarsen@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).