[arch-commits] Commit in python-click-threading/repos/community-any (3 files)
Levente Polyak
anthraxx at archlinux.org
Thu May 13 10:36:39 UTC 2021
Date: Thursday, May 13, 2021 @ 10:36:38
Author: anthraxx
Revision: 933006
archrelease: copy trunk to community-any
Added:
python-click-threading/repos/community-any/PKGBUILD
(from rev 933005, python-click-threading/trunk/PKGBUILD)
python-click-threading/repos/community-any/fix-click-8.0-compat.patch
(from rev 933005, python-click-threading/trunk/fix-click-8.0-compat.patch)
Deleted:
python-click-threading/repos/community-any/PKGBUILD
----------------------------+
PKGBUILD | 83 +++++++++++++++++++++++--------------------
fix-click-8.0-compat.patch | 42 +++++++++++++++++++++
2 files changed, 87 insertions(+), 38 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-05-13 10:36:29 UTC (rev 933005)
+++ PKGBUILD 2021-05-13 10:36:38 UTC (rev 933006)
@@ -1,38 +0,0 @@
-# Maintainer: David Runge <dave at sleepmap.de>
-# Contributor: eolianoe <eolianoe At GoogleMAIL DoT com>
-
-_name=click-threading
-pkgname=python-click-threading
-pkgver=0.4.4
-pkgrel=9
-pkgdesc="Multithreaded Click apps made easy"
-arch=("any")
-url="https://pypi.python.org/pypi/click-threading"
-license=("MIT")
-depends=("python-click")
-makedepends=("python-setuptools" "python2-setuptools")
-checkdepends=("python-pytest" "python-click")
-source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
-#source=("${_name}-${pkgver}.tar.gz::https://github.com/click-contrib/${_name}/archive/${pkgver}.tar.gz")
-sha512sums=('7fd17ad04065160a3278eab4e2c070424d9d69de145e88a8dc2ad9a3064162d91ad5c46b8d30e19640b2c4b420c0bb801ff6fd6dd9985f34ce2ede35cf8373f1')
-
-build() {
- cd "${_name}-${pkgver}"
- python setup.py build
-}
-
-check() {
- cd "${_name}-${pkgver}"
- export PYTHONPATH=build/lib:${PYTHONPATH}
- py.test
-}
-
-package() {
- cd "${_name}-${pkgver}"
- python setup.py install --skip-build \
- --optimize=1 \
- --prefix=/usr \
- --root="${pkgdir}"
- install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
- install -vDm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}/"
-}
Copied: python-click-threading/repos/community-any/PKGBUILD (from rev 933005, python-click-threading/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-05-13 10:36:38 UTC (rev 933006)
@@ -0,0 +1,45 @@
+# Maintainer: David Runge <dave at sleepmap.de>
+# Contributor: eolianoe <eolianoe At GoogleMAIL DoT com>
+
+_name=click-threading
+pkgname=python-click-threading
+pkgver=0.4.4
+pkgrel=10
+pkgdesc="Multithreaded Click apps made easy"
+arch=("any")
+url="https://pypi.python.org/pypi/click-threading"
+license=("MIT")
+depends=("python-click")
+makedepends=("python-setuptools")
+checkdepends=("python-pytest" "python-click")
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz"
+ fix-click-8.0-compat.patch)
+#source=("${_name}-${pkgver}.tar.gz::https://github.com/click-contrib/${_name}/archive/${pkgver}.tar.gz")
+sha512sums=('7fd17ad04065160a3278eab4e2c070424d9d69de145e88a8dc2ad9a3064162d91ad5c46b8d30e19640b2c4b420c0bb801ff6fd6dd9985f34ce2ede35cf8373f1'
+ '712726854065215ebaddd62e589ec64b5b056a090bcd8fc2bc5e2c784831f48d205b700e04662d653f87306faa02972f9c7d5b55958c552156346b180c99b1f7')
+
+prepare() {
+ cd "${_name}-${pkgver}"
+ patch -Np1 < ../fix-click-8.0-compat.patch
+}
+
+build() {
+ cd "${_name}-${pkgver}"
+ python setup.py build
+}
+
+check() {
+ cd "${_name}-${pkgver}"
+ export PYTHONPATH=build/lib:${PYTHONPATH}
+ py.test
+}
+
+package() {
+ cd "${_name}-${pkgver}"
+ python setup.py install --skip-build \
+ --optimize=1 \
+ --prefix=/usr \
+ --root="${pkgdir}"
+ install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+ install -vDm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}/"
+}
Copied: python-click-threading/repos/community-any/fix-click-8.0-compat.patch (from rev 933005, python-click-threading/trunk/fix-click-8.0-compat.patch)
===================================================================
--- fix-click-8.0-compat.patch (rev 0)
+++ fix-click-8.0-compat.patch 2021-05-13 10:36:38 UTC (rev 933006)
@@ -0,0 +1,42 @@
+From 7194508dfedb1a29709927de6e8d9f8480a0017a Mon Sep 17 00:00:00 2001
+From: Jim Turner <git at turner.link>
+Date: Wed, 12 May 2021 19:07:41 -0400
+Subject: [PATCH] Fix monkey-patching of functions with annotations
+
+click 8.0.0 [added type annotations][1] which broke click-threading's
+monkey patching of these functions. This commit is a small change to
+fix the issue. Note that this commit uses the `inspect.Signature`
+type, which was added in Python 3.3.
+
+[1]: https://github.com/pallets/click/commit/0103c9570650daa59560baf42ad0a27e57b3157f
+---
+ click_threading/monkey.py | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/click_threading/monkey.py b/click_threading/monkey.py
+index 1c16cd6..20361ff 100644
+--- a/click_threading/monkey.py
++++ b/click_threading/monkey.py
+@@ -40,12 +40,16 @@ def patch_ui_functions(wrapper):
+
+ new_f = wrapper(_copy_fn(f), info)
+
+- argspec = getargspec(f)
+- signature = inspect.formatargspec(*argspec) \
+- .lstrip('(') \
+- .rstrip(')')
+- args = ', '.join(arg.split('=')[0].split(':')[0].strip()
+- for arg in signature.split(','))
++ orig_sig_obj = inspect.signature(f)
++ sig_obj = orig_sig_obj.replace(
++ parameters=[
++ p.replace(annotation=inspect.Parameter.empty)
++ for p in orig_sig_obj.parameters.values()
++ ],
++ return_annotation=inspect.Signature.empty,
++ )
++ signature = str(sig_obj).lstrip('(').rstrip(')')
++ args = ', '.join(p for p in sig_obj.parameters.keys())
+
+ stub_f = eval('lambda {s}: {n}._real_click_fn({a})'
+ .format(n=f.__name__, s=signature, a=args))
More information about the arch-commits
mailing list