openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2022
- 1 participants
- 2423 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package php8 for openSUSE:Factory checked in at 2022-11-01 13:41:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/php8 (Old)
and /work/SRC/openSUSE:Factory/.php8.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php8"
Tue Nov 1 13:41:18 2022 rev:34 rq:1032538 version:8.1.12
Changes:
--------
--- /work/SRC/openSUSE:Factory/php8/php8.changes 2022-10-03 13:44:13.969279581 +0200
+++ /work/SRC/openSUSE:Factory/.php8.new.2275/php8.changes 2022-11-01 13:41:25.783532685 +0100
@@ -1,0 +2,8 @@
+Mon Oct 31 14:25:55 UTC 2022 - pgajdos(a)suse.com
+
+- version update to 8.1.12
+ * This is a security release.
+ * fixed: CVE-2022-31630, CVE-2022-37454
+ * https://www.php.net/ChangeLog-8.php#8.1.12
+
+-------------------------------------------------------------------
Old:
----
php-8.1.11.tar.xz
php-8.1.11.tar.xz.asc
New:
----
php-8.1.12.tar.xz
php-8.1.12.tar.xz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php8.spec ++++++
--- /var/tmp/diff_new_pack.A3qA85/_old 2022-11-01 13:41:26.523536622 +0100
+++ /var/tmp/diff_new_pack.A3qA85/_new 2022-11-01 13:41:26.527536644 +0100
@@ -53,7 +53,7 @@
%define build_argon2 1
%endif
Name: %{pprefix}%{php_name}%{psuffix}
-Version: 8.1.11
+Version: 8.1.12
Release: 0
Summary: Interpreter for the PHP scripting language version 8
License: PHP-3.01
++++++ php-8.1.11.tar.xz -> php-8.1.12.tar.xz ++++++
/work/SRC/openSUSE:Factory/php8/php-8.1.11.tar.xz /work/SRC/openSUSE:Factory/.php8.new.2275/php-8.1.12.tar.xz differ: char 25, line 1
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package redis for openSUSE:Factory checked in at 2022-11-01 13:41:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/redis (Old)
and /work/SRC/openSUSE:Factory/.redis.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "redis"
Tue Nov 1 13:41:16 2022 rev:84 rq:1032521 version:7.0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/redis/redis.changes 2022-10-10 18:45:07.386941049 +0200
+++ /work/SRC/openSUSE:Factory/.redis.new.2275/redis.changes 2022-11-01 13:41:24.599526389 +0100
@@ -1,0 +2,7 @@
+Mon Oct 24 14:56:10 UTC 2022 - Danilo Spinella <danilo.spinella(a)suse.com>
+
+- Fix CVE-2022-3647, crash in sigsegvHandler debug function
+ (CVE-2022-3647, bsc#1204633)
+ * cve-2022-3647.patch
+
+-------------------------------------------------------------------
New:
----
cve-2022-3647.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ redis.spec ++++++
--- /var/tmp/diff_new_pack.VuFfbW/_old 2022-11-01 13:41:25.147529304 +0100
+++ /var/tmp/diff_new_pack.VuFfbW/_new 2022-11-01 13:41:25.151529324 +0100
@@ -40,6 +40,9 @@
Patch0: %{name}-conf.patch
Patch3: reproducible.patch
Patch4: ppc-atomic.patch
+# PATCH-FIX-UPSTREAm bsc#1204633 danilo.spinella(a)suse.com CVE-2022-3647
+# crash in sigsegvHandler debug function
+Patch5: cve-2022-3647.patch
BuildRequires: jemalloc-devel
BuildRequires: libopenssl-devel >= 1.1.1
BuildRequires: pkgconfig
@@ -67,6 +70,7 @@
%patch0
%patch3 -p1
%patch4 -p1
+%patch5 -p1
%build
export HOST=OBS # for reproducible builds
++++++ cve-2022-3647.patch ++++++
From 0bf90d944313919eb8e63d3588bf63a367f020a3 Mon Sep 17 00:00:00 2001
From: "Meir Shpilraien (Spielrein)" <meir(a)redis.com>
Date: Thu, 29 Sep 2022 08:58:58 +0300
Subject: [PATCH] Avoid crash on crash report when a bad function pointer was
called (#11298)
If Redis crashes due to calling an invalid function pointer,
the `backtrace` function will try to dereference this invalid pointer
which will cause a crash inside the crash report and will kill
the processes without having all the crash report information.
Example:
```
=== REDIS BUG REPORT START: Cut & paste starting from here ===
198672:M 19 Sep 2022 18:06:12.936 # Redis 255.255.255 crashed by signal: 11, si_code: 1
198672:M 19 Sep 2022 18:06:12.936 # Accessing address: 0x1
198672:M 19 Sep 2022 18:06:12.936 # Crashed running the instruction at: 0x1
// here the processes is crashing
```
This PR tries to fix this crash be:
1. Identify the issue when it happened.
2. Replace the invalid pointer with a pointer to some dummy function
so that `backtrace` will not crash.
I identification is done by comparing `eip` to `info->si_addr`, if they
are the same we know that the crash happened on the same address it tries to
accesses and we can conclude that it tries to call and invalid function pointer.
To replace the invalid pointer we introduce a new function, `setMcontextEip`,
which is very similar to `getMcontextEip` and it knows to set the Eip for the
different supported OS's. After printing the trace we retrieve the old `Eip` value.
---
src/debug.c | 80 ++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 58 insertions(+), 22 deletions(-)
diff --git a/src/debug.c b/src/debug.c
index 8cc811be444b..b15ac8780d83 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -1123,73 +1123,88 @@ void bugReportStart(void) {
}
#ifdef HAVE_BACKTRACE
-static void *getMcontextEip(ucontext_t *uc) {
+
+/* Returns the current eip and set it to the given new value (if its not NULL) */
+static void* getAndSetMcontextEip(ucontext_t *uc, void *eip) {
#define NOT_SUPPORTED() do {\
UNUSED(uc);\
+ UNUSED(eip);\
return NULL;\
} while(0)
+#define GET_SET_RETURN(target_var, new_val) do {\
+ void *old_val = (void*)target_var; \
+ if (new_val) { \
+ void **temp = (void**)&target_var; \
+ *temp = new_val; \
+ } \
+ return old_val; \
+} while(0)
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
/* OSX < 10.6 */
#if defined(__x86_64__)
- return (void*) uc->uc_mcontext->__ss.__rip;
+ GET_SET_RETURN(uc->uc_mcontext->__ss.__rip, eip);
#elif defined(__i386__)
- return (void*) uc->uc_mcontext->__ss.__eip;
+ GET_SET_RETURN(uc->uc_mcontext->__ss.__eip, eip);
#else
- return (void*) uc->uc_mcontext->__ss.__srr0;
+ GET_SET_RETURN(uc->uc_mcontext->__ss.__srr0, eip);
#endif
#elif defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)
/* OSX >= 10.6 */
#if defined(_STRUCT_X86_THREAD_STATE64) && !defined(__i386__)
- return (void*) uc->uc_mcontext->__ss.__rip;
+ GET_SET_RETURN(uc->uc_mcontext->__ss.__rip, eip);
#elif defined(__i386__)
- return (void*) uc->uc_mcontext->__ss.__eip;
+ GET_SET_RETURN(uc->uc_mcontext->__ss.__eip, eip);
#else
/* OSX ARM64 */
- return (void*) arm_thread_state64_get_pc(uc->uc_mcontext->__ss);
+ void *old_val = (void*)arm_thread_state64_get_pc(uc->uc_mcontext->__ss);
+ if (eip) {
+ arm_thread_state64_set_pc_fptr(uc->uc_mcontext->__ss, eip);
+ }
+ return old_val;
#endif
#elif defined(__linux__)
/* Linux */
#if defined(__i386__) || ((defined(__X86_64__) || defined(__x86_64__)) && defined(__ILP32__))
- return (void*) uc->uc_mcontext.gregs[14]; /* Linux 32 */
+ GET_SET_RETURN(uc->uc_mcontext.gregs[14], eip);
#elif defined(__X86_64__) || defined(__x86_64__)
- return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */
+ GET_SET_RETURN(uc->uc_mcontext.gregs[16], eip);
#elif defined(__ia64__) /* Linux IA64 */
- return (void*) uc->uc_mcontext.sc_ip;
+ GET_SET_RETURN(uc->uc_mcontext.sc_ip, eip);
#elif defined(__arm__) /* Linux ARM */
- return (void*) uc->uc_mcontext.arm_pc;
+ GET_SET_RETURN(uc->uc_mcontext.arm_pc, eip);
#elif defined(__aarch64__) /* Linux AArch64 */
- return (void*) uc->uc_mcontext.pc;
+ GET_SET_RETURN(uc->uc_mcontext.pc, eip);
#else
NOT_SUPPORTED();
#endif
#elif defined(__FreeBSD__)
/* FreeBSD */
#if defined(__i386__)
- return (void*) uc->uc_mcontext.mc_eip;
+ GET_SET_RETURN(uc->uc_mcontext.mc_eip, eip);
#elif defined(__x86_64__)
- return (void*) uc->uc_mcontext.mc_rip;
+ GET_SET_RETURN(uc->uc_mcontext.mc_rip, eip);
#else
NOT_SUPPORTED();
#endif
#elif defined(__OpenBSD__)
/* OpenBSD */
#if defined(__i386__)
- return (void*) uc->sc_eip;
+ GET_SET_RETURN(uc->sc_eip, eip);
#elif defined(__x86_64__)
- return (void*) uc->sc_rip;
+ GET_SET_RETURN(uc->sc_rip, eip);
#else
NOT_SUPPORTED();
#endif
#elif defined(__NetBSD__)
#if defined(__i386__)
- return (void*) uc->uc_mcontext.__gregs[_REG_EIP];
+ GET_SET_RETURN(uc->uc_mcontext.__gregs[_REG_EIP], eip);
#elif defined(__x86_64__)
- return (void*) uc->uc_mcontext.__gregs[_REG_RIP];
+ GET_SET_RETURN(uc->uc_mcontext.__gregs[_REG_RIP], eip);
#else
NOT_SUPPORTED();
#endif
#elif defined(__DragonFly__)
- return (void*) uc->uc_mcontext.mc_rip;
+ GET_SET_RETURN(uc->uc_mcontext.mc_rip, eip);
#else
NOT_SUPPORTED();
#endif
@@ -1951,6 +1966,10 @@ void dumpCodeAroundEIP(void *eip) {
}
}
+void invalidFunctionWasCalled() {}
+
+typedef void (*invalidFunctionWasCalledType)();
+
void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
UNUSED(secret);
UNUSED(info);
@@ -1968,13 +1987,30 @@ void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
#ifdef HAVE_BACKTRACE
ucontext_t *uc = (ucontext_t*) secret;
- void *eip = getMcontextEip(uc);
+ void *eip = getAndSetMcontextEip(uc, NULL);
if (eip != NULL) {
serverLog(LL_WARNING,
"Crashed running the instruction at: %p", eip);
}
- logStackTrace(getMcontextEip(uc), 1);
+ if (eip == info->si_addr) {
+ /* When eip matches the bad address, it's an indication that we crashed when calling a non-mapped
+ * function pointer. In that case the call to backtrace will crash trying to access that address and we
+ * won't get a crash report logged. Set it to a valid point to avoid that crash. */
+
+ /* This trick allow to avoid compiler warning */
+ void *ptr;
+ invalidFunctionWasCalledType *ptr_ptr = (invalidFunctionWasCalledType*)&ptr;
+ *ptr_ptr = invalidFunctionWasCalled;
+ getAndSetMcontextEip(uc, ptr);
+ }
+
+ logStackTrace(eip, 1);
+
+ if (eip == info->si_addr) {
+ /* Restore old eip */
+ getAndSetMcontextEip(uc, eip);
+ }
logRegisters(uc);
#endif
@@ -2079,7 +2115,7 @@ void watchdogSignalHandler(int sig, siginfo_t *info, void *secret) {
serverLogFromHandler(LL_WARNING,"\n--- WATCHDOG TIMER EXPIRED ---");
#ifdef HAVE_BACKTRACE
- logStackTrace(getMcontextEip(uc), 1);
+ logStackTrace(getAndSetMcontextEip(uc, NULL), 1);
#else
serverLogFromHandler(LL_WARNING,"Sorry: no support for backtrace().");
#endif
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-Deprecated for openSUSE:Factory checked in at 2022-11-01 13:41:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Deprecated (Old)
and /work/SRC/openSUSE:Factory/.python-Deprecated.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Deprecated"
Tue Nov 1 13:41:14 2022 rev:8 rq:1032520 version:1.2.13
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Deprecated/python-Deprecated.changes 2021-12-09 19:45:32.445131275 +0100
+++ /work/SRC/openSUSE:Factory/.python-Deprecated.new.2275/python-Deprecated.changes 2022-11-01 13:41:23.703521622 +0100
@@ -1,0 +2,6 @@
+Mon Oct 31 13:16:26 UTC 2022 - Ben Greiner <code(a)bnavigator.de>
+
+- Provid canonicalized lowercase name
+- Don't catchall files section
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Deprecated.spec ++++++
--- /var/tmp/diff_new_pack.4WsmkE/_old 2022-11-01 13:41:24.175524133 +0100
+++ /var/tmp/diff_new_pack.4WsmkE/_new 2022-11-01 13:41:24.183524175 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-Deprecated
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,6 +32,7 @@
BuildRequires: python-rpm-macros
Requires: python-wrapt >= 1.10
BuildArch: noarch
+Provides: python-deprecated = %{version}-%{release}
%python_subpackages
%description
@@ -54,6 +55,7 @@
%files %{python_files}
%doc CHANGELOG.rst README.md
%license LICENSE.rst
-%{python_sitelib}/*
+%{python_sitelib}/deprecated
+%{python_sitelib}/Deprecated-%{version}*-info
%changelog
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package lsof for openSUSE:Factory checked in at 2022-11-01 13:41:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lsof (Old)
and /work/SRC/openSUSE:Factory/.lsof.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lsof"
Tue Nov 1 13:41:13 2022 rev:43 rq:1032519 version:4.96.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/lsof/lsof.changes 2022-07-09 16:59:18.664460778 +0200
+++ /work/SRC/openSUSE:Factory/.lsof.new.2275/lsof.changes 2022-11-01 13:41:22.839517025 +0100
@@ -1,0 +2,11 @@
+Sun Oct 30 10:51:21 UTC 2022 - Andreas Stieger <andreas.stieger(a)gmx.de>
+
+- update to 4.96.4
+ * fix hash functions used for finding local tcp/udp IPCs
+ * Show copyright notice in --version output.
+ * Avoid some easy collissions for udp/udp6 sockets when hashing
+ * Changing the number of ipcbuckets to 4096
+ * obtain correct information of memory-mapped file.
+- drop remove-hostname.patch now upstream
+
+-------------------------------------------------------------------
Old:
----
lsof_4.95.0.linux.tar.bz2
remove-hostname.patch
New:
----
lsof-4.96.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ lsof.spec ++++++
--- /var/tmp/diff_new_pack.FHRjkv/_old 2022-11-01 13:41:23.423520132 +0100
+++ /var/tmp/diff_new_pack.FHRjkv/_new 2022-11-01 13:41:23.427520153 +0100
@@ -17,18 +17,16 @@
Name: lsof
-Version: 4.95.0
+Version: 4.96.4
Release: 0
Summary: A Program That Lists Information about Files Opened by Processes
License: Zlib
Group: System/Monitoring
URL: https://github.com/lsof-org/lsof
-Source: https://github.com/lsof-org/lsof/releases/download/%{version}/lsof_%{versio…
-# PATCH-FIX-UPSTREAM danilo.spinella(a)suse.com bsc#1199709
-# https://github.com/lsof-org/lsof/pull/217
-Patch0: remove-hostname.patch
-BuildRequires: libselinux-devel
-BuildRequires: xz
+Source: https://github.com/lsof-org/lsof/archive/refs/tags/%{version}.tar.gz#/%{nam…
+BuildRequires: groff
+BuildRequires: pkgconfig
+BuildRequires: pkgconfig(libselinux)
%description
Lsof lists information about files opened by processes. An open file
@@ -39,14 +37,15 @@
path.
%prep
-%setup -q -n %{name}_%{version}.linux
-%patch0 -p1
+%autosetup -p1
%build
./Configure -n linux
%make_build
+soelim -r Lsof.8 > lsof.8
%install
+%make_install
install -m755 -d %{buildroot}%{_bindir} %{buildroot}%{_mandir}/man8
install -m755 lsof %{buildroot}%{_bindir}
install -m644 lsof.8 %{buildroot}%{_mandir}/man8/lsof.8
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-lark for openSUSE:Factory checked in at 2022-11-01 13:41:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-lark (Old)
and /work/SRC/openSUSE:Factory/.python-lark.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-lark"
Tue Nov 1 13:41:11 2022 rev:2 rq:1032505 version:1.1.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-lark/python-lark.changes 2022-10-12 18:24:36.461651908 +0200
+++ /work/SRC/openSUSE:Factory/.python-lark.new.2275/python-lark.changes 2022-11-01 13:41:21.519510002 +0100
@@ -1,0 +2,26 @@
+Fri Oct 28 17:58:49 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to v1.1.3
+ Various fixes and refactors
+ * Add user to cache filename; better handle cache load/save failures by @klauer in #1179
+ * refactor: add 'usedforsecurity=False' arg to hashlib.md5 usage by @cquick01 in #1190
+ * Create lark/grammars/init.py by @chanicpanic in #1171
+ * Adjust imports for Python 3.11 by @The-Compiler in #1140
+ * Fix for issue #1173 by @erezsh in #1198
+ * Add match stmt support to python.lark by @joseph-e-k in #1123
+ * Added match stmt support to python.lark by @MegaIng in #1016
+ * Linting to fix minor issues by @Erotemic in #1128
+ * Simplify lexer: Use Match.lastgroup instead of lastindex by @erezsh in #1129
+ * Fix confusing import in examples by @JonasLoos in #1138
+ * Move iter_subtrees_topdown into standalone by @camgunz in #1137
+ * Fix 1146: use the class's get instead of the instance's get by @MegaIng in #1147
+ * fix: remove Python 2 legacy packaging code by @henryiii in #1148
+ * Fix for PR #1149 by @erezsh in #1150
+ * Old link for sppf is no longer valid. Point to web archive instead. by @patrickhuber in #1159
+ * Fix ForestToPyDotVisitor by @chanicpanic in #1167
+ * Close file-like objects to address ResourceWarning. by @shawnbrown in #1183
+ * Minor adjustments to PR #1179 by @erezsh in #1189
+ * Adjustments for PR #1152 by @erezsh in #1191
+ * Remove trailing whitespace by @bcr in #1196
+
+-------------------------------------------------------------------
Old:
----
lark-1.1.2.tar.gz
New:
----
lark-1.1.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-lark.spec ++++++
--- /var/tmp/diff_new_pack.ZbUluu/_old 2022-11-01 13:41:22.167513450 +0100
+++ /var/tmp/diff_new_pack.ZbUluu/_new 2022-11-01 13:41:22.171513472 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-lark
-Version: 1.1.2
+Version: 1.1.3
Release: 0
Summary: A parsing library for Python
License: MIT
++++++ lark-1.1.2.tar.gz -> lark-1.1.3.tar.gz ++++++
++++ 1717 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-more-itertools for openSUSE:Factory checked in at 2022-11-01 13:41:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-more-itertools (Old)
and /work/SRC/openSUSE:Factory/.python-more-itertools.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-more-itertools"
Tue Nov 1 13:41:10 2022 rev:21 rq:1032501 version:9.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-more-itertools/python-more-itertools.changes 2022-09-18 17:32:12.625768784 +0200
+++ /work/SRC/openSUSE:Factory/.python-more-itertools.new.2275/python-more-itertools.changes 2022-11-01 13:41:20.055502214 +0100
@@ -1,0 +2,17 @@
+Fri Oct 28 18:32:55 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to 9.0.0
+ * Potentially breaking changes
+ grouper() no longer accepts an integer as its first argument. Previously this raised a DeprecationWarning.
+ collate() has been removed. Use the built-in heapq.merge() instead.
+ windowed() now yields nothing when its iterable is empty.
+ This library now advertises support for Python 3.7+.
+ * New functions
+ constrained_batches()
+ batched() (from the Python itertools docs)
+ polynomial_from_roots() (from the Python itertools docs)
+ sieve() (from the Python itertools docs)
+ * Other changes
+ Some documentation issues were fixed (thanks to nanouasyn)
+
+-------------------------------------------------------------------
Old:
----
more-itertools-8.14.0.tar.gz
New:
----
more-itertools-9.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-more-itertools.spec ++++++
--- /var/tmp/diff_new_pack.sQLD4j/_old 2022-11-01 13:41:20.599505108 +0100
+++ /var/tmp/diff_new_pack.sQLD4j/_new 2022-11-01 13:41:20.603505128 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-more-itertools
-Version: 8.14.0
+Version: 9.0.0
Release: 0
Summary: More routines for operating on iterables, beyond itertools
License: MIT
++++++ more-itertools-8.14.0.tar.gz -> more-itertools-9.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/.github/workflows/python-app.yml new/more-itertools-9.0.0/.github/workflows/python-app.yml
--- old/more-itertools-8.14.0/.github/workflows/python-app.yml 2022-08-09 16:00:34.670124000 +0200
+++ new/more-itertools-9.0.0/.github/workflows/python-app.yml 2022-10-18 15:38:19.069835000 +0200
@@ -8,7 +8,7 @@
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: [3.6, 3.7, 3.8, 3.9.0, 3.10.0, pypy3]
+ python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-rc.2", "pypy-3.8"]
steps:
- uses: actions/checkout@v2
@@ -31,28 +31,28 @@
run: |
flake8 .
- name: Check formatting with black
- if: "matrix.python-version == '3.6'"
+ if: "matrix.python-version == '3.7'"
run: |
pip install -U black
black --check .
- name: Check type stubs with mypy
- if: "matrix.python-version != 'pypy3'"
+ if: "matrix.python-version != 'pypy-3.8'"
run: |
pip install -U mypy
stubtest more_itertools.more more_itertools.recipes
- name: Build docs with sphinx
- if: "matrix.python-version == '3.6'"
+ if: "matrix.python-version == '3.7'"
run: |
pip install -U sphinx sphinx_rtd_theme
sphinx-build -W -b html docs docs/_build/html
- name: Build packages
- if: "matrix.python-version == '3.6'"
+ if: "matrix.python-version == '3.7'"
run: |
pip install -U flit twine
flit build --setup-py
twine check dist/*
- name: Upload packages
- if: "matrix.python-version == '3.6'"
+ if: "matrix.python-version == '3.7'"
uses: actions/upload-artifact@v2
with:
name: more-itertools-packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/PKG-INFO new/more-itertools-9.0.0/PKG-INFO
--- old/more-itertools-8.14.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/more-itertools-9.0.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +1,21 @@
Metadata-Version: 2.1
Name: more-itertools
-Version: 8.14.0
+Version: 9.0.0
Summary: More routines for operating on iterables, beyond itertools
-Keywords: itertools,iterator,iteration,filter,peek,peekable,collate,chunk,chunked
+Keywords: itertools,iterator,iteration,filter,peek,peekable,chunk,chunked
Author-email: Erik Rose <erikrose(a)grinchcentral.com>
-Requires-Python: >=3.5
+Requires-Python: >=3.7
Description-Content-Type: text/x-rst
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -39,6 +39,7 @@
| | `ichunked <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ich…>`_, |
| | `chunked_even <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chu…>`_, |
| | `sliced <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_, |
+| | `constrained_batches <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.con…>`_, |
| | `distribute <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dis…>`_, |
| | `divide <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.div…>`_, |
| | `split_at <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spl…>`_, |
@@ -48,6 +49,7 @@
| | `split_when <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spl…>`_, |
| | `bucket <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.buc…>`_, |
| | `unzip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unz…>`_, |
+| | `batched <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.bat…>`_, |
| | `grouper <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.gro…>`_, |
| | `partition <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.par…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -62,8 +64,8 @@
| | `windowed_complete <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.win…>`_, |
| | `pairwise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pai…>`_, |
| | `triplewise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tri…>`_, |
-| | `sliding_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_ |
-| | `subslices <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sub…>`_, |
+| | `sliding_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_, |
+| | `subslices <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sub…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Augmenting | `count_cycle <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.cou…>`_, |
| | `intersperse <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.int…>`_, |
@@ -103,7 +105,7 @@
| | `all_unique <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all…>`_, |
| | `minmax <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.min…>`_, |
| | `first_true <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.fir…>`_, |
-| | `quantify <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.qua…>`_ |
+| | `quantify <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.qua…>`_, |
| | `iequals <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ieq…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Selecting | `islice_extended <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.isl…>`_, |
@@ -126,7 +128,7 @@
| | `unique_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertoo ls.unique_everseen>`_, |
| | `unique_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.uni…>`_, |
| | `duplicates_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_, |
-| | `duplicates_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_ |
+| | `duplicates_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_, |
| | `longest_common_prefix <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.lon…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Combinatorics | `distinct_permutations <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dis…>`_, |
@@ -167,6 +169,8 @@
| | `consume <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.con…>`_, |
| | `tabulate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tab…>`_, |
| | `repeatfunc <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rep…>`_ |
+| | `polynomial_from_roots <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pol…>`_ |
+| | `sieve <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sie…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/README.rst new/more-itertools-9.0.0/README.rst
--- old/more-itertools-8.14.0/README.rst 2022-08-09 15:50:39.706522700 +0200
+++ new/more-itertools-9.0.0/README.rst 2022-10-18 15:38:19.069835000 +0200
@@ -15,6 +15,7 @@
| | `ichunked <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ich…>`_, |
| | `chunked_even <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chu…>`_, |
| | `sliced <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_, |
+| | `constrained_batches <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.con…>`_, |
| | `distribute <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dis…>`_, |
| | `divide <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.div…>`_, |
| | `split_at <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spl…>`_, |
@@ -24,6 +25,7 @@
| | `split_when <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.spl…>`_, |
| | `bucket <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.buc…>`_, |
| | `unzip <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.unz…>`_, |
+| | `batched <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.bat…>`_, |
| | `grouper <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.gro…>`_, |
| | `partition <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.par…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -38,8 +40,8 @@
| | `windowed_complete <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.win…>`_, |
| | `pairwise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pai…>`_, |
| | `triplewise <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tri…>`_, |
-| | `sliding_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_ |
-| | `subslices <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sub…>`_, |
+| | `sliding_window <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sli…>`_, |
+| | `subslices <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sub…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Augmenting | `count_cycle <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.cou…>`_, |
| | `intersperse <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.int…>`_, |
@@ -79,7 +81,7 @@
| | `all_unique <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.all…>`_, |
| | `minmax <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.min…>`_, |
| | `first_true <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.fir…>`_, |
-| | `quantify <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.qua…>`_ |
+| | `quantify <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.qua…>`_, |
| | `iequals <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.ieq…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Selecting | `islice_extended <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.isl…>`_, |
@@ -102,7 +104,7 @@
| | `unique_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertoo ls.unique_everseen>`_, |
| | `unique_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.uni…>`_, |
| | `duplicates_everseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_, |
-| | `duplicates_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_ |
+| | `duplicates_justseen <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dup…>`_, |
| | `longest_common_prefix <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.lon…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Combinatorics | `distinct_permutations <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.dis…>`_, |
@@ -143,6 +145,8 @@
| | `consume <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.con…>`_, |
| | `tabulate <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.tab…>`_, |
| | `repeatfunc <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.rep…>`_ |
+| | `polynomial_from_roots <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.pol…>`_ |
+| | `sieve <https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.sie…>`_ |
+------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/docs/api.rst new/more-itertools-9.0.0/docs/api.rst
--- old/more-itertools-8.14.0/docs/api.rst 2022-08-09 15:43:59.871538400 +0200
+++ new/more-itertools-9.0.0/docs/api.rst 2022-10-18 15:37:02.101069200 +0200
@@ -17,6 +17,7 @@
.. autofunction:: ichunked
.. autofunction:: chunked_even
.. autofunction:: sliced
+.. autofunction:: constrained_batches(iterable, max_size, max_count=None, get_len=len, strict=True)
.. autofunction:: distribute
.. autofunction:: divide
.. autofunction:: split_at
@@ -31,6 +32,7 @@
**Itertools recipes**
+.. autofunction:: batched
.. autofunction:: grouper
.. autofunction:: partition
@@ -287,3 +289,5 @@
.. autofunction:: consume
.. autofunction:: tabulate
.. autofunction:: repeatfunc
+.. autofunction:: polynomial_from_roots
+.. autofunction:: sieve
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/docs/versions.rst new/more-itertools-9.0.0/docs/versions.rst
--- old/more-itertools-8.14.0/docs/versions.rst 2022-08-09 15:49:41.910306700 +0200
+++ new/more-itertools-9.0.0/docs/versions.rst 2022-10-18 15:38:19.069835000 +0200
@@ -5,6 +5,24 @@
.. automodule:: more_itertools
:noindex:
+9.0.0
+------
+
+* Potentially breaking changes
+ * :func:`grouper` no longer accepts an integer as its first argument. Previously this raised a ``DeprecationWarning``.
+ * :func:`collate` has been removed. Use the built-in :func:`heapq.merge` instead.
+ * :func:`windowed` now yields nothing when its iterable is empty.
+ * This library now advertises support for Python 3.7+.
+
+* New functions
+ * :func:`constrained_batches`
+ * :func:`batched` (from the Python itertools docs)
+ * :func:`polynomial_from_roots` (from the Python itertools docs)
+ * :func:`sieve` (from the Python itertools docs)
+
+* Other changes
+ * Some documentation issues were fixed (thanks to nanouasyn)
+
8.14.0
------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/more_itertools/__init__.py new/more-itertools-9.0.0/more_itertools/__init__.py
--- old/more-itertools-8.14.0/more_itertools/__init__.py 2022-08-09 15:53:46.644506700 +0200
+++ new/more-itertools-9.0.0/more_itertools/__init__.py 2022-10-18 15:38:19.069835000 +0200
@@ -3,4 +3,4 @@
from .more import * # noqa
from .recipes import * # noqa
-__version__ = '8.14.0'
+__version__ = '9.0.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/more_itertools/more.py new/more-itertools-9.0.0/more_itertools/more.py
--- old/more-itertools-8.14.0/more_itertools/more.py 2022-08-09 15:43:59.877477000 +0200
+++ new/more-itertools-9.0.0/more_itertools/more.py 2022-10-18 15:38:19.073834700 +0200
@@ -3,7 +3,7 @@
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from functools import partial, reduce, wraps
-from heapq import merge, heapify, heapreplace, heappop
+from heapq import heapify, heapreplace, heappop
from itertools import (
chain,
compress,
@@ -52,9 +52,9 @@
'chunked_even',
'circular_shifts',
'collapse',
- 'collate',
'combination_index',
'consecutive_groups',
+ 'constrained_batches',
'consumer',
'count_cycle',
'countable',
@@ -412,44 +412,6 @@
return self._cache[index]
-def collate(*iterables, **kwargs):
- """Return a sorted merge of the items from each of several already-sorted
- *iterables*.
-
- >>> list(collate('ACDZ', 'AZ', 'JKL'))
- ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']
-
- Works lazily, keeping only the next value from each iterable in memory. Use
- :func:`collate` to, for example, perform a n-way mergesort of items that
- don't fit in memory.
-
- If a *key* function is specified, the iterables will be sorted according
- to its result:
-
- >>> key = lambda s: int(s) # Sort by numeric value, not by string
- >>> list(collate(['1', '10'], ['2', '11'], key=key))
- ['1', '2', '10', '11']
-
-
- If the *iterables* are sorted in descending order, set *reverse* to
- ``True``:
-
- >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
- [5, 4, 3, 2, 1, 0]
-
- If the elements of the passed-in iterables are out of order, you might get
- unexpected results.
-
- On Python 3.5+, this function is an alias for :func:`heapq.merge`.
-
- """
- warnings.warn(
- "collate is no longer part of more_itertools, use heapq.merge",
- DeprecationWarning,
- )
- return merge(*iterables, **kwargs)
-
-
def consumer(func):
"""Decorator that automatically advances a PEP-342-style "reverse iterator"
to its first yield point so you don't have to call ``next()`` on it
@@ -875,7 +837,9 @@
yield tuple(window)
size = len(window)
- if size < n:
+ if size == 0:
+ return
+ elif size < n:
yield tuple(chain(window, repeat(fillvalue, n - size)))
elif 0 < i < min(step, n):
window += (fillvalue,) * i
@@ -4331,3 +4295,53 @@
hi, hi_key = y, y_key
return lo, hi
+
+
+def constrained_batches(
+ iterable, max_size, max_count=None, get_len=len, strict=True
+):
+ """Yield batches of items from *iterable* with a combined size limited by
+ *max_size*.
+
+ >>> iterable = [b'12345', b'123', b'12345678', b'1', b'1', b'12', b'1']
+ >>> list(constrained_batches(iterable, 10))
+ [(b'12345', b'123'), (b'12345678', b'1', b'1'), (b'12', b'1')]
+
+ If a *max_count* is supplied, the number of items per batch is also
+ limited:
+
+ >>> iterable = [b'12345', b'123', b'12345678', b'1', b'1', b'12', b'1']
+ >>> list(constrained_batches(iterable, 10, max_count = 2))
+ [(b'12345', b'123'), (b'12345678', b'1'), (b'1', b'12'), (b'1',)]
+
+ If a *get_len* function is supplied, use that instead of :func:`len` to
+ determine item size.
+
+ If *strict* is ``True``, raise ``ValueError`` if any single item is bigger
+ than *max_size*. Otherwise, allow single items to exceed *max_size*.
+ """
+ if max_size <= 0:
+ raise ValueError('maximum size must be greater than zero')
+
+ batch = []
+ batch_size = 0
+ batch_count = 0
+ for item in iterable:
+ item_len = get_len(item)
+ if strict and item_len > max_size:
+ raise ValueError('item size exceeds maximum size')
+
+ reached_count = batch_count == max_count
+ reached_size = item_len + batch_size > max_size
+ if batch_count and (reached_size or reached_count):
+ yield tuple(batch)
+ batch.clear()
+ batch_size = 0
+ batch_count = 0
+
+ batch.append(item)
+ batch_size += item_len
+ batch_count += 1
+
+ if batch:
+ yield tuple(batch)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/more_itertools/more.pyi new/more-itertools-9.0.0/more_itertools/more.pyi
--- old/more-itertools-8.14.0/more_itertools/more.pyi 2022-08-09 15:43:59.881166500 +0200
+++ new/more-itertools-9.0.0/more_itertools/more.pyi 2022-10-18 15:38:19.073834700 +0200
@@ -72,7 +72,6 @@
@overload
def __getitem__(self, index: slice) -> List[_T]: ...
-def collate(*iterables: Iterable[_T], **kwargs: Any) -> Iterable[_T]: ...
def consumer(func: _GenFn) -> _GenFn: ...
def ilen(iterable: Iterable[object]) -> int: ...
def iterate(func: Callable[[_T], _T], start: _T) -> Iterator[_T]: ...
@@ -179,7 +178,7 @@
iterable: Iterable[_T],
*,
n: Optional[int] = ...,
- next_multiple: bool = ...
+ next_multiple: bool = ...,
) -> Iterator[Optional[_T]]: ...
@overload
def padded(
@@ -225,7 +224,7 @@
__iter1: Iterable[_T],
__iter2: Iterable[_T],
__iter3: Iterable[_T],
- *iterables: Iterable[_T]
+ *iterables: Iterable[_T],
) -> Iterator[Tuple[_T, ...]]: ...
@overload
def zip_offset(
@@ -233,7 +232,7 @@
*,
offsets: _SizedIterable[int],
longest: bool = ...,
- fillvalue: None = None
+ fillvalue: None = None,
) -> Iterator[Tuple[Optional[_T1]]]: ...
@overload
def zip_offset(
@@ -242,7 +241,7 @@
*,
offsets: _SizedIterable[int],
longest: bool = ...,
- fillvalue: None = None
+ fillvalue: None = None,
) -> Iterator[Tuple[Optional[_T1], Optional[_T2]]]: ...
@overload
def zip_offset(
@@ -252,7 +251,7 @@
*iterables: Iterable[_T],
offsets: _SizedIterable[int],
longest: bool = ...,
- fillvalue: None = None
+ fillvalue: None = None,
) -> Iterator[Tuple[Optional[_T], ...]]: ...
@overload
def zip_offset(
@@ -420,7 +419,7 @@
iterable: Iterable[_T],
func: Callable[[_T, _T], _U] = ...,
*,
- initial: None = ...
+ initial: None = ...,
) -> Iterator[Union[_T, _U]]: ...
@overload
def difference(
@@ -529,12 +528,12 @@
def filter_except(
validator: Callable[[Any], object],
iterable: Iterable[_T],
- *exceptions: Type[BaseException]
+ *exceptions: Type[BaseException],
) -> Iterator[_T]: ...
def map_except(
function: Callable[[Any], _U],
iterable: Iterable[_T],
- *exceptions: Type[BaseException]
+ *exceptions: Type[BaseException],
) -> Iterator[_U]: ...
def map_if(
iterable: Iterable[Any],
@@ -610,7 +609,7 @@
scalar_types: Union[
type, Tuple[Union[type, Tuple[Any, ...]], ...], None
] = ...,
- strict: bool = ...
+ strict: bool = ...,
) -> Iterable[Tuple[_T, ...]]: ...
def unique_in_window(
iterable: Iterable[_T], n: int, key: Optional[Callable[[_T], _U]] = ...
@@ -640,7 +639,7 @@
iterable_or_value: Iterable[_SupportsLessThanT],
*,
key: None = None,
- default: _U
+ default: _U,
) -> Union[_U, Tuple[_SupportsLessThanT, _SupportsLessThanT]]: ...
@overload
def minmax(
@@ -653,16 +652,23 @@
def minmax(
iterable_or_value: _SupportsLessThanT,
__other: _SupportsLessThanT,
- *others: _SupportsLessThanT
+ *others: _SupportsLessThanT,
) -> Tuple[_SupportsLessThanT, _SupportsLessThanT]: ...
@overload
def minmax(
iterable_or_value: _T,
__other: _T,
*others: _T,
- key: Callable[[_T], _SupportsLessThan]
+ key: Callable[[_T], _SupportsLessThan],
) -> Tuple[_T, _T]: ...
def longest_common_prefix(
iterables: Iterable[Iterable[_T]],
) -> Iterator[_T]: ...
def iequals(*iterables: Iterable[object]) -> bool: ...
+def constrained_batches(
+ iterable: Iterable[object],
+ max_size: int,
+ max_count: Optional[int] = ...,
+ get_len: Callable[[_T], object] = ...,
+ strict: bool = ...,
+) -> Iterator[Tuple[_T]]: ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/more_itertools/recipes.py new/more-itertools-9.0.0/more_itertools/recipes.py
--- old/more-itertools-8.14.0/more_itertools/recipes.py 2022-08-09 15:43:59.884092800 +0200
+++ new/more-itertools-9.0.0/more_itertools/recipes.py 2022-10-18 15:38:19.073834700 +0200
@@ -7,14 +7,16 @@
.. [1] http://docs.python.org/library/itertools.html#recipes
"""
+import math
import operator
-import warnings
from collections import deque
from collections.abc import Sized
+from functools import reduce
from itertools import (
chain,
combinations,
+ compress,
count,
cycle,
groupby,
@@ -28,6 +30,7 @@
__all__ = [
'all_equal',
+ 'batched',
'before_and_after',
'consume',
'convolve',
@@ -43,6 +46,7 @@
'pad_none',
'pairwise',
'partition',
+ 'polynomial_from_roots',
'powerset',
'prepend',
'quantify',
@@ -52,6 +56,7 @@
'random_product',
'repeatfunc',
'roundrobin',
+ 'sieve',
'sliding_window',
'subslices',
'tabulate',
@@ -364,11 +369,6 @@
UnequalIterablesError
"""
- if isinstance(iterable, int):
- warnings.warn(
- "grouper expects iterable as first parameter", DeprecationWarning
- )
- n, iterable = iterable, n
args = [iter(iterable)] * n
if incomplete == 'fill':
return zip_longest(*args, fillvalue=fillvalue)
@@ -738,11 +738,12 @@
transition.append(elem)
return
- def remainder_iterator():
- yield from transition
- yield from it
+ # Note: this is different from itertools recipes to allow nesting
+ # before_and_after remainders into before_and_after again. See tests
+ # for an example.
+ remainder_iterator = chain(transition, it)
- return true_iterator(), remainder_iterator()
+ return true_iterator(), remainder_iterator
def triplewise(iterable):
@@ -790,3 +791,51 @@
seq = list(iterable)
slices = starmap(slice, combinations(range(len(seq) + 1), 2))
return map(operator.getitem, repeat(seq), slices)
+
+
+def polynomial_from_roots(roots):
+ """Compute a polynomial's coefficients from its roots.
+
+ >>> roots = [5, -4, 3] # (x - 5) * (x + 4) * (x - 3)
+ >>> polynomial_from_roots(roots) # x^3 - 4 * x^2 - 17 * x + 60
+ [1, -4, -17, 60]
+ """
+ # Use math.prod for Python 3.8+,
+ prod = getattr(math, 'prod', lambda x: reduce(operator.mul, x, 1))
+ roots = list(map(operator.neg, roots))
+ return [
+ sum(map(prod, combinations(roots, k))) for k in range(len(roots) + 1)
+ ]
+
+
+def sieve(n):
+ """Yield the primes less than n.
+
+ >>> list(sieve(30))
+ [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
+ """
+ isqrt = getattr(math, 'isqrt', lambda x: int(math.sqrt(x)))
+ limit = isqrt(n) + 1
+ data = bytearray([1]) * n
+ data[:2] = 0, 0
+ for p in compress(range(limit), data):
+ data[p + p : n : p] = bytearray(len(range(p + p, n, p)))
+
+ return compress(count(), data)
+
+
+def batched(iterable, n):
+ """Batch data into lists of length *n*. The last batch may be shorter.
+
+ >>> list(batched('ABCDEFG', 3))
+ [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']]
+
+ This recipe is from the ``itertools`` docs. This library also provides
+ :func:`chunked`, which has a different implementation.
+ """
+ it = iter(iterable)
+ while True:
+ batch = list(islice(it, n))
+ if not batch:
+ break
+ yield batch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/more_itertools/recipes.pyi new/more-itertools-9.0.0/more_itertools/recipes.pyi
--- old/more-itertools-8.14.0/more_itertools/recipes.pyi 2022-04-29 16:09:30.648787500 +0200
+++ new/more-itertools-9.0.0/more_itertools/recipes.pyi 2022-10-18 15:38:19.073834700 +0200
@@ -6,6 +6,7 @@
Iterator,
List,
Optional,
+ Sequence,
Tuple,
TypeVar,
Union,
@@ -39,20 +40,12 @@
func: Callable[..., _U], times: Optional[int] = ..., *args: Any
) -> Iterator[_U]: ...
def pairwise(iterable: Iterable[_T]) -> Iterator[Tuple[_T, _T]]: ...
-@overload
def grouper(
iterable: Iterable[_T],
n: int,
incomplete: str = ...,
fillvalue: _U = ...,
) -> Iterator[Tuple[Union[_T, _U], ...]]: ...
-@overload
-def grouper( # Deprecated interface
- iterable: int,
- n: Iterable[_T],
- incomplete: str = ...,
- fillvalue: _U = ...,
-) -> Iterator[Tuple[Union[_T, _U], ...]]: ...
def roundrobin(*iterables: Iterable[_T]) -> Iterator[_T]: ...
def partition(
pred: Optional[Callable[[_T], object]], iterable: Iterable[_T]
@@ -109,3 +102,9 @@
iterable: Iterable[_T], n: int
) -> Iterator[Tuple[_T, ...]]: ...
def subslices(iterable: Iterable[_T]) -> Iterator[List[_T]]: ...
+def polynomial_from_roots(roots: Sequence[int]) -> List[int]: ...
+def sieve(n: int) -> Iterator[int]: ...
+def batched(
+ iterable: Iterable[_T],
+ n: int,
+) -> Iterator[List[_T]]: ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/pyproject.toml new/more-itertools-9.0.0/pyproject.toml
--- old/more-itertools-8.14.0/pyproject.toml 2022-08-09 15:43:59.886106300 +0200
+++ new/more-itertools-9.0.0/pyproject.toml 2022-10-18 15:38:19.073834700 +0200
@@ -6,7 +6,7 @@
name = "more-itertools"
authors = [{name = "Erik Rose", email = "erikrose(a)grinchcentral.com"}]
readme = "README.rst"
-requires-python = ">=3.5"
+requires-python = ">=3.7"
license = {file = "LICENSE"}
keywords = [
"itertools",
@@ -15,7 +15,6 @@
"filter",
"peek",
"peekable",
- "collate",
"chunk",
"chunked",
]
@@ -25,11 +24,11 @@
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
@@ -45,5 +44,5 @@
[tool.black]
line-length = 79
-target-version = ['py35']
+target-version = ['py37']
skip-string-normalization = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/setup.cfg new/more-itertools-9.0.0/setup.cfg
--- old/more-itertools-8.14.0/setup.cfg 2022-08-09 15:53:46.644978300 +0200
+++ new/more-itertools-9.0.0/setup.cfg 2022-10-18 15:38:19.073834700 +0200
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 8.14.0
+current_version = 9.0.0
commit = True
tag = False
files = more_itertools/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/tests/test_more.py new/more-itertools-9.0.0/tests/test_more.py
--- old/more-itertools-8.14.0/tests/test_more.py 2022-08-09 15:43:59.889434000 +0200
+++ new/more-itertools-9.0.0/tests/test_more.py 2022-10-18 15:38:19.073834700 +0200
@@ -7,7 +7,6 @@
from doctest import DocTestSuite
from fractions import Fraction
from functools import partial, reduce
-from heapq import merge
from io import StringIO
from itertools import (
accumulate,
@@ -41,51 +40,6 @@
return tests
-class CollateTests(TestCase):
- """Unit tests for ``collate()``"""
-
- # Also accidentally tests peekable, though that could use its own tests
-
- def test_default(self):
- """Test with the default `key` function."""
- iterables = [range(4), range(7), range(3, 6)]
- self.assertEqual(
- sorted(reduce(list.__add__, [list(it) for it in iterables])),
- list(mi.collate(*iterables)),
- )
-
- def test_key(self):
- """Test using a custom `key` function."""
- iterables = [range(5, 0, -1), range(4, 0, -1)]
- actual = sorted(
- reduce(list.__add__, [list(it) for it in iterables]), reverse=True
- )
- expected = list(mi.collate(*iterables, key=lambda x: -x))
- self.assertEqual(actual, expected)
-
- def test_empty(self):
- """Be nice if passed an empty list of iterables."""
- self.assertEqual([], list(mi.collate()))
-
- def test_one(self):
- """Work when only 1 iterable is passed."""
- self.assertEqual([0, 1], list(mi.collate(range(2))))
-
- def test_reverse(self):
- """Test the `reverse` kwarg."""
- iterables = [range(4, 0, -1), range(7, 0, -1), range(3, 6, -1)]
-
- actual = sorted(
- reduce(list.__add__, [list(it) for it in iterables]), reverse=True
- )
- expected = list(mi.collate(*iterables, reverse=True))
- self.assertEqual(actual, expected)
-
- def test_alias(self):
- self.assertNotEqual(merge.__doc__, mi.collate.__doc__)
- self.assertNotEqual(partial.__doc__, mi.collate.__doc__)
-
-
class ChunkedTests(TestCase):
"""Tests for ``chunked()``"""
@@ -289,11 +243,6 @@
class PeekableTests(PeekableMixinTests, TestCase):
- """Tests for ``peekable()`` behavior not incidentally covered by testing
- ``collate()``
-
- """
-
cls = mi.peekable
def test_indexing(self):
@@ -783,64 +732,55 @@
class WindowedTests(TestCase):
- """Tests for ``windowed()``"""
-
def test_basic(self):
- actual = list(mi.windowed([1, 2, 3, 4, 5], 3))
- expected = [(1, 2, 3), (2, 3, 4), (3, 4, 5)]
- self.assertEqual(actual, expected)
-
- def test_large_size(self):
- """
- When the window size is larger than the iterable, and no fill value is
- given,``None`` should be filled in.
- """
- actual = list(mi.windowed([1, 2, 3, 4, 5], 6))
- expected = [(1, 2, 3, 4, 5, None)]
- self.assertEqual(actual, expected)
-
- def test_fillvalue(self):
- """
- When sizes don't match evenly, the given fill value should be used.
- """
iterable = [1, 2, 3, 4, 5]
- for n, kwargs, expected in [
- (6, {}, [(1, 2, 3, 4, 5, '!')]), # n > len(iterable)
- (3, {'step': 3}, [(1, 2, 3), (4, 5, '!')]), # using ``step``
- ]:
- actual = list(mi.windowed(iterable, n, fillvalue='!', **kwargs))
- self.assertEqual(actual, expected)
+ for n, expected in (
+ (6, [(1, 2, 3, 4, 5, None)]),
+ (5, [(1, 2, 3, 4, 5)]),
+ (4, [(1, 2, 3, 4), (2, 3, 4, 5)]),
+ (3, [(1, 2, 3), (2, 3, 4), (3, 4, 5)]),
+ (2, [(1, 2), (2, 3), (3, 4), (4, 5)]),
+ (1, [(1,), (2,), (3,), (4,), (5,)]),
+ (0, [()]),
+ ):
+ with self.subTest(n=n):
+ actual = list(mi.windowed(iterable, n))
+ self.assertEqual(actual, expected)
- def test_zero(self):
- """When the window size is zero, an empty tuple should be emitted."""
- actual = list(mi.windowed([1, 2, 3, 4, 5], 0))
- expected = [tuple()]
+ def test_fillvalue(self):
+ actual = list(mi.windowed([1, 2, 3, 4, 5], 6, fillvalue='!'))
+ expected = [(1, 2, 3, 4, 5, '!')]
self.assertEqual(actual, expected)
- def test_negative(self):
- """When the window size is negative, ValueError should be raised."""
- with self.assertRaises(ValueError):
- list(mi.windowed([1, 2, 3, 4, 5], -1))
-
def test_step(self):
- """The window should advance by the number of steps provided"""
iterable = [1, 2, 3, 4, 5, 6, 7]
for n, step, expected in [
(3, 2, [(1, 2, 3), (3, 4, 5), (5, 6, 7)]), # n > step
(3, 3, [(1, 2, 3), (4, 5, 6), (7, None, None)]), # n == step
- (3, 4, [(1, 2, 3), (5, 6, 7)]), # line up nicely
+ (3, 4, [(1, 2, 3), (5, 6, 7)]), # lines up nicely
(3, 5, [(1, 2, 3), (6, 7, None)]), # off by one
(3, 6, [(1, 2, 3), (7, None, None)]), # off by two
(3, 7, [(1, 2, 3)]), # step past the end
(7, 8, [(1, 2, 3, 4, 5, 6, 7)]), # step > len(iterable)
]:
- actual = list(mi.windowed(iterable, n, step=step))
- self.assertEqual(actual, expected)
+ with self.subTest(n=n, step=step):
+ actual = list(mi.windowed(iterable, n, step=step))
+ self.assertEqual(actual, expected)
+ def test_invalid_step(self):
# Step must be greater than or equal to 1
with self.assertRaises(ValueError):
- list(mi.windowed(iterable, 3, step=0))
+ list(mi.windowed([1, 2, 3, 4, 5], 3, step=0))
+
+ def test_fillvalue_step(self):
+ actual = list(mi.windowed([1, 2, 3, 4, 5], 3, fillvalue='!', step=3))
+ expected = [(1, 2, 3), (4, 5, '!')]
+ self.assertEqual(actual, expected)
+
+ def test_negative(self):
+ with self.assertRaises(ValueError):
+ list(mi.windowed([1, 2, 3, 4, 5], -1))
class SubstringsTests(TestCase):
@@ -5137,3 +5077,100 @@
def test_not_identical_but_equal(self):
self.assertTrue([1, True], [1.0, complex(1, 0)])
+
+
+class ConstrainedBatchesTests(TestCase):
+ def test_basic(self):
+ zen = [
+ 'Beautiful is better than ugly',
+ 'Explicit is better than implicit',
+ 'Simple is better than complex',
+ 'Complex is better than complicated',
+ 'Flat is better than nested',
+ 'Sparse is better than dense',
+ 'Readability counts',
+ ]
+ for size, expected in (
+ (
+ 34,
+ [
+ (zen[0],),
+ (zen[1],),
+ (zen[2],),
+ (zen[3],),
+ (zen[4],),
+ (zen[5],),
+ (zen[6],),
+ ],
+ ),
+ (
+ 61,
+ [
+ (zen[0], zen[1]),
+ (zen[2],),
+ (zen[3], zen[4]),
+ (zen[5], zen[6]),
+ ],
+ ),
+ (
+ 90,
+ [
+ (zen[0], zen[1], zen[2]),
+ (zen[3], zen[4], zen[5]),
+ (zen[6],),
+ ],
+ ),
+ (
+ 124,
+ [(zen[0], zen[1], zen[2], zen[3]), (zen[4], zen[5], zen[6])],
+ ),
+ (
+ 150,
+ [(zen[0], zen[1], zen[2], zen[3], zen[4]), (zen[5], zen[6])],
+ ),
+ (
+ 177,
+ [(zen[0], zen[1], zen[2], zen[3], zen[4], zen[5]), (zen[6],)],
+ ),
+ ):
+ with self.subTest(size=size):
+ actual = list(mi.constrained_batches(iter(zen), size))
+ self.assertEqual(actual, expected)
+
+ def test_max_count(self):
+ iterable = ['1', '1', '12345678', '12345', '12345']
+ max_size = 10
+ max_count = 2
+ actual = list(mi.constrained_batches(iterable, max_size, max_count))
+ expected = [('1', '1'), ('12345678',), ('12345', '12345')]
+ self.assertEqual(actual, expected)
+
+ def test_strict(self):
+ iterable = ['1', '123456789', '1']
+ size = 8
+ with self.assertRaises(ValueError):
+ list(mi.constrained_batches(iterable, size))
+
+ actual = list(mi.constrained_batches(iterable, size, strict=False))
+ expected = [('1',), ('123456789',), ('1',)]
+ self.assertEqual(actual, expected)
+
+ def test_get_len(self):
+ class Record(tuple):
+ def total_size(self):
+ return sum(len(x) for x in self)
+
+ record_3 = Record(('1', '23'))
+ record_5 = Record(('1234', '1'))
+ record_10 = Record(('1', '12345678', '1'))
+ record_2 = Record(('1', '1'))
+ iterable = [record_3, record_5, record_10, record_2]
+
+ self.assertEqual(
+ list(
+ mi.constrained_batches(
+ iterable, 10, get_len=lambda x: x.total_size()
+ )
+ ),
+ [(record_3, record_5), (record_10,), (record_2,)],
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/more-itertools-8.14.0/tests/test_recipes.py new/more-itertools-9.0.0/tests/test_recipes.py
--- old/more-itertools-8.14.0/tests/test_recipes.py 2022-08-09 15:43:59.891580000 +0200
+++ new/more-itertools-9.0.0/tests/test_recipes.py 2022-10-18 15:38:19.073834700 +0200
@@ -1,6 +1,5 @@
-import warnings
-
from doctest import DocTestSuite
+from functools import reduce
from itertools import combinations, count, permutations
from math import factorial
from unittest import TestCase
@@ -335,16 +334,6 @@
with self.assertRaises(ValueError):
list(mi.grouper(iter(seq), n, incomplete='strict'))
- def test_legacy_order(self):
- with warnings.catch_warnings(record=True) as caught:
- warnings.simplefilter('always')
- self.assertEqual(
- list(mi.grouper(3, 'ABCDEF')),
- [('A', 'B', 'C'), ('D', 'E', 'F')],
- )
-
- self.assertEqual(caught[0].category, DeprecationWarning)
-
def test_invalid_incomplete(self):
with self.assertRaises(ValueError):
list(mi.grouper('ABCD', 3, incomplete='bogus'))
@@ -783,6 +772,39 @@
self.assertEqual(list(before), [1, True])
self.assertEqual(list(after), [0, False])
+ @staticmethod
+ def _group_events(events):
+ events = iter(events)
+
+ while True:
+ try:
+ operation = next(events)
+ except StopIteration:
+ break
+ assert operation in ["SUM", "MULTIPLY"]
+
+ # Here, the remainder `events` is passed into `before_and_after`
+ # again, which would be problematic if the remainder is a
+ # generator function (as in Python 3.10 itertools recipes), since
+ # that creates recursion. `itertools.chain` solves this problem.
+ numbers, events = mi.before_and_after(
+ lambda e: isinstance(e, int), events
+ )
+
+ yield (operation, numbers)
+
+ def test_nested_remainder(self):
+ events = ["SUM", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] * 1000
+ events += ["MULTIPLY", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] * 1000
+
+ for operation, numbers in self._group_events(events):
+ if operation == "SUM":
+ res = sum(numbers)
+ self.assertEqual(res, 55)
+ elif operation == "MULTIPLY":
+ res = reduce(lambda a, b: a * b, numbers)
+ self.assertEqual(res, 3628800)
+
class TriplewiseTests(TestCase):
def test_basic(self):
@@ -843,3 +865,80 @@
with self.subTest(expected=expected):
actual = list(mi.subslices(iterable))
self.assertEqual(actual, expected)
+
+
+class PolynomialFromRootsTests(TestCase):
+ def test_basic(self):
+ for roots, expected in [
+ ((2, 1, -1), [1, -2, -1, 2]),
+ ((2, 3), [1, -5, 6]),
+ ((1, 2, 3), [1, -6, 11, -6]),
+ ((2, 4, 1), [1, -7, 14, -8]),
+ ]:
+ with self.subTest(roots=roots):
+ actual = mi.polynomial_from_roots(roots)
+ self.assertEqual(actual, expected)
+
+
+class SieveTests(TestCase):
+ def test_basic(self):
+ self.assertEqual(
+ list(mi.sieve(67)),
+ [
+ 2,
+ 3,
+ 5,
+ 7,
+ 11,
+ 13,
+ 17,
+ 19,
+ 23,
+ 29,
+ 31,
+ 37,
+ 41,
+ 43,
+ 47,
+ 53,
+ 59,
+ 61,
+ ],
+ )
+ self.assertEqual(list(mi.sieve(68))[-1], 67)
+
+ def test_prime_counts(self):
+ for n, expected in (
+ (100, 25),
+ (1_000, 168),
+ (10_000, 1229),
+ (100_000, 9592),
+ (1_000_000, 78498),
+ ):
+ with self.subTest(n=n):
+ self.assertEqual(mi.ilen(mi.sieve(n)), expected)
+
+ def test_small_numbers(self):
+ with self.assertRaises(ValueError):
+ list(mi.sieve(-1))
+
+ for n in (0, 1, 2):
+ with self.subTest(n=n):
+ self.assertEqual(list(mi.sieve(n)), [])
+
+
+class BatchedTests(TestCase):
+ def test_basic(self):
+ iterable = range(1, 5 + 1)
+ for n, expected in (
+ (0, []),
+ (1, [[1], [2], [3], [4], [5]]),
+ (2, [[1, 2], [3, 4], [5]]),
+ (3, [[1, 2, 3], [4, 5]]),
+ (4, [[1, 2, 3, 4], [5]]),
+ (5, [[1, 2, 3, 4, 5]]),
+ (6, [[1, 2, 3, 4, 5]]),
+ ):
+ with self.subTest(n=n):
+ actual = list(mi.batched(iterable, n))
+ self.assertEqual(actual, expected)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pyftpdlib for openSUSE:Factory checked in at 2022-11-01 13:41:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyftpdlib (Old)
and /work/SRC/openSUSE:Factory/.python-pyftpdlib.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyftpdlib"
Tue Nov 1 13:41:08 2022 rev:18 rq:1032495 version:1.5.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyftpdlib/python-pyftpdlib.changes 2022-01-21 01:25:31.482544192 +0100
+++ /work/SRC/openSUSE:Factory/.python-pyftpdlib.new.2275/python-pyftpdlib.changes 2022-11-01 13:41:18.079491701 +0100
@@ -1,0 +2,15 @@
+Fri Oct 28 20:09:29 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to Version: 1.5.7 - 2022-10-04
+ Enhancements
+ * #544: replace Travis with Github Actions for CI testing.
+ Bug fixes
+ * #481: fix [WinError 10038] an operation was attempted on something that is not a socket. (patch by Tailing Yuan)
+ * #578, [critical]: FTPS broke with PyOpenSSL version 22.1.0.
+
+- Update to Version: 1.5.6 - 2020-02-16
+ Enhancements
+ * #467: added pre-fork concurrency model, spawn()ing worker processes to split load.
+ * #520: directory LISTing is now 3.7x times faster.
+
+-------------------------------------------------------------------
Old:
----
pyftpdlib-1.5.6.tar.gz
New:
----
pyftpdlib-1.5.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyftpdlib.spec ++++++
--- /var/tmp/diff_new_pack.FEAaXR/_old 2022-11-01 13:41:18.935496255 +0100
+++ /var/tmp/diff_new_pack.FEAaXR/_new 2022-11-01 13:41:18.939496277 +0100
@@ -20,7 +20,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-pyftpdlib
-Version: 1.5.6
+Version: 1.5.7
Release: 0
Summary: Asynchronous FTP server library for Python
License: MIT
++++++ pyftpdlib-1.5.6.tar.gz -> pyftpdlib-1.5.7.tar.gz ++++++
++++ 6730 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-trove-classifiers for openSUSE:Factory checked in at 2022-11-01 13:41:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-trove-classifiers (Old)
and /work/SRC/openSUSE:Factory/.python-trove-classifiers.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-trove-classifiers"
Tue Nov 1 13:41:06 2022 rev:3 rq:1032488 version:2022.10.19
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-trove-classifiers/python-trove-classifiers.changes 2022-10-12 18:22:33.805345473 +0200
+++ /work/SRC/openSUSE:Factory/.python-trove-classifiers.new.2275/python-trove-classifiers.changes 2022-11-01 13:41:16.391482722 +0100
@@ -1,0 +2,6 @@
+Sat Oct 29 16:19:27 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to v2022.10.19
+ * add cuda 11.8
+
+-------------------------------------------------------------------
Old:
----
trove-classifiers-2022.8.31.tar.gz
New:
----
trove-classifiers-2022.10.19.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-trove-classifiers.spec ++++++
--- /var/tmp/diff_new_pack.7NdOG4/_old 2022-11-01 13:41:17.355487850 +0100
+++ /var/tmp/diff_new_pack.7NdOG4/_new 2022-11-01 13:41:17.363487892 +0100
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-trove-classifiers
-Version: 2022.8.31
+Version: 2022.10.19
Release: 0
Summary: Canonical source for classifiers on PyPI
License: Apache-2.0
++++++ trove-classifiers-2022.8.31.tar.gz -> trove-classifiers-2022.10.19.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trove-classifiers-2022.8.31/PKG-INFO new/trove-classifiers-2022.10.19/PKG-INFO
--- old/trove-classifiers-2022.8.31/PKG-INFO 2022-08-31 16:27:08.303623200 +0200
+++ new/trove-classifiers-2022.10.19/PKG-INFO 2022-10-19 04:10:25.216735600 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: trove-classifiers
-Version: 2022.8.31
+Version: 2022.10.19
Summary: Canonical source for classifiers on PyPI (pypi.org).
Home-page: https://github.com/pypa/trove-classifiers
Author: The PyPI Admins
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trove-classifiers-2022.8.31/src/trove_classifiers/__init__.py new/trove-classifiers-2022.10.19/src/trove_classifiers/__init__.py
--- old/trove-classifiers-2022.8.31/src/trove_classifiers/__init__.py 2022-08-31 16:26:24.000000000 +0200
+++ new/trove-classifiers-2022.10.19/src/trove_classifiers/__init__.py 2022-10-19 04:09:49.000000000 +0200
@@ -49,6 +49,7 @@
"Environment :: GPU :: NVIDIA CUDA :: 11.5",
"Environment :: GPU :: NVIDIA CUDA :: 11.6",
"Environment :: GPU :: NVIDIA CUDA :: 11.7",
+ "Environment :: GPU :: NVIDIA CUDA :: 11.8",
"Environment :: Handhelds/PDA's",
"Environment :: MacOS X",
"Environment :: MacOS X :: Aqua",
@@ -154,6 +155,7 @@
"Framework :: Odoo :: 13.0",
"Framework :: Odoo :: 14.0",
"Framework :: Odoo :: 15.0",
+ "Framework :: Odoo :: 16.0",
"Framework :: Opps",
"Framework :: Paste",
"Framework :: Pelican",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trove-classifiers-2022.8.31/src/trove_classifiers.egg-info/PKG-INFO new/trove-classifiers-2022.10.19/src/trove_classifiers.egg-info/PKG-INFO
--- old/trove-classifiers-2022.8.31/src/trove_classifiers.egg-info/PKG-INFO 2022-08-31 16:27:08.000000000 +0200
+++ new/trove-classifiers-2022.10.19/src/trove_classifiers.egg-info/PKG-INFO 2022-10-19 04:10:25.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: trove-classifiers
-Version: 2022.8.31
+Version: 2022.10.19
Summary: Canonical source for classifiers on PyPI (pypi.org).
Home-page: https://github.com/pypa/trove-classifiers
Author: The PyPI Admins
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-xxhash for openSUSE:Factory checked in at 2022-11-01 13:41:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xxhash (Old)
and /work/SRC/openSUSE:Factory/.python-xxhash.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xxhash"
Tue Nov 1 13:41:05 2022 rev:11 rq:1032486 version:3.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xxhash/python-xxhash.changes 2022-09-20 19:23:22.066436889 +0200
+++ /work/SRC/openSUSE:Factory/.python-xxhash.new.2275/python-xxhash.changes 2022-11-01 13:41:14.695473699 +0100
@@ -1,0 +2,7 @@
+Sat Oct 29 18:00:38 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam(a)suse.com>
+
+- Update to 3.1.0
+ * Type annotations.
+ * Enabled muslinux wheels building.
+
+-------------------------------------------------------------------
Old:
----
xxhash-3.0.0.tar.gz
New:
----
xxhash-3.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-xxhash.spec ++++++
--- /var/tmp/diff_new_pack.03S2Ur/_old 2022-11-01 13:41:15.335477103 +0100
+++ /var/tmp/diff_new_pack.03S2Ur/_new 2022-11-01 13:41:15.343477147 +0100
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-xxhash
-Version: 3.0.0
+Version: 3.1.0
Release: 0
Summary: Python binding for xxHash
License: BSD-2-Clause
++++++ xxhash-3.0.0.tar.gz -> xxhash-3.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/CHANGELOG.rst new/xxhash-3.1.0/CHANGELOG.rst
--- old/xxhash-3.0.0/CHANGELOG.rst 2022-02-24 17:17:53.000000000 +0100
+++ new/xxhash-3.1.0/CHANGELOG.rst 2022-10-19 07:34:54.000000000 +0200
@@ -1,6 +1,12 @@
CHANGELOG
-----------
+v3.1.0 2022-10-19
+~~~~~~~~~~~~~~~~~
+
+- Type annotations.
+- Enabled muslinux wheels building.
+
v3.0.0 2022-02-25
~~~~~~~~~~~~~~~~~
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/PKG-INFO new/xxhash-3.1.0/PKG-INFO
--- old/xxhash-3.0.0/PKG-INFO 2022-02-24 17:18:10.948854700 +0100
+++ new/xxhash-3.1.0/PKG-INFO 2022-10-19 07:35:04.883356600 +0200
@@ -1,12 +1,11 @@
Metadata-Version: 2.1
Name: xxhash
-Version: 3.0.0
+Version: 3.1.0
Summary: Python binding for xxHash
Home-page: https://github.com/ifduyue/python-xxhash
Author: Yue Du
Author-email: ifduyue(a)gmail.com
License: BSD
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Developers
@@ -304,6 +303,12 @@
CHANGELOG
-----------
+v3.1.0 2022-10-19
+~~~~~~~~~~~~~~~~~
+
+- Type annotations.
+- Enabled muslinux wheels building.
+
v3.0.0 2022-02-25
~~~~~~~~~~~~~~~~~
@@ -477,5 +482,3 @@
~~~~~~~~~~~~~~~~~~
- NEW: xxh32 and xxh64
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/pyproject.toml new/xxhash-3.1.0/pyproject.toml
--- old/xxhash-3.0.0/pyproject.toml 2022-02-24 17:17:53.000000000 +0100
+++ new/xxhash-3.1.0/pyproject.toml 2022-10-19 07:34:54.000000000 +0200
@@ -1,9 +1,6 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
-[tool.cibuildwheel]
-skip = "*-musllinux*"
-
[tool.setuptools_scm]
write_to = "xxhash/version.py"
local_scheme = "no-local-version"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/setup.py new/xxhash-3.1.0/setup.py
--- old/xxhash-3.0.0/setup.py 2022-02-24 17:17:53.000000000 +0100
+++ new/xxhash-3.1.0/setup.py 2022-10-19 07:34:54.000000000 +0200
@@ -6,12 +6,6 @@
import codecs
-with open('xxhash/__init__.py') as f:
- for line in f:
- if line.startswith('VERSION = '):
- VERSION = eval(line.rsplit(None, 1)[-1])
- break
-
if os.getenv('XXHASH_LINK_SO'):
libraries = ['xxhash']
source = ['src/_xxhash.c']
@@ -64,4 +58,5 @@
],
python_requires=">=3.6",
ext_modules=ext_modules,
+ package_data={"xxhash": ["py.typed", "**.pyi"]},
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/xxhash/__init__.pyi new/xxhash-3.1.0/xxhash/__init__.pyi
--- old/xxhash-3.0.0/xxhash/__init__.pyi 2022-02-24 17:17:53.000000000 +0100
+++ new/xxhash-3.1.0/xxhash/__init__.pyi 2022-10-19 07:34:54.000000000 +0200
@@ -1,8 +1,15 @@
import array
from typing import Union
+from typing_extensions import final
_InputType = Union[str, bytes, bytearray, memoryview, array.ArrayType[int]]
+VERSION: str
+XXHASH_VERSION: str
+VERSION_TUPLE: tuple[int, ...]
+
+algorithms_available: set[str]
+
class _Hasher:
def __init__(self, input: _InputType = ..., seed: int = ...) -> None: ...
def update(self, input: _InputType) -> None: ...
@@ -22,8 +29,13 @@
@property
def seed(self) -> int: ...
+@final
class xxh32(_Hasher): ...
+
+@final
class xxh3_64(_Hasher): ...
+
+@final
class xxh3_128(_Hasher): ...
xxh64 = xxh3_64
@@ -48,7 +60,3 @@
xxh128_digest = xxh3_128_digest
xxh128_hexdigest = xxh3_128_hexdigest
xxh128_intdigest = xxh3_128_intdigest
-
-VERSION: str = ...
-
-XXHASH_VERSION: str = ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/xxhash/version.py new/xxhash-3.1.0/xxhash/version.py
--- old/xxhash-3.0.0/xxhash/version.py 2022-02-24 17:18:07.000000000 +0100
+++ new/xxhash-3.1.0/xxhash/version.py 2022-10-19 07:35:01.000000000 +0200
@@ -1,2 +1,2 @@
-VERSION = "3.0.0"
-VERSION_TUPLE = (3, 0, 0)
+VERSION = "3.1.0"
+VERSION_TUPLE = (3, 1, 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/xxhash.egg-info/PKG-INFO new/xxhash-3.1.0/xxhash.egg-info/PKG-INFO
--- old/xxhash-3.0.0/xxhash.egg-info/PKG-INFO 2022-02-24 17:18:10.000000000 +0100
+++ new/xxhash-3.1.0/xxhash.egg-info/PKG-INFO 2022-10-19 07:35:04.000000000 +0200
@@ -1,12 +1,11 @@
Metadata-Version: 2.1
Name: xxhash
-Version: 3.0.0
+Version: 3.1.0
Summary: Python binding for xxHash
Home-page: https://github.com/ifduyue/python-xxhash
Author: Yue Du
Author-email: ifduyue(a)gmail.com
License: BSD
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Developers
@@ -304,6 +303,12 @@
CHANGELOG
-----------
+v3.1.0 2022-10-19
+~~~~~~~~~~~~~~~~~
+
+- Type annotations.
+- Enabled muslinux wheels building.
+
v3.0.0 2022-02-25
~~~~~~~~~~~~~~~~~
@@ -477,5 +482,3 @@
~~~~~~~~~~~~~~~~~~
- NEW: xxh32 and xxh64
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xxhash-3.0.0/xxhash.egg-info/SOURCES.txt new/xxhash-3.1.0/xxhash.egg-info/SOURCES.txt
--- old/xxhash-3.0.0/xxhash.egg-info/SOURCES.txt 2022-02-24 17:18:10.000000000 +0100
+++ new/xxhash-3.1.0/xxhash.egg-info/SOURCES.txt 2022-10-19 07:35:04.000000000 +0200
@@ -24,6 +24,7 @@
tests/test_xxh64.py
xxhash/__init__.py
xxhash/__init__.pyi
+xxhash/py.typed
xxhash/version.py
xxhash.egg-info/PKG-INFO
xxhash.egg-info/SOURCES.txt
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package glib2 for openSUSE:Factory checked in at 2022-11-01 13:41:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/glib2 (Old)
and /work/SRC/openSUSE:Factory/.glib2.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "glib2"
Tue Nov 1 13:41:03 2022 rev:258 rq:1032476 version:2.74.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/glib2/glib2.changes 2022-10-13 15:39:35.070420116 +0200
+++ /work/SRC/openSUSE:Factory/.glib2.new.2275/glib2.changes 2022-11-01 13:41:11.331455803 +0100
@@ -1,0 +2,61 @@
+Mon Oct 31 12:18:51 UTC 2022 - Dominique Leuenberger <dimstar(a)opensuse.org>
+
+- Add ca905744.patch: Revert "Handling collision between standard
+ i/o file descriptors and newly created ones". The user-visible
+ problem this solves is gnome-keyring-daemon eating 100% CPU.
+
+-------------------------------------------------------------------
+Wed Oct 26 12:07:15 UTC 2022 - Bj��rn Lie <bjorn.lie(a)gmail.com>
+
+- Update to version 2.74.1:
+ + Update Unicode data to version 15
+ + Fix various build failures in different situations
+ + Fix over-eager deprecated property warnings for construct
+ properties
+ + Fix a crash calling `g_param_value_is_valid()` on a
+ `GParamSpecParam`
+ + Fix floating `GVariant` leaks with GObject properties
+ + Add inline optimised version of `g_str_equal()`
+ + Fix `GVariant` type depths checks on text format variants
+ + Fix regression with int64 and double hashing functions on
+ big-endian architectures
+ + Build the API documentation only when building GLib as a shared
+ library
+ + Ignore weird `/etc/localtime` configurations generated by
+ toolbx
+ + Avoid `EINTR` races when closing FDs in `g_spawn_*()`
+ + Bugs fixed: glgo#GNOME/GLib#16, glgo#GNOME/GLib#333,
+ glgo#GNOME/GLib#2735, glgo#GNOME/GLib#2740,
+ glgo#GNOME/GLib#2742, glgo#GNOME/GLib#2748,
+ glgo#GNOME/GLib#2758, glgo#GNOME/GLib#2759,
+ glgo#GNOME/GLib#2766, glgo#GNOME/GLib#2767,
+ glgo#GNOME/GLib#2770, glgo#GNOME/GLib#2774,
+ glgo#GNOME/GLib#2775, glgo#GNOME/GLib#2782,
+ glgo#GNOME/GLib#2787, glgo#GNOME/GLib#2788,
+ glgo#GNOME/GLib!2852, glgo#GNOME/GLib!2857,
+ glgo#GNOME/GLib!2864, glgo#GNOME/GLib!2866,
+ glgo#GNOME/GLib!2880, glgo#GNOME/GLib!2885,
+ glgo#GNOME/GLib!2892, glgo#GNOME/GLib!2896,
+ glgo#GNOME/GLib!2899, glgo#GNOME/GLib!2901,
+ glgo#GNOME/GLib!2903, glgo#GNOME/GLib!2904,
+ glgo#GNOME/GLib!2905, glgo#GNOME/GLib!2907,
+ glgo#GNOME/GLib!2911, glgo#GNOME/GLib!2913,
+ glgo#GNOME/GLib!2915, glgo#GNOME/GLib!2916,
+ glgo#GNOME/GLib!2920, glgo#GNOME/GLib!2922,
+ glgo#GNOME/GLib!2924, glgo#GNOME/GLib!2928,
+ glgo#GNOME/GLib!2931, glgo#GNOME/GLib!2933,
+ glgo#GNOME/GLib!2938, glgo#GNOME/GLib!2939,
+ glgo#GNOME/GLib!2946, glgo#GNOME/GLib!2948,
+ glgo#GNOME/GLib!2949, glgo#GNOME/GLib!2958,
+ glgo#GNOME/GLib!2960, glgo#GNOME/GLib!2973,
+ glgo#GNOME/GLib!2975, glgo#GNOME/GLib!2982,
+ glgo#GNOME/GLib!2983, glgo#GNOME/GLib!2988,
+ glgo#GNOME/GLib!2989, glgo#GNOME/GLib!2995,
+ glgo#GNOME/GLib!2996, glgo#GNOME/GLib!2998,
+ glgo#GNOME/GLib!3010.
+ + Updated translations.
+- Rebase patches with quilt.
+- Drop f0dd96c28751f15d0703b384bfc7c314af01caa8.diff: Fixed
+ upstream.
+
+-------------------------------------------------------------------
Old:
----
f0dd96c28751f15d0703b384bfc7c314af01caa8.diff
glib-2.74.0.tar.xz
New:
----
ca905744.patch
glib-2.74.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ glib2.spec ++++++
--- /var/tmp/diff_new_pack.OMg3S9/_old 2022-11-01 13:41:12.199460420 +0100
+++ /var/tmp/diff_new_pack.OMg3S9/_new 2022-11-01 13:41:12.203460442 +0100
@@ -30,7 +30,7 @@
%define libgthread libgthread-%{libver}
%bcond_without systemtap
Name: glib2%{psuffix}
-Version: 2.74.0
+Version: 2.74.1
Release: 0
Summary: General-Purpose Utility Library
License: LGPL-2.1-or-later
@@ -58,8 +58,9 @@
Patch3: glib2-dbus-socket-path.patch
# PATCH-FIX-OPENSUSE glib2-gdbus-codegen-version.patch olaf(a)aepfle.de -- Remove version string from files generated by gdbus-codegen
Patch4: glib2-gdbus-codegen-version.patch
-# PATCH-FIX-UPSTREAM f0dd96c28751f15d0703b384bfc7c314af01caa8.diff glgo#GNOME/GLib!2770 Empty values are not valid GParamSpec
-Patch99: f0dd96c28751f15d0703b384bfc7c314af01caa8.diff
+# PATCH-FIX-UPSTREAM ca905744.patch dimstar(a)opensuse.org -- Revert "Handling collision between standard i/o file descriptors and newly created ones"
+Patch5: https://gitlab.gnome.org/GNOME/glib/-/commit/ca905744.patch
+
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
@@ -262,7 +263,7 @@
%patch2 -p1
%patch3 -p1
%patch4 -p1
-%patch99 -p1
+%patch5 -p1
cp -a %{SOURCE1} %{SOURCE2} %{SOURCE5} .
cp -a %{SOURCE4} gnome_defaults.conf
# replace /usr/bin/env shebangs
++++++ ca905744.patch ++++++
From ca905744dffb844663b5bd6b42f33e2d44f9b4cd Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode(a)redhat.com>
Date: Fri, 28 Oct 2022 11:21:04 -0400
Subject: [PATCH] Revert "Handling collision between standard i/o file
descriptors and newly created ones"
g_unix_open_pipe tries to avoid the standard io fd range
when getting pipe fds. This turns out to be a bad idea because
certain buggy programs rely on it using that range.
This reverts commit d9ba6150909818beb05573f54f26232063492c5b
and adds a test to ensure we don't inadvertently do it again later.
Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2795
---
glib/glib-unix.c | 24 ------------------------
glib/tests/unix.c | 29 +++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/glib/glib-unix.c b/glib/glib-unix.c
index 4710c51168..bc152d7663 100644
--- a/glib/glib-unix.c
+++ b/glib/glib-unix.c
@@ -108,17 +108,6 @@ g_unix_open_pipe (int *fds,
ecode = pipe2 (fds, pipe2_flags);
if (ecode == -1 && errno != ENOSYS)
return g_unix_set_error_from_errno (error, errno);
- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */
- else if (fds[0] < 3 || fds[1] < 3)
- {
- int old_fds[2] = { fds[0], fds[1] };
- gboolean result = g_unix_open_pipe (fds, flags, error);
- close (old_fds[0]);
- close (old_fds[1]);
-
- if (!result)
- g_unix_set_error_from_errno (error, errno);
- }
else if (ecode == 0)
return TRUE;
/* Fall through on -ENOSYS, we must be running on an old kernel */
@@ -127,19 +116,6 @@ g_unix_open_pipe (int *fds,
ecode = pipe (fds);
if (ecode == -1)
return g_unix_set_error_from_errno (error, errno);
- /* Don't reassign pipes to stdin, stdout, stderr if closed meanwhile */
- else if (fds[0] < 3 || fds[1] < 3)
- {
- int old_fds[2] = { fds[0], fds[1] };
- gboolean result = g_unix_open_pipe (fds, flags, error);
- close (old_fds[0]);
- close (old_fds[1]);
-
- if (!result)
- g_unix_set_error_from_errno (error, errno);
-
- return result;
- }
if (flags == 0)
return TRUE;
diff --git a/glib/tests/unix.c b/glib/tests/unix.c
index 2112cab6bf..5dde2b52cc 100644
--- a/glib/tests/unix.c
+++ b/glib/tests/unix.c
@@ -26,6 +26,7 @@
#include "glib-unix.h"
#include <string.h>
#include <pwd.h>
+#include <unistd.h>
static void
test_pipe (void)
@@ -52,6 +53,33 @@ test_pipe (void)
g_assert (g_str_has_prefix (buf, "hello"));
}
+static void
+test_pipe_stdio_overwrite (void)
+{
+ GError *error = NULL;
+ int pipefd[2], ret;
+ gboolean res;
+ int stderr_fd;
+
+ stderr_fd = dup (STDERR_FILENO);
+ g_assert_cmpint (stderr_fd, >, 0);
+ close (STDERR_FILENO);
+
+ res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
+ g_assert (res);
+ g_assert_no_error (error);
+
+ g_assert_cmpint (pipefd[0], ==, STDERR_FILENO);
+
+ close (pipefd[0]);
+ close (pipefd[1]);
+
+ ret = dup2 (stderr_fd, STDERR_FILENO);
+ g_assert_cmpint (ret, >=, 0);
+
+ close (stderr_fd);
+}
+
static void
test_error (void)
{
@@ -337,6 +365,7 @@ main (int argc,
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/glib-unix/pipe", test_pipe);
+ g_test_add_func ("/glib-unix/pipe-stdio-overwrite", test_pipe_stdio_overwrite);
g_test_add_func ("/glib-unix/error", test_error);
g_test_add_func ("/glib-unix/nonblocking", test_nonblocking);
g_test_add_func ("/glib-unix/sighup", test_sighup);
--
GitLab
++++++ glib-2.74.0.tar.xz -> glib-2.74.1.tar.xz ++++++
++++ 130137 lines of diff (skipped)
++++++ glib2-bgo569829-gettext-gkeyfile.patch ++++++
--- /var/tmp/diff_new_pack.OMg3S9/_old 2022-11-01 13:41:13.807468975 +0100
+++ /var/tmp/diff_new_pack.OMg3S9/_new 2022-11-01 13:41:13.811468997 +0100
@@ -1,8 +1,8 @@
-Index: glib-2.71.0/glib/gkeyfile.c
+Index: glib-2.74.1/glib/gkeyfile.c
===================================================================
---- glib-2.71.0.orig/glib/gkeyfile.c
-+++ glib-2.71.0/glib/gkeyfile.c
-@@ -513,6 +513,7 @@ struct _GKeyFile
+--- glib-2.74.1.orig/glib/gkeyfile.c
++++ glib-2.74.1/glib/gkeyfile.c
+@@ -515,6 +515,7 @@ struct _GKeyFile
gboolean checked_locales; /* TRUE if @locales has been initialised */
gchar **locales; /* (nullable) */
@@ -10,7 +10,7 @@
gint ref_count; /* (atomic) */
};
-@@ -639,6 +640,7 @@ g_key_file_init (GKeyFile *key_file)
+@@ -641,6 +642,7 @@ g_key_file_init (GKeyFile *key_file)
key_file->parse_buffer = NULL;
key_file->list_separator = ';';
key_file->flags = 0;
@@ -18,7 +18,7 @@
}
static void
-@@ -659,6 +661,12 @@ g_key_file_clear (GKeyFile *key_file)
+@@ -661,6 +663,12 @@ g_key_file_clear (GKeyFile *key_file)
key_file->parse_buffer = NULL;
}
@@ -31,7 +31,7 @@
tmp = key_file->groups;
while (tmp != NULL)
{
-@@ -879,6 +887,11 @@ g_key_file_load_from_fd (GKeyFile
+@@ -881,6 +889,11 @@ g_key_file_load_from_fd (GKeyFile
return FALSE;
}
@@ -43,7 +43,7 @@
return TRUE;
}
-@@ -991,6 +1004,11 @@ g_key_file_load_from_data (GKeyFile
+@@ -993,6 +1006,11 @@ g_key_file_load_from_data (GKeyFile
return FALSE;
}
@@ -55,7 +55,7 @@
return TRUE;
}
-@@ -2240,6 +2258,8 @@ g_key_file_get_locale_string (GKeyFile
+@@ -2242,6 +2260,8 @@ g_key_file_get_locale_string (GKeyFile
GError *key_file_error;
gchar **languages;
gboolean free_languages = FALSE;
@@ -64,7 +64,7 @@
gint i;
g_return_val_if_fail (key_file != NULL, NULL);
-@@ -2261,6 +2281,23 @@ g_key_file_get_locale_string (GKeyFile
+@@ -2263,6 +2283,23 @@ g_key_file_get_locale_string (GKeyFile
free_languages = FALSE;
}
@@ -88,7 +88,7 @@
for (i = 0; languages[i]; i++)
{
candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
-@@ -2274,6 +2311,39 @@ g_key_file_get_locale_string (GKeyFile
+@@ -2276,6 +2313,39 @@ g_key_file_get_locale_string (GKeyFile
break;
}
@@ -128,11 +128,11 @@
/* Fallback to untranslated key
*/
if (!translated_value)
-Index: glib-2.71.0/glib/gkeyfile.h
+Index: glib-2.74.1/glib/gkeyfile.h
===================================================================
---- glib-2.71.0.orig/glib/gkeyfile.h
-+++ glib-2.71.0/glib/gkeyfile.h
-@@ -320,6 +320,7 @@ gboolean g_key_file_remove_group
+--- glib-2.74.1.orig/glib/gkeyfile.h
++++ glib-2.74.1/glib/gkeyfile.h
+@@ -322,6 +322,7 @@ gboolean g_key_file_remove_group
#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"
++++++ glib2-suppress-schema-deprecated-path-warning.patch ++++++
--- /var/tmp/diff_new_pack.OMg3S9/_old 2022-11-01 13:41:13.835469124 +0100
+++ /var/tmp/diff_new_pack.OMg3S9/_new 2022-11-01 13:41:13.839469145 +0100
@@ -1,8 +1,8 @@
-Index: glib-2.70.0/gio/glib-compile-schemas.c
+Index: glib-2.74.1/gio/glib-compile-schemas.c
===================================================================
---- glib-2.70.0.orig/gio/glib-compile-schemas.c
-+++ glib-2.70.0/gio/glib-compile-schemas.c
-@@ -1232,6 +1232,7 @@ parse_state_start_schema (ParseState *s
+--- glib-2.74.1.orig/gio/glib-compile-schemas.c
++++ glib-2.74.1/gio/glib-compile-schemas.c
+@@ -1234,6 +1234,7 @@ parse_state_start_schema (ParseState *s
return;
}
@@ -10,7 +10,7 @@
if (path && (g_str_has_prefix (path, "/apps/") ||
g_str_has_prefix (path, "/desktop/") ||
g_str_has_prefix (path, "/system/")))
-@@ -1244,6 +1245,7 @@ parse_state_start_schema (ParseState *s
+@@ -1246,6 +1247,7 @@ parse_state_start_schema (ParseState *s
g_printerr ("%s\n", message);
g_free (message);
}
1
0