Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| a76f96d4f4 | |||
| b6359a4f38 | |||
| 7954474202 | |||
| 1c54aa5f7b | |||
| 5ec200b9ee | |||
| baf7e92993 |
53
do-not-use-pytuple-get-size.patch
Normal file
53
do-not-use-pytuple-get-size.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From 338044cbf771e5665a744d3b36b5d7edd126d16a Mon Sep 17 00:00:00 2001
|
||||
From: Zaur Shibzukhov <szport@gmail.com>
|
||||
Date: Mon, 31 Mar 2025 10:00:01 +0300
|
||||
Subject: [PATCH] Fix #13 with litelist/litetuple get_subscript routine
|
||||
|
||||
---
|
||||
examples/performance_cgc.ipynb | 32 ++++++++++++++++----------------
|
||||
lib/recordclass/_litelist.c | 4 ++--
|
||||
lib/recordclass/_litetuple.c | 4 ++--
|
||||
3 files changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
Index: recordclass-0.22.1/lib/recordclass/_litelist.c
|
||||
===================================================================
|
||||
--- recordclass-0.22.1.orig/lib/recordclass/_litelist.c
|
||||
+++ recordclass-0.22.1/lib/recordclass/_litelist.c
|
||||
@@ -484,13 +484,13 @@ litelist_subscript(PyLiteListObject* sel
|
||||
if (PySlice_Check(item)) {
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
- if (PySlice_GetIndicesEx(item, (PyTuple_GET_SIZE(self)), &start, &stop, &step, &slicelength) < 0)
|
||||
+ if (PySlice_GetIndicesEx(item, (Py_SIZE(self)), &start, &stop, &step, &slicelength) < 0)
|
||||
return NULL;
|
||||
return litelist_slice(self, start, stop);
|
||||
}
|
||||
else {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
- "subscript must be integer, slice or string, but not %.200s",
|
||||
+ "subscript must be integer or slice, but not %.200s",
|
||||
Py_TYPE(item)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
Index: recordclass-0.22.1/lib/recordclass/_litetuple.c
|
||||
===================================================================
|
||||
--- recordclass-0.22.1.orig/lib/recordclass/_litetuple.c
|
||||
+++ recordclass-0.22.1/lib/recordclass/_litetuple.c
|
||||
@@ -32,7 +32,7 @@ static PyTypeObject PyMLiteTuple_Type;
|
||||
|
||||
#define PyLiteTuple_GET_ITEM(op, i) (((PyLiteTupleObject *)(op))->ob_item[i])
|
||||
#define PyLiteTuple_SET_ITEM(op, i, v) (((PyLiteTupleObject *)(op))->ob_item[i] = v)
|
||||
-#define PyLiteTuple_GET_SIZE(seq) PyTuple_GET_SIZE(seq)
|
||||
+#define PyLiteTuple_GET_SIZE(seq) Py_SIZE(seq)
|
||||
|
||||
#define PyLiteTuple_CheckExact(op) (Py_TYPE(op) == &PyLiteTuple_Type || Py_TYPE(op) == &PyMLiteTuple_Type)
|
||||
#define PyLiteTuple_Check(op) (PyLiteTuple_CheckExact(op) || PyObject_IsInstance(op, (PyObject*)&PyLiteTuple_Type) || PyObject_IsInstance(op, (PyObject*)&PyMLiteTuple_Type))
|
||||
@@ -417,7 +417,7 @@ litetuple_subscript(PyLiteTupleObject* s
|
||||
if (PySlice_Check(item)) {
|
||||
Py_ssize_t start, stop, step, slicelength;
|
||||
|
||||
- if (PySlice_GetIndicesEx(item, (PyTuple_GET_SIZE(self)), &start, &stop, &step, &slicelength) < 0)
|
||||
+ if (PySlice_GetIndicesEx(item, (Py_SIZE(self)), &start, &stop, &step, &slicelength) < 0)
|
||||
return NULL;
|
||||
return litetuple_slice(self, start, stop);
|
||||
}
|
||||
@@ -1,3 +1,30 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 4 00:56:20 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch do-not-use-pytuple-get-size.patch:
|
||||
* Use Py_SIZE rather than PyTuple_GET_SIZE to avoid assertion failures.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 5 19:05:39 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 0.22.1:
|
||||
* Add `pyproject.toml`.
|
||||
- update to 0.22.0.3:
|
||||
* Rename examples est_*.py files since they are detected by
|
||||
pytest as a tests.
|
||||
* Fix segfault with litelist after 0.22.0.2.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 2 15:13:24 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 0.22.0.2:
|
||||
* Fix regression with `as_dataclass`.
|
||||
- update to 0.22:
|
||||
* `Recordclass 0.22` started support of `python 3.13`.
|
||||
* Add a base class `datastruct` for subclasses that should
|
||||
behave more like simple datastructures.
|
||||
* Fix bug with `__match_args__` (#6).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 29 09:35:17 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-recordclass
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,16 +16,19 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-recordclass
|
||||
Version: 0.21.1
|
||||
Version: 0.22.1
|
||||
Release: 0
|
||||
Summary: Library implementing a mutable variant of namedtuple
|
||||
License: MIT
|
||||
URL: https://github.com/intellimath/recordclass
|
||||
Source: https://files.pythonhosted.org/packages/source/r/recordclass/recordclass-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM Based on gh#intellimath/recordclass#338044cbf771e5665a744d3b36b5d7edd126d16a
|
||||
Patch0: do-not-use-pytuple-get-size.patch
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
# SECTION Test requirements
|
||||
@@ -39,14 +42,14 @@ Mutable variant of namedtuple -- recordclass, which support assignments, and
|
||||
other memory saving variants.
|
||||
|
||||
%prep
|
||||
%setup -q -n recordclass-%{version}
|
||||
%autosetup -p1 -n recordclass-%{version}
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
@@ -57,6 +60,6 @@ export CFLAGS="%{optflags}"
|
||||
%doc README.md
|
||||
%license LICENSE.txt
|
||||
%{python_sitearch}/recordclass/
|
||||
%{python_sitearch}/recordclass-%{version}-py%{python_version}.egg-info/
|
||||
%{python_sitearch}/recordclass-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa2343dc24ef457f5f1c09e34fccada2d9074f582287f9fedb195bfbc1a9af92
|
||||
size 1321641
|
||||
3
recordclass-0.22.1.tar.gz
Normal file
3
recordclass-0.22.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:80a4c79270edb8fb55bcb96bec0159a292b485c997e2f33b38fdc9e8d6c0c315
|
||||
size 1333756
|
||||
Reference in New Issue
Block a user