Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-immutables for openSUSE:Factory checked in at 2022-10-14 15:40:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-immutables (Old) and /work/SRC/openSUSE:Factory/.python-immutables.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-immutables" Fri Oct 14 15:40:23 2022 rev:11 rq:1010135 version:0.19 Changes: -------- --- /work/SRC/openSUSE:Factory/python-immutables/python-immutables.changes 2022-08-24 15:10:55.208490454 +0200 +++ /work/SRC/openSUSE:Factory/.python-immutables.new.2275/python-immutables.changes 2022-10-14 15:40:40.131730999 +0200 @@ -1,0 +2,6 @@ +Wed Oct 12 03:36:57 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 0.19 + * Support for Python 3.11 + +------------------------------------------------------------------- Old: ---- immutables-0.18.tar.gz New: ---- immutables-0.19.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-immutables.spec ++++++ --- /var/tmp/diff_new_pack.5JFoYl/_old 2022-10-14 15:40:40.663731888 +0200 +++ /var/tmp/diff_new_pack.5JFoYl/_new 2022-10-14 15:40:40.663731888 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-immutables -Version: 0.18 +Version: 0.19 Release: 0 Summary: Immutable collections for Python License: Apache-2.0 ++++++ immutables-0.18.tar.gz -> immutables-0.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/PKG-INFO new/immutables-0.19/PKG-INFO --- old/immutables-0.18/PKG-INFO 2022-05-22 08:24:35.646268800 +0200 +++ new/immutables-0.19/PKG-INFO 2022-09-14 19:31:46.379966700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: immutables -Version: 0.18 +Version: 0.19 Summary: Immutable Collections Home-page: https://github.com/MagicStack/immutables Author: MagicStack Inc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/immutables/_map.h new/immutables-0.19/immutables/_map.h --- old/immutables-0.18/immutables/_map.h 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/immutables/_map.h 2022-09-14 19:31:40.000000000 +0200 @@ -4,6 +4,17 @@ #include <stdint.h> #include "Python.h" +/* +HAMT tree is shaped by hashes of keys. Every group of 5 bits of a hash denotes +the exact position of the key in one level of the tree. Since we're using +32 bit hashes, we can have at most 7 such levels. Although if there are +two distinct keys with equal hashes, they will have to occupy the same +cell in the 7th level of the tree -- so we'd put them in a "collision" node. +Which brings the total possible tree depth to 8. Read more about the actual +layout of the HAMT tree in `_map.c`. + +This constant is used to define a datastucture for storing iteration state. +*/ #define _Py_HAMT_MAX_TREE_DEPTH 8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/immutables/_version.py new/immutables-0.19/immutables/_version.py --- old/immutables-0.18/immutables/_version.py 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/immutables/_version.py 2022-09-14 19:31:40.000000000 +0200 @@ -10,4 +10,4 @@ # supported platforms, publish the packages on PyPI, merge the PR # to the target branch, create a Git tag pointing to the commit. -__version__ = '0.18' +__version__ = '0.19' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/immutables/pythoncapi_compat.h new/immutables-0.19/immutables/pythoncapi_compat.h --- old/immutables-0.18/immutables/pythoncapi_compat.h 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/immutables/pythoncapi_compat.h 2022-09-14 19:31:40.000000000 +0200 @@ -26,27 +26,29 @@ // the inline keyword in C (only in C++): use __inline instead. #if (defined(_MSC_VER) && _MSC_VER < 1900 \ && !defined(__cplusplus) && !defined(inline)) -# define PYCAPI_COMPAT_INLINE(TYPE static __inline TYPE +# define PYCAPI_COMPAT_STATIC_INLINE(TYPE) static __inline TYPE #else # define PYCAPI_COMPAT_STATIC_INLINE(TYPE) static inline TYPE #endif -// C++ compatibility -#ifdef __cplusplus -# define PYCAPI_COMPAT_CAST(TYPE, EXPR) reinterpret_cast<TYPE>(EXPR) -# define PYCAPI_COMPAT_NULL nullptr -#else -# define PYCAPI_COMPAT_CAST(TYPE, EXPR) ((TYPE)(EXPR)) -# define PYCAPI_COMPAT_NULL NULL +#ifndef _Py_CAST +# define _Py_CAST(type, expr) ((type)(expr)) +#endif + +// On C++11 and newer, _Py_NULL is defined as nullptr on C++11, +// otherwise it is defined as NULL. +#ifndef _Py_NULL +# if defined(__cplusplus) && __cplusplus >= 201103 +# define _Py_NULL nullptr +# else +# define _Py_NULL NULL +# endif #endif // Cast argument to PyObject* type. #ifndef _PyObject_CAST -# define _PyObject_CAST(op) PYCAPI_COMPAT_CAST(PyObject*, op) -#endif -#ifndef _PyObject_CAST_CONST -# define _PyObject_CAST_CONST(op) PYCAPI_COMPAT_CAST(const PyObject*, op) +# define _PyObject_CAST(op) _Py_CAST(PyObject*, op) #endif @@ -74,30 +76,6 @@ #endif -// See https://bugs.python.org/issue42522 -#if !defined(_Py_StealRef) -PYCAPI_COMPAT_STATIC_INLINE(PyObject*) -__Py_StealRef(PyObject *obj) -{ - Py_DECREF(obj); - return obj; -} -#define _Py_StealRef(obj) __Py_StealRef(_PyObject_CAST(obj)) -#endif - - -// See https://bugs.python.org/issue42522 -#if !defined(_Py_XStealRef) -PYCAPI_COMPAT_STATIC_INLINE(PyObject*) -__Py_XStealRef(PyObject *obj) -{ - Py_XDECREF(obj); - return obj; -} -#define _Py_XStealRef(obj) __Py_XStealRef(_PyObject_CAST(obj)) -#endif - - // bpo-39573 added Py_SET_REFCNT() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_REFCNT) PYCAPI_COMPAT_STATIC_INLINE(void) @@ -171,27 +149,28 @@ PYCAPI_COMPAT_STATIC_INLINE(PyCodeObject*) PyFrame_GetCode(PyFrameObject *frame) { - assert(frame != PYCAPI_COMPAT_NULL); - assert(frame->f_code != PYCAPI_COMPAT_NULL); - return PYCAPI_COMPAT_CAST(PyCodeObject*, Py_NewRef(frame->f_code)); + assert(frame != _Py_NULL); + assert(frame->f_code != _Py_NULL); + return _Py_CAST(PyCodeObject*, Py_NewRef(frame->f_code)); } #endif PYCAPI_COMPAT_STATIC_INLINE(PyCodeObject*) _PyFrame_GetCodeBorrow(PyFrameObject *frame) { - return PYCAPI_COMPAT_CAST(PyCodeObject *, - _Py_StealRef(PyFrame_GetCode(frame))); + PyCodeObject *code = PyFrame_GetCode(frame); + Py_DECREF(code); + return code; } -// bpo-40421 added PyFrame_GetCode() to Python 3.9.0b1 +// bpo-40421 added PyFrame_GetBack() to Python 3.9.0b1 #if PY_VERSION_HEX < 0x030900B1 && !defined(PYPY_VERSION) PYCAPI_COMPAT_STATIC_INLINE(PyFrameObject*) PyFrame_GetBack(PyFrameObject *frame) { - assert(frame != PYCAPI_COMPAT_NULL); - return PYCAPI_COMPAT_CAST(PyFrameObject*, Py_XNewRef(frame->f_back)); + assert(frame != _Py_NULL); + return _Py_CAST(PyFrameObject*, Py_XNewRef(frame->f_back)); } #endif @@ -199,8 +178,66 @@ PYCAPI_COMPAT_STATIC_INLINE(PyFrameObject*) _PyFrame_GetBackBorrow(PyFrameObject *frame) { - return PYCAPI_COMPAT_CAST(PyFrameObject *, - _Py_XStealRef(PyFrame_GetBack(frame))); + PyFrameObject *back = PyFrame_GetBack(frame); + Py_XDECREF(back); + return back; +} +#endif + + +// bpo-40421 added PyFrame_GetLocals() to Python 3.11.0a7 +#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyFrame_GetLocals(PyFrameObject *frame) +{ +#if PY_VERSION_HEX >= 0x030400B1 + if (PyFrame_FastToLocalsWithError(frame) < 0) { + return NULL; + } +#else + PyFrame_FastToLocals(frame); +#endif + return Py_NewRef(frame->f_locals); +} +#endif + + +// bpo-40421 added PyFrame_GetGlobals() to Python 3.11.0a7 +#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyFrame_GetGlobals(PyFrameObject *frame) +{ + return Py_NewRef(frame->f_globals); +} +#endif + + +// bpo-40421 added PyFrame_GetBuiltins() to Python 3.11.0a7 +#if PY_VERSION_HEX < 0x030B00A7 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyFrame_GetBuiltins(PyFrameObject *frame) +{ + return Py_NewRef(frame->f_builtins); +} +#endif + + +// bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1 +#if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(int) +PyFrame_GetLasti(PyFrameObject *frame) +{ +#if PY_VERSION_HEX >= 0x030A00A7 + // bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset, + // not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes) + // instructions. + if (frame->f_lasti < 0) { + return -1; + } + return frame->f_lasti * 2; +#else + return frame->f_lasti; +#endif } #endif @@ -210,7 +247,7 @@ PYCAPI_COMPAT_STATIC_INLINE(PyInterpreterState *) PyThreadState_GetInterpreter(PyThreadState *tstate) { - assert(tstate != PYCAPI_COMPAT_NULL); + assert(tstate != _Py_NULL); return tstate->interp; } #endif @@ -221,8 +258,8 @@ PYCAPI_COMPAT_STATIC_INLINE(PyFrameObject*) PyThreadState_GetFrame(PyThreadState *tstate) { - assert(tstate != PYCAPI_COMPAT_NULL); - return PYCAPI_COMPAT_CAST(PyFrameObject *, Py_XNewRef(tstate->frame)); + assert(tstate != _Py_NULL); + return _Py_CAST(PyFrameObject *, Py_XNewRef(tstate->frame)); } #endif @@ -230,8 +267,9 @@ PYCAPI_COMPAT_STATIC_INLINE(PyFrameObject*) _PyThreadState_GetFrameBorrow(PyThreadState *tstate) { - return PYCAPI_COMPAT_CAST(PyFrameObject*, - _Py_XStealRef(PyThreadState_GetFrame(tstate))); + PyFrameObject *frame = PyThreadState_GetFrame(tstate); + Py_XDECREF(frame); + return frame; } #endif @@ -245,11 +283,11 @@ PyInterpreterState *interp; tstate = PyThreadState_GET(); - if (tstate == PYCAPI_COMPAT_NULL) { + if (tstate == _Py_NULL) { Py_FatalError("GIL released (tstate is NULL)"); } interp = tstate->interp; - if (interp == PYCAPI_COMPAT_NULL) { + if (interp == _Py_NULL) { Py_FatalError("no current interpreter"); } return interp; @@ -262,7 +300,7 @@ PYCAPI_COMPAT_STATIC_INLINE(uint64_t) PyThreadState_GetID(PyThreadState *tstate) { - assert(tstate != PYCAPI_COMPAT_NULL); + assert(tstate != _Py_NULL); return tstate->id; } #endif @@ -286,8 +324,8 @@ PYCAPI_COMPAT_STATIC_INLINE(void) PyThreadState_LeaveTracing(PyThreadState *tstate) { - int use_tracing = (tstate->c_tracefunc != PYCAPI_COMPAT_NULL - || tstate->c_profilefunc != PYCAPI_COMPAT_NULL); + int use_tracing = (tstate->c_tracefunc != _Py_NULL + || tstate->c_profilefunc != _Py_NULL); tstate->tracing--; #if PY_VERSION_HEX >= 0x030A00A1 tstate->cframe->use_tracing = use_tracing; @@ -322,11 +360,11 @@ // bpo-1635741 added PyModule_AddObjectRef() to Python 3.10.0a3 #if PY_VERSION_HEX < 0x030A00A3 PYCAPI_COMPAT_STATIC_INLINE(int) -PyModule_AddObjectRef(PyObject *mod, const char *name, PyObject *value) +PyModule_AddObjectRef(PyObject *module, const char *name, PyObject *value) { int res; Py_XINCREF(value); - res = PyModule_AddObject(mod, name, value); + res = PyModule_AddObject(module, name, value); if (res < 0) { Py_XDECREF(value); } @@ -338,7 +376,7 @@ // bpo-40024 added PyModule_AddType() to Python 3.9.0a5 #if PY_VERSION_HEX < 0x030900A5 PYCAPI_COMPAT_STATIC_INLINE(int) -PyModule_AddType(PyObject *mod, PyTypeObject *type) +PyModule_AddType(PyObject *module, PyTypeObject *type) { const char *name, *dot; @@ -348,13 +386,13 @@ // inline _PyType_Name() name = type->tp_name; - assert(name != PYCAPI_COMPAT_NULL); + assert(name != _Py_NULL); dot = strrchr(name, '.'); - if (dot != PYCAPI_COMPAT_NULL) { + if (dot != _Py_NULL) { name = dot + 1; } - return PyModule_AddObjectRef(mod, name, _PyObject_CAST(type)); + return PyModule_AddObjectRef(module, name, _PyObject_CAST(type)); } #endif @@ -375,7 +413,7 @@ PYCAPI_COMPAT_STATIC_INLINE(int) PyObject_GC_IsFinalized(PyObject *obj) { - PyGC_Head *gc = PYCAPI_COMPAT_CAST(PyGC_Head *, obj) - 1; + PyGC_Head *gc = _Py_CAST(PyGC_Head*, obj) - 1; return (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(gc)); } #endif @@ -384,10 +422,10 @@ // bpo-39573 added Py_IS_TYPE() to Python 3.9.0a4 #if PY_VERSION_HEX < 0x030900A4 && !defined(Py_IS_TYPE) PYCAPI_COMPAT_STATIC_INLINE(int) -_Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) { - return ob->ob_type == type; +_Py_IS_TYPE(PyObject *ob, PyTypeObject *type) { + return Py_TYPE(ob) == type; } -#define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type) +#define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST(ob), type) #endif @@ -430,6 +468,44 @@ #endif +// gh-92154 added PyCode_GetCode() to Python 3.11.0b1 +#if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyCode_GetCode(PyCodeObject *code) +{ + return Py_NewRef(code->co_code); +} +#endif + + +// gh-95008 added PyCode_GetVarnames() to Python 3.11.0rc1 +#if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyCode_GetVarnames(PyCodeObject *code) +{ + return Py_NewRef(code->co_varnames); +} +#endif + +// gh-95008 added PyCode_GetFreevars() to Python 3.11.0rc1 +#if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyCode_GetFreevars(PyCodeObject *code) +{ + return Py_NewRef(code->co_freevars); +} +#endif + +// gh-95008 added PyCode_GetCellvars() to Python 3.11.0rc1 +#if PY_VERSION_HEX < 0x030B00C1 && !defined(PYPY_VERSION) +PYCAPI_COMPAT_STATIC_INLINE(PyObject*) +PyCode_GetCellvars(PyCodeObject *code) +{ + return Py_NewRef(code->co_cellvars); +} +#endif + + // Py_UNUSED() was added to Python 3.4.0b2. #if PY_VERSION_HEX < 0x030400B2 && !defined(Py_UNUSED) # if defined(__GNUC__) || defined(__clang__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/immutables.egg-info/PKG-INFO new/immutables-0.19/immutables.egg-info/PKG-INFO --- old/immutables-0.18/immutables.egg-info/PKG-INFO 2022-05-22 08:24:34.000000000 +0200 +++ new/immutables-0.19/immutables.egg-info/PKG-INFO 2022-09-14 19:31:46.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: immutables -Version: 0.18 +Version: 0.19 Summary: Immutable Collections Home-page: https://github.com/MagicStack/immutables Author: MagicStack Inc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/immutables.egg-info/requires.txt new/immutables-0.19/immutables.egg-info/requires.txt --- old/immutables-0.18/immutables.egg-info/requires.txt 2022-05-22 08:24:35.000000000 +0200 +++ new/immutables-0.19/immutables.egg-info/requires.txt 2022-09-14 19:31:46.000000000 +0200 @@ -3,7 +3,7 @@ typing-extensions>=3.7.4.3 [test] -flake8~=3.8.4 -pycodestyle~=2.6.0 -mypy==0.942 +flake8~=5.0.4 +pycodestyle~=2.9.1 +mypy==0.971 pytest~=6.2.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/pyproject.toml new/immutables-0.19/pyproject.toml --- old/immutables-0.18/pyproject.toml 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/pyproject.toml 2022-09-14 19:31:40.000000000 +0200 @@ -1,7 +1,3 @@ -[project] -name = 'immutables' -requires-python = ">=3.6" - [build-system] requires = ["setuptools>=42", "wheel"] build-backend = "setuptools.build_meta" @@ -13,6 +9,7 @@ filterwarnings = "default" [tool.mypy] +files = "immutables" incremental = true strict = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/setup.py new/immutables-0.19/setup.py --- old/immutables-0.18/setup.py 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/setup.py 2022-09-14 19:31:40.000000000 +0200 @@ -8,9 +8,9 @@ # pycodestyle is a dependency of flake8, but it must be frozen because # their combination breaks too often # (example breakage: https://gitlab.com/pycqa/flake8/issues/427) - 'flake8~=3.8.4', - 'pycodestyle~=2.6.0', - 'mypy==0.942', + 'flake8~=5.0.4', + 'pycodestyle~=2.9.1', + 'mypy==0.971', 'pytest~=6.2.4', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/tests/test_mypy.py new/immutables-0.19/tests/test_mypy.py --- old/immutables-0.18/tests/test_mypy.py 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/tests/test_mypy.py 2022-09-14 19:31:40.000000000 +0200 @@ -1,4 +1,5 @@ import os +import sys try: import mypy.test.testcmdline @@ -20,7 +21,19 @@ this_file_dir = os.path.dirname(os.path.realpath(__file__)) test_data_prefix = os.path.join(this_file_dir, 'test-data') + parent_dir = os.path.dirname(this_file_dir) + + mypy_path = os.environ.get("MYPYPATH") + if mypy_path: + mypy_path = parent_dir + os.pathsep + mypy_path + else: + mypy_path = parent_dir class ImmuMypyTest(mypy.test.testcmdline.PythonCmdlineSuite): data_prefix = test_data_prefix files = ['check-immu.test'] + + def run_case(self, testcase): + if sys.version_info >= (3, 7): + os.environ["MYPYPATH"] = mypy_path + super().run_case(testcase) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/immutables-0.18/tests/test_none_keys.py new/immutables-0.19/tests/test_none_keys.py --- old/immutables-0.18/tests/test_none_keys.py 2022-05-22 08:24:25.000000000 +0200 +++ new/immutables-0.19/tests/test_none_keys.py 2022-09-14 19:31:40.000000000 +0200 @@ -6,8 +6,8 @@ none_hash = map_hash(None) -assert(none_hash != 1) -assert(none_hash.bit_length() <= 32) +assert none_hash != 1 +assert none_hash.bit_length() <= 32 none_hash_u = ctypes.c_size_t(none_hash).value not_collision = 0xffffffff & (~none_hash_u) @@ -15,7 +15,7 @@ mask = 0x7ffffffff none_collisions = [none_hash_u & (mask >> shift) for shift in reversed(range(0, 32, 5))] -assert(len(none_collisions) == 7) +assert len(none_collisions) == 7 none_collisions = [ ctypes.c_ssize_t(h | (not_collision & (mask << shift))).value for shift, h in zip(range(5, 37, 5), none_collisions)