Github messages for voidlinux
 help / color / mirror / Atom feed
From: abenson <abenson@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] python-automat: revert patch to unbreak on py2
Date: Fri, 27 Jan 2023 05:22:50 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-41898@inbox.vuxu.org> (raw)

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

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

https://github.com/abenson/void-packages automat_fixforpy2
https://github.com/void-linux/void-packages/pull/41898

python-automat: revert patch to unbreak on py2

#### Testing the changes
- I tested the changes in this PR: **NO**... not yet.

#### Local build testing
- I built this PR locally for my native architecture, x86-64

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-automat_fixforpy2-41898.patch --]
[-- Type: text/x-diff, Size: 2225 bytes --]

From 46b528feaa7b13beaf408692b547224264e4055b Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Thu, 26 Jan 2023 22:21:38 -0600
Subject: [PATCH] python-automat: revert patch to unbreak on py2

---
 srcpkgs/python-automat/patches/py2fix.patch | 37 +++++++++++++++++++++
 srcpkgs/python-automat/template             |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/python-automat/patches/py2fix.patch

diff --git a/srcpkgs/python-automat/patches/py2fix.patch b/srcpkgs/python-automat/patches/py2fix.patch
new file mode 100644
index 000000000000..8613b16afe9e
--- /dev/null
+++ b/srcpkgs/python-automat/patches/py2fix.patch
@@ -0,0 +1,37 @@
+Our builders still use the py2 version of this package.
+
+--- a/automat/_methodical.py
++++ b/automat/_methodical.py
+@@ -4,9 +4,15 @@
+ from functools import wraps
+ from itertools import count
+ 
+-from inspect import getfullargspec as getArgsSpec
++try:
++    # Python 3
++    from inspect import getfullargspec as getArgsSpec
++except ImportError:
++    # Python 2
++    from inspect import getargspec as getArgsSpec
+ 
+ import attr
++import six
+ 
+ from ._core import Transitioner, Automaton
+ from ._introspection import preserveName
+@@ -30,13 +36,13 @@
+     return ArgSpec(
+         args=tuple(spec.args),
+         varargs=spec.varargs,
+-        varkw=spec.varkw,
++        varkw=spec.varkw if six.PY3 else spec.keywords,
+         defaults=spec.defaults if spec.defaults else (),
+         kwonlyargs=tuple(spec.kwonlyargs),
+         kwonlydefaults=(
+             tuple(spec.kwonlydefaults.items())
+             if spec.kwonlydefaults else ()
+-        ),
++        ) if six.PY3 else (),
+         annotations=tuple(spec.annotations.items()),
+     )
+ 
diff --git a/srcpkgs/python-automat/template b/srcpkgs/python-automat/template
index a95e8d59bf8e..bc9ea242cfe2 100644
--- a/srcpkgs/python-automat/template
+++ b/srcpkgs/python-automat/template
@@ -1,7 +1,7 @@
 # Template file for 'python-automat'
 pkgname=python-automat
 version=22.10.0
-revision=1
+revision=2
 build_style=python-module
 hostmakedepends="python-setuptools python3-setuptools"
 depends="python-setuptools python-attrs python-six"

             reply	other threads:[~2023-01-27  4:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27  4:22 abenson [this message]
2023-01-27  4:47 ` [PR PATCH] [Merged]: " the-maldridge

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-41898@inbox.vuxu.org \
    --to=abenson@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).