Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] variety: patch to fix for Python 3.12.
@ 2023-10-16 17:24 TinfoilSubmarine
  2023-10-16 18:01 ` [PR PATCH] [Merged]: " ahesford
  0 siblings, 1 reply; 2+ messages in thread
From: TinfoilSubmarine @ 2023-10-16 17:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/TinfoilSubmarine/void-packages update/variety
https://github.com/void-linux/void-packages/pull/46726

variety: patch to fix for Python 3.12.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From e26859bf9d1d776287a3710bc0d64e64a2276c3f Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Mon, 16 Oct 2023 13:12:16 -0400
Subject: [PATCH] variety: patch to fix for Python 3.12.

---
 .../patches/Jumble_importlib_3.12_fix.patch   | 36 +++++++++++++++++++
 srcpkgs/variety/template                      |  2 +-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch

diff --git a/srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch b/srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch
new file mode 100644
index 0000000000000..ba7254029b5a5
--- /dev/null
+++ b/srcpkgs/variety/patches/Jumble_importlib_3.12_fix.patch
@@ -0,0 +1,36 @@
+--- a/jumble/Jumble.py
++++ b/jumble/Jumble.py
+@@ -14,7 +14,8 @@
+ # with this program.  If not, see <http://www.gnu.org/licenses/>.
+ ### END LICENSE
+ 
+-import imp
++import importlib.util
++import sys
+ import inspect
+ import logging
+ import os
+@@ -39,13 +40,16 @@
+         for location, f in self._walk_python_files():
+             path = os.path.join(location, f)
+             name = os.path.splitext(f)[0]
+-            info = imp.find_module(name, [location])
+-            try:
+-                logger.info(lambda: "Jumble loading module in %s from %s" % (name, path))
+-                yield imp.load_module(name, *info), path
+-            except Exception:
+-                logger.exception("Could not load plugin module %s" % path)
+-                continue
++            if (spec := importlib.util.spec_from_file_location(name, path)) is not None:
++                try:
++                    module = importlib.util.module_from_spec(spec)
++                    logger.info(lambda: "Jumble loading module in %s from %s" % (name, path))
++                    sys.modules[name] = module
++                    spec.loader.exec_module(module)
++                    yield module, path
++                except Exception:
++                    logger.exception("Could not load plugin module %s" % path)
++                    continue
+ 
+     def _walk_plugin_classes(self):
+         for module, path in self._walk_modules():
diff --git a/srcpkgs/variety/template b/srcpkgs/variety/template
index 33b02011caf4a..fc90702f3ac08 100644
--- a/srcpkgs/variety/template
+++ b/srcpkgs/variety/template
@@ -1,7 +1,7 @@
 # Template file for 'variety'
 pkgname=variety
 version=0.8.10
-revision=2
+revision=3
 build_style=python3-module
 pycompile_dirs="usr/share/variety/plugins"
 hostmakedepends="python3-setuptools python3-distutils-extra intltool"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: variety: patch to fix for Python 3.12.
  2023-10-16 17:24 [PR PATCH] variety: patch to fix for Python 3.12 TinfoilSubmarine
@ 2023-10-16 18:01 ` ahesford
  0 siblings, 0 replies; 2+ messages in thread
From: ahesford @ 2023-10-16 18:01 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

variety: patch to fix for Python 3.12.
https://github.com/void-linux/void-packages/pull/46726

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

`imp` is no longer available so I had to patch it to use `importlib`.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-16 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 17:24 [PR PATCH] variety: patch to fix for Python 3.12 TinfoilSubmarine
2023-10-16 18:01 ` [PR PATCH] [Merged]: " ahesford

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).