Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-py3c for openSUSE:Factory checked in at 2022-10-10 18:44:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-py3c (Old) and /work/SRC/openSUSE:Factory/.python-py3c.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-py3c" Mon Oct 10 18:44:12 2022 rev:6 rq:1008174 version:1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-py3c/python-py3c.changes 2022-08-08 08:44:48.314384001 +0200 +++ /work/SRC/openSUSE:Factory/.python-py3c.new.2275/python-py3c.changes 2022-10-10 18:44:34.190869598 +0200 @@ -1,0 +2,13 @@ +Tue Oct 4 23:42:12 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version v1.4 (2021-10-15) + Additions: + add guidance around the use of Py_FindMethod (thanks to David Aguilar) + Fixes: + Avoid compiler warning about unused function + Fix DESTDIR support in the Makefile (thanks to David Aguilar) + Various documentation warning fixes (thanks to David Aguilar) + Project infrastructure: + Switch to GitHub Actions for pull request tests + +------------------------------------------------------------------- Old: ---- py3c-1.3.1.tar.gz New: ---- py3c-1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-py3c.spec ++++++ --- /var/tmp/diff_new_pack.6YbM61/_old 2022-10-10 18:44:36.090873688 +0200 +++ /var/tmp/diff_new_pack.6YbM61/_new 2022-10-10 18:44:36.098873705 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-py3c -Version: 1.3.1 +Version: 1.4 Release: 0 Summary: Python compatibility headers License: MIT ++++++ py3c-1.3.1.tar.gz -> py3c-1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/.github/workflows/main.yml new/py3c-1.4/.github/workflows/main.yml --- old/py3c-1.3.1/.github/workflows/main.yml 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/.github/workflows/main.yml 2021-10-15 17:18:45.000000000 +0200 @@ -2,10 +2,7 @@ push: branches: - master - - ci-test pull_request: - branches: - - master name: Run Tox tests @@ -19,14 +16,34 @@ uses: fedora-python/tox-github-action@master with: tox_env: ${{ matrix.tox_env }} - dnf_install: /usr/bin/make strategy: matrix: tox_env: [ py27-c90, py35-c90, py36-c90, py27-c99, py35-c99, py36-c99, py37-c99, py38-c99, py39-c99, py310-c99, - py27-c90, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, + py27-cpp, py35-cpp, py36-cpp, py37-cpp, py38-cpp, py39-cpp, py310-cpp, ] + # Old Python versions tend to have their own problems, so the CI + # isn't green all the time :( + # With this flag, GHA will show all issues so they can be analyzed. + fail-fast: false + + # Use GitHub's Linux Docker host + runs-on: ubuntu-latest + + py33-test: + name: Python 3.3 test + container: python:3.3 + steps: + - uses: actions/checkout@v2 + - name: Run tests + env: + CFLAGS: "-Werror -Wall -Wno-error=strict-aliasing" + run: | + CFLAGS="$CFLAGS -std=c90" make test-python + CFLAGS="$CFLAGS -std=c99" make test-python + make test-python-cpp + # Use GitHub's Linux Docker host runs-on: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/.travis.yml new/py3c-1.4/.travis.yml --- old/py3c-1.3.1/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/py3c-1.4/.travis.yml 2021-10-15 17:18:45.000000000 +0200 @@ -0,0 +1,15 @@ +language: python +arch: + - amd64 + - ppc64le +python: + - "3.4" + +env: + - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c90 -Wno-error=strict-aliasing" + - TEST_USE_CPP=no CFLAGS="-Werror -Wall -std=c99 -Wno-error=strict-aliasing" + - TEST_USE_CPP=yes CFLAGS="-Werror -Wall -Wno-error=strict-aliasing" + +script: make test-python + +sudo: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/Makefile new/py3c-1.4/Makefile --- old/py3c-1.3.1/Makefile 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/Makefile 2021-10-15 17:18:45.000000000 +0200 @@ -11,6 +11,9 @@ datarootdir ?= $(prefix)/share datadir ?= $(datarootdir) pkgconfigdir ?= ${datadir}/pkgconfig +testbuilddir ?= test/build + +_testbuilddir_abs=$(abspath ${testbuilddir}) doc: cd doc && $(MAKE) html @@ -24,22 +27,20 @@ # TODO: A better way to build & use one-off extensions? build-%: - cd test; rm -rvf build ; $* setup.py build + cd test; rm -rvf ${_testbuilddir_abs} ; $* setup.py build -b ${_testbuilddir_abs} build-%-cpp: - cd test; rm -rvf build ; TEST_USE_CPP=yes $* setup.py build + cd test; rm -rvf ${_testbuilddir_abs} ; TEST_USE_CPP=yes $* setup.py build -b ${_testbuilddir_abs} test-%: build-% - PYTHONPATH=$(wildcard test/build/lib*) $* test -v + echo ${_testbuilddir_abs} + PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v test-%-cpp: build-%-cpp - TEST_USE_CPP=yes PYTHONPATH=$(wildcard test/build/lib*) $* test -v - -$(includedir): - mkdir -p $(includedir) + TEST_USE_CPP=yes PYTHONPATH=$(wildcard ${_testbuilddir_abs}/lib*) $* test -v -py3c.pc: py3c.pc.in $(includedir) - sed -e's:@includedir@:$(realpath $(includedir)):' $< > $@ +py3c.pc: py3c.pc.in + sed -e's:@includedir@:$(abspath $(includedir)):' $< > $@ install: py3c.pc mkdir -p -m 0755 $(DESTDIR)$(includedir)/py3c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/doc/source/changelog.rst new/py3c-1.4/doc/source/changelog.rst --- old/py3c-1.3.1/doc/source/changelog.rst 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/doc/source/changelog.rst 2021-10-15 17:18:45.000000000 +0200 @@ -7,9 +7,27 @@ Version History =============== -v1.3.1 (2021-01-07) +v1.4 (2021-10-15) ----------------- +Additions: + +* add guidance around the use of ``Py_FindMethod`` (thanks to David Aguilar) + +Fixes: + +* Avoid compiler warning about unused function +* Fix ``DESTDIR`` support in the Makefile (thanks to David Aguilar) +* Various documentation warning fixes (thanks to David Aguilar) + +Project infrastructure: + +* Switch to GitHub Actions for pull request tests + + +v1.3.1 (2021-01-07) +------------------- + Packaging: * Allow building the documentation without sphinx_rtd_theme diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/doc/source/conf.py new/py3c-1.4/doc/source/conf.py --- old/py3c-1.3.1/doc/source/conf.py 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/doc/source/conf.py 2021-10-15 17:18:45.000000000 +0200 @@ -53,9 +53,9 @@ # built documents. # # The short X.Y version. -version = '1.3' +version = '1.4' # The full version, including alpha/beta/rc tags. -release = '1.3.1' +release = '1.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/doc/source/defs.rst new/py3c-1.4/doc/source/defs.rst --- old/py3c-1.3.1/doc/source/defs.rst 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/doc/source/defs.rst 2021-10-15 17:18:45.000000000 +0200 @@ -61,6 +61,7 @@ :c:type:`PyModuleDef` | Python 2: contains ``m_name``, ``m_doc``, ``m_size``, ``m_methods`` fields from Python 3, and ``m_base`` to accomodate PyModuleDef_HEAD_INIT. + Also contains members `m_slots`, `m_traverse`, `m_clear`, `m_free`, which must be set to NULL. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/doc/source/guide-porting.rst new/py3c-1.4/doc/source/guide-porting.rst --- old/py3c-1.3.1/doc/source/guide-porting.rst 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/doc/source/guide-porting.rst 2021-10-15 17:18:45.000000000 +0200 @@ -349,6 +349,46 @@ (e.g. for debugging), see py3c's limited :doc:`file API shim <fileshim>`. +Py_FindMethod and Generic Attributes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +While the actual need for type-specific attribute handlers almost completely +disappeared starting with `Generic Attribute support in Python 2.2 +<https://docs.python.org/2.7/extending/newtypes.html#generic-attribute-management>`_, +there may still be old code that uses a custom ``tp_getattr`` implementation to +return methods for a user-defined type. + +The following example snippet uses :c:func:`Py_FindMethod <py2:Py_FindMethod>` +from a ``tp_getattr`` function to return custom methods for a type:: + + static struct PyMethodDef mytype_methods[] = { + {"my_method", (PyCFunction)mytype_example, METH_VARARGS, "docstring"}, + {NULL, NULL}, + }; + + static PyObject* mytype_getattr(mytype* self, char* name) + { + return Py_FindMethod(mytype_methods, (PyObject*)self, name); + } + +A ``tp_getattr`` function like the one above can be eliminated. A pointer to +:c:func:`PyObject_GenericGetAttr <py2:PyObject_GenericGetAttr>` +can be set in the ``tp_getattro`` field, rather than implementing a custom +``tp_getattr`` function ourselves, as long as we we also set the ``tp_methods`` +struct field to the ``mytype_methods`` array. + +* Set the ``tp_methods`` struct field to the ``mytype_methods`` + :c:type:`PyMethodDef <py3:PyMethodDef>` array. + +* Set the ``tp_getattr`` :c:type:`PyTypeObject <py3:PyTypeObject>` struct field, + which previously was set to the custom ``mytype_getattr`` function, to NULL. + +* Set the ``tp_getattro`` struct field to + :c:func:`PyObject_GenericGetAttr <py2:PyObject_GenericGetAttr>`. + +* Delete the custom ``mytype_getattr`` function. + + Other changes ~~~~~~~~~~~~~ @@ -370,7 +410,9 @@ for the extension module ``foo`` might be named ``foo.cpython-33m.so``. Your buildsystem might generate these for you already, but if you need to -modify it, you can get the tags from ``systonfig``:: +modify it, you can get the tags from ``sysconfig``: + +.. code-block:: pycon >>> import sysconfig >>> sysconfig.get_config_var('EXT_SUFFIX') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/doc/source/reference.rst new/py3c-1.4/doc/source/reference.rst --- old/py3c-1.3.1/doc/source/reference.rst 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/doc/source/reference.rst 2021-10-15 17:18:45.000000000 +0200 @@ -643,10 +643,10 @@ #include <py3c/fileshim.h> // (*NOT* included in <py3c.h>) -.. c:function:: py3c_PyFile_AsFileWithMode(PyObject *py_file, const char *mode) +:c:func:`py3c_PyFile_AsFileWithMode <py3c:py3c_PyFile_AsFileWithMode>` - Quick-and-dirty substitute for the removed :c:func:`py2:PyFile_AsFile`. - Read the :doc:`file shim <fileshim>` chapter before using. +Quick-and-dirty substitute for the removed :c:func:`py2:PyFile_AsFile`. +Read the :doc:`file shim <fileshim>` chapter before using. Shims for New Conveniences in Python 3.4+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/include/py3c/compat.h new/py3c-1.4/include/py3c/compat.h --- old/py3c-1.3.1/include/py3c/compat.h 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/include/py3c/compat.h 2021-10-15 17:18:45.000000000 +0200 @@ -7,6 +7,18 @@ #include <Python.h> #include <assert.h> +/* Mark a function as `static inline`. + * Before C99, `inline` is not available, so use just `static` and silence + * "unused definition" warnings on some compilers. + */ +#if __STDC_VERSION__ >= 199901L +#define _py3c_STATIC_INLINE_FUNCTION(d) static inline d +#elif defined(__GNUC__) || defined(__clang__) +#define _py3c_STATIC_INLINE_FUNCTION(d) static d __attribute__ ((unused)); static d +#else +#define _py3c_STATIC_INLINE_FUNCTION(d) static d +#endif + #if PY_MAJOR_VERSION >= 3 /***** Python 3 *****/ @@ -74,10 +86,7 @@ #define PyStr_InternFromString PyString_InternFromString #define PyStr_Decode PyString_Decode -#ifdef __GNUC__ -static PyObject *PyStr_Concat(PyObject *left, PyObject *right) __attribute__ ((unused)); -#endif -static PyObject *PyStr_Concat(PyObject *left, PyObject *right) { +_py3c_STATIC_INLINE_FUNCTION(PyObject *PyStr_Concat(PyObject *left, PyObject *right)) { PyObject *str = left; Py_INCREF(left); /* reference to old left will be stolen */ PyString_Concat(&str, right); @@ -129,7 +138,7 @@ void* m_free; } PyModuleDef; -static PyObject *PyModule_Create(PyModuleDef *def) { +_py3c_STATIC_INLINE_FUNCTION(PyObject *PyModule_Create(PyModuleDef *def)) { assert(!def->m_slots); assert(!def->m_traverse); assert(!def->m_clear); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/include/py3c/fileshim.h new/py3c-1.4/include/py3c/fileshim.h --- old/py3c-1.3.1/include/py3c/fileshim.h 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/include/py3c/fileshim.h 2021-10-15 17:18:45.000000000 +0200 @@ -5,6 +5,7 @@ #ifndef _PY3C_FILESHIM_H_ #define _PY3C_FILESHIM_H_ #include <Python.h> +#include <py3c/compat.h> /* @@ -21,7 +22,7 @@ static char FLUSH[] = "flush"; static char EMPTY_STRING[] = ""; -static FILE* py3c_PyFile_AsFileWithMode(PyObject *py_file, const char *mode) { +_py3c_STATIC_INLINE_FUNCTION(FILE* py3c_PyFile_AsFileWithMode(PyObject *py_file, const char *mode)) { FILE *f; PyObject *ret; int fd; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/py3c.pc.in new/py3c-1.4/py3c.pc.in --- old/py3c-1.3.1/py3c.pc.in 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/py3c.pc.in 2021-10-15 17:18:45.000000000 +0200 @@ -8,5 +8,5 @@ #Requires: python #Requires: python3 -Version: 1.3.1 +Version: 1.4 Cflags: -I${includedir} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/setup.cfg new/py3c-1.4/setup.cfg --- old/py3c-1.3.1/setup.cfg 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/setup.cfg 2021-10-15 17:18:45.000000000 +0200 @@ -1,6 +1,6 @@ [metadata] name=py3c -version=1.3.1 +version=1.4 description=Python compatibility headers long_description=file: README.rst author=Petr Viktorin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/test/all_py3c_headers.h new/py3c-1.4/test/all_py3c_headers.h --- old/py3c-1.3.1/test/all_py3c_headers.h 1970-01-01 01:00:00.000000000 +0100 +++ new/py3c-1.4/test/all_py3c_headers.h 2021-10-15 17:18:45.000000000 +0200 @@ -0,0 +1,7 @@ +/* Include all py3c headers, including optional ones */ + +#include <Python.h> +#include <py3c.h> +#include <py3c/capsulethunk.h> +#include <py3c/fileshim.h> +#include <py3c/tpflags.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/test/setup.py new/py3c-1.4/test/setup.py --- old/py3c-1.3.1/test/setup.py 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/test/setup.py 2021-10-15 17:18:45.000000000 +0200 @@ -9,9 +9,9 @@ # (there's also a gcc -x switch, but it needs to go before the filename; # I don't think setuptools allows that) if USE_CPP: - sources = ['test_py3c.cpp'] + sources = ['test_py3c.cpp', 'test_empty.cpp'] else: - sources = ['test_py3c.c'] + sources = ['test_py3c.c', 'test_empty.c'] extra_compile_args = [] extra_compile_args.extend(['-Werror', '-Wall']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/test/test_empty.c new/py3c-1.4/test/test_empty.c --- old/py3c-1.3.1/test/test_empty.c 1970-01-01 01:00:00.000000000 +0100 +++ new/py3c-1.4/test/test_empty.c 2021-10-15 17:18:45.000000000 +0200 @@ -0,0 +1,5 @@ +/* This file includes all py3c headers, but doesn't use anything. + * This file exists to ensure we don't get any warnings about unused items. + */ + +#include "all_py3c_headers.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/test/test_empty.cpp new/py3c-1.4/test/test_empty.cpp --- old/py3c-1.3.1/test/test_empty.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/py3c-1.4/test/test_empty.cpp 2022-10-10 18:44:36.226873980 +0200 @@ -0,0 +1 @@ +symbolic link to test_empty.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/test/test_py3c.c new/py3c-1.4/test/test_py3c.c --- old/py3c-1.3.1/test/test_py3c.c 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/test/test_py3c.c 2021-10-15 17:18:45.000000000 +0200 @@ -1,12 +1,8 @@ /* Make sure Py_UNREACHABLE errors out */ #define RANDALL_WAS_HERE -#include <Python.h> +#include "all_py3c_headers.h" #include "structmember.h" -#include <py3c.h> -#include <py3c/capsulethunk.h> -#include <py3c/fileshim.h> -#include <py3c/tpflags.h> #define UTF8_STRING "test string \xe1\xba\x87\xc3\xad\xc5\xa5\xc4\xa7 \xc5\xae\xc5\xa2\xe1\xb8\x9e\xe2\x88\x9e \xe2\x98\xba" #define FORMAT_STRING "<%s:%d>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py3c-1.3.1/tox.ini new/py3c-1.4/tox.ini --- old/py3c-1.3.1/tox.ini 2021-01-07 16:57:29.000000000 +0100 +++ new/py3c-1.4/tox.ini 2021-10-15 17:18:45.000000000 +0200 @@ -1,14 +1,18 @@ [tox] -envlist = py{27,34,35,36}-{c90,c99,cpp},py{37,38,39,310}-{c99,cpp} +envlist = py{27,34}-{c90,c99,cpp14},py{35,36}-{c90,c99,cpp17},py{37,38,39,310}-{c99,cpp} skipsdist = True [testenv] allowlist_externals = make -commands = make test-python +commands = make testbuilddir={envdir}/build test-python setenv= c90: TEST_USE_CPP=no c90: CFLAGS=-Werror -Wall -std=c90 -Wno-error=strict-aliasing c99: TEST_USE_CPP=no c99: CFLAGS=-Werror -Wall -std=c99 -Wno-error=strict-aliasing - cpp: TEST_USE_CPP=yes - cpp: CFLAGS=-Werror -Wall -Wno-error=strict-aliasing + cpp17: TEST_USE_CPP=yes + cpp17: CFLAGS=-Werror -Wall -Wno-error=strict-aliasing -std=c++17 + cpp14: TEST_USE_CPP=yes + cpp14: CFLAGS=-Werror -Wall -Wno-error=strict-aliasing -std=c++14 + clang: CC=clang + clang: CFLAGS=-Werror -Wall -std=c99