Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] tuir: adjust for python 3.12 method removal
@ 2024-03-02 19:23 Chocimier
  0 siblings, 0 replies; only message in thread
From: Chocimier @ 2024-03-02 19:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org tuir
https://github.com/void-linux/void-packages/pull/49034

tuir: adjust for python 3.12 method removal
<!-- 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/49034.patch is attached

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

From 5fb72128a9f953d7847858fd5a7fea7e85b1b920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Sat, 2 Mar 2024 20:19:54 +0100
Subject: [PATCH] tuir: adjust for python 3.12 method removal

---
 ...djust-for-python-3.12-method-removal.patch | 49 +++++++++++++++++++
 srcpkgs/tuir/template                         |  3 +-
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch

diff --git a/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch b/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch
new file mode 100644
index 00000000000000..bd9dc39ec01307
--- /dev/null
+++ b/srcpkgs/tuir/patches/0001-Adjust-for-python-3.12-method-removal.patch
@@ -0,0 +1,49 @@
+From 02ab9bade680d7c50c7d5988a75ff928ba1a8cbd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
+Date: Fri, 27 Oct 2023 20:54:13 +0200
+Subject: [PATCH 1/7] Adjust for python 3.12 method removal
+
+---
+ tuir/config.py | 7 ++++++-
+ tuir/theme.py  | 7 ++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/tuir/config.py b/tuir/config.py
+index 7a8a4d5..4fea785 100644
+--- a/tuir/config.py
++++ b/tuir/config.py
+@@ -131,7 +131,12 @@ class Config(object):
+         config = configparser.RawConfigParser()
+         if os.path.exists(filename):
+             with codecs.open(filename, encoding='utf-8') as fp:
+-                config.readfp(fp)
++                try:
++                    read_method = config.read_file
++                except AttributeError:
++                    # deprecated since 3.2, removed in 3.12
++                    read_method = config.readfp
++                read_method(fp)
+ 
+         return cls._parse_tuir_file(config)
+ 
+diff --git a/tuir/theme.py b/tuir/theme.py
+index 57b3288..c44b222 100644
+--- a/tuir/theme.py
++++ b/tuir/theme.py
+@@ -399,7 +399,12 @@ class Theme(object):
+             config = configparser.ConfigParser()
+             config.optionxform = six.text_type  # Preserve case
+             with codecs.open(filename, encoding='utf-8') as fp:
+-                config.readfp(fp)
++                try:
++                    read_method = config.read_file
++                except AttributeError:
++                    # deprecated since 3.2, removed in 3.12
++                    read_method = config.readfp
++                read_method(fp)
+         except configparser.ParsingError as e:
+             raise ConfigError(e.message)
+ 
+-- 
+2.43.0
+
diff --git a/srcpkgs/tuir/template b/srcpkgs/tuir/template
index bfae8ff1a64d2a..c431c4cf9b99eb 100644
--- a/srcpkgs/tuir/template
+++ b/srcpkgs/tuir/template
@@ -1,7 +1,7 @@
 # Template file for 'tuir'
 pkgname=tuir
 version=1.29.0
-revision=6
+revision=7
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="ncurses python3-BeautifulSoup4 python3-decorator python3-kitchen
@@ -12,6 +12,7 @@ license="MIT"
 homepage="https://gitlab.com/ajak/tuir"
 distfiles="${homepage}/-/archive/v${version}/tuir-v${version}.tar.bz2"
 checksum=501ba4e6b24f20116ccfac39cdf16b6a5c89411b4928371d5c2314d0da57d80d
+make_check=no # python3-vcrpy required
 
 post_install() {
 	vlicense LICENSE

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-02 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02 19:23 [PR PATCH] tuir: adjust for python 3.12 method removal Chocimier

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