* [PR PATCH] python-automat: revert patch to unbreak on py2
@ 2023-01-27 4:22 abenson
2023-01-27 4:47 ` [PR PATCH] [Merged]: " the-maldridge
0 siblings, 1 reply; 2+ messages in thread
From: abenson @ 2023-01-27 4:22 UTC (permalink / raw)
To: ml
[-- 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"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-27 4:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 4:22 [PR PATCH] python-automat: revert patch to unbreak on py2 abenson
2023-01-27 4:47 ` [PR PATCH] [Merged]: " the-maldridge
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).