Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-cppy for openSUSE:Factory checked in at 2022-03-29 18:14:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cppy (Old) and /work/SRC/openSUSE:Factory/.python-cppy.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-cppy" Tue Mar 29 18:14:18 2022 rev:2 rq:965441 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-cppy/python-cppy.changes 2020-04-09 23:18:18.566343513 +0200 +++ /work/SRC/openSUSE:Factory/.python-cppy.new.1900/python-cppy.changes 2022-03-29 18:14:32.883080081 +0200 @@ -1,0 +2,14 @@ +Mon Mar 28 15:27:01 UTC 2022 - Ben Greiner <c...@bnavigator.de> + +- Fix version metadata (broke kiwisolver) +- Follow upstreams Python >= 3.7 restriction + +------------------------------------------------------------------- +Sun Mar 27 11:08:35 UTC 2022 - Dirk M??ller <dmuel...@suse.com> + +- update to 1.2.0: + - expose a build_ext subclass that can be re-used in other projects PR #16 + - use a PEP 517 compatible install procedure PR #16 + - do not access directly ob_type on PyObject use Py_TYPE + +------------------------------------------------------------------- Old: ---- cppy-1.1.0.tar.gz New: ---- cppy-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cppy.spec ++++++ --- /var/tmp/diff_new_pack.FKlrbY/_old 2022-03-29 18:14:33.435080588 +0200 +++ /var/tmp/diff_new_pack.FKlrbY/_new 2022-03-29 18:14:33.439080592 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-cppy # -# Copyright (c) 2020 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 @@ -16,18 +16,21 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-cppy -Version: 1.1.0 +Version: 1.2.0 Release: 0 Summary: C++ headers for C extension development License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/nucleic/cppy Source: https://files.pythonhosted.org/packages/source/c/cppy/cppy-%{version}.tar.gz +BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module tomli} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -52,6 +55,7 @@ %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/cppy +%{python_sitelib}/cppy-%{version}*-info %changelog ++++++ cppy-1.1.0.tar.gz -> cppy-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/.github/workflows/ci.yml new/cppy-1.2.0/.github/workflows/ci.yml --- old/cppy-1.1.0/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/.github/workflows/ci.yml 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,52 @@ +name: Continuous Integration +on: + push: + branches: + - main + pull_request: + paths: + - .github/workflows/ci.yml + - cppy/* + - tests/* + - setup.py + +jobs: + lint: + name: Lints Python codes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: pyflakes + uses: reviewdog/action-pyflakes@v1 + with: + github_token: ${{ secrets.github_token }} + reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} + + tests: + name: Unit tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ['3.7', '3.8', '3.9', '3.10'] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest + - name: Install project + run: | + pip install . + - name: Test with pytest + run: | + pytest tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/.github/workflows/docs.yml new/cppy-1.2.0/.github/workflows/docs.yml --- old/cppy-1.1.0/.github/workflows/docs.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/.github/workflows/docs.yml 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,41 @@ +name: Documentation building +on: + schedule: + - cron: '0 0 * * 2' + push: + branches: + - main + pull_request: + branches: + - main + paths: + - .github/workflows/docs.yml + - "cppy/**" + - "docs/**" + - setup.py + +jobs: + docs: + name: Docs building + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Set up Python + uses: actions/setup-python@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + - name: Install project + run: | + pip install -e . + - name: Install graphviz + uses: ts-graphviz/setup-graphviz@v1 + - name: Build documentation + run: | + mkdir docs_output; + sphinx-build docs/source docs_output -W -b html; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/.github/workflows/release.yml new/cppy-1.2.0/.github/workflows/release.yml --- old/cppy-1.1.0/.github/workflows/release.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/.github/workflows/release.yml 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,113 @@ +name: Build and upload release +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 3' + push: + tags: + - '*' + +jobs: + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Setup Python + uses: actions/setup-python@v2 + - name: Build sdist + run: | + pip install --upgrade pip + pip install wheel build + python -m build . -s + - name: Test sdist + run: | + pip install pytest + pip install dist/*.tar.gz + cd .. + python -m pytest cppy/tests + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: artifact + path: dist/* + + build_universal_wheel: + name: Build universal wheel + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get history and tags for SCM versioning to work + run: | + git fetch --prune --unshallow + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Setup Python + uses: actions/setup-python@v2 + - name: Build universal wheel + run: | + pip install --upgrade pip + pip install wheel build + python -m build . + - name: Test wheel + run: | + pip install pytest + pip install dist/*.whl + cd .. + python -m pytest cppy/tests + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: artifact + path: dist/*.whl + + release_upload: + name: Create Release and Upload Release Asset + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: [build_universal_wheel, build_sdist] + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'a') || contains(github.ref, 'b')}} + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + - name: Upload Release Asset + id: upload-release-asset + uses: shogo82148/actions-upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/* + + upload_pypi: + if: github.event_name == 'push' + needs: [build_universal_wheel, build_sdist] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: + # repository_url: https://test.pypi.org/legacy/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/.gitignore new/cppy-1.2.0/.gitignore --- old/cppy-1.1.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/.gitignore 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,7 @@ +build +dist +*.pyc +*.egg-info + +.vscode +version.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/.readthedocs.yaml new/cppy-1.2.0/.readthedocs.yaml --- old/cppy-1.1.0/.readthedocs.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/.readthedocs.yaml 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,27 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +# Build documentation in the docs/source directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Enable epub output +formats: + - epub + +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/CMakeLists.txt new/cppy-1.2.0/CMakeLists.txt --- old/cppy-1.1.0/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/CMakeLists.txt 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.12) +# https://dominikberner.ch/cmake-interface-lib/ + +project( + "cppy" + VERSION 1.1.0 + HOMEPAGE_URL "https://github.com/nucleic/cppy") + +set(libname "cppy") + +add_library(${libname} INTERFACE) +# add alias so the project can be uses with add_subdirectory +add_library(${libname}::${libname} ALIAS ${libname}) + +include(GNUInstallDirs) + +target_include_directories( + ${libname} + INTERFACE $<BUILD_INTERFACE:${${libname}_SOURCE_DIR}/lib> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) + +target_compile_features(${libname} INTERFACE cxx_std_11) + +install(TARGETS ${libname} + EXPORT ${libname}_Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${libname}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion) + +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/${libname}Config.cmake.in" + "${PROJECT_BINARY_DIR}/${libname}Config.cmake" + INSTALL_DESTINATION + ${CMAKE_INSTALL_DATAROOTDIR}/${libname}/cmake) + +install(EXPORT ${libname}_Targets + FILE ${libname}Targets.cmake + NAMESPACE ${libname}:: + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${libname}/cmake) + +install(FILES "${PROJECT_BINARY_DIR}/${libname}Config.cmake" + "${PROJECT_BINARY_DIR}/${libname}ConfigVersion.cmake" + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${libname}/cmake) + +install(DIRECTORY ${PROJECT_SOURCE_DIR}/cppy/include/cppy DESTINATION include) + +set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") + +include(CPack) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/PKG-INFO new/cppy-1.2.0/PKG-INFO --- old/cppy-1.1.0/PKG-INFO 2020-03-25 23:14:31.620055700 +0100 +++ new/cppy-1.2.0/PKG-INFO 2022-03-11 09:49:01.610216400 +0100 @@ -1,20 +1,24 @@ -Metadata-Version: 1.0 +Metadata-Version: 2.1 Name: cppy -Version: 1.1.0 +Version: 1.2.0 Summary: C++ headers for C extension development Home-page: https://github.com/nucleic/cppy Author: The Nucleic Development Team Author-email: sccolb...@gmail.com +Maintainer-email: m.dartia...@gmail.com License: UNKNOWN -Description: cppy - ==== - - .. image:: https://travis-ci.org/nucleic/cppy.svg?branch=master - :target: https://travis-ci.org/nucleic/cppy - - A small C++ header library which makes it easier to write Python extension - modules. The primary feature is a PyObject smart pointer which automatically - handles reference counting and provides convenience methods for performing - common object operations. - Platform: UNKNOWN +License-File: LICENSE + +Cppy +==== + +.. image:: https://github.com/nucleic/cppy/actions/workflows/ci.yml/badge.svg + :target: https://github.com/nucleic/cppy/actions/workflows/ci.yml + +A small C++ header library which makes it easier to write Python extension +modules. The primary feature is a PyObject smart pointer which automatically +handles reference counting and provides convenience methods for performing +common object operations. + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/README.rst new/cppy-1.2.0/README.rst --- old/cppy-1.1.0/README.rst 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/README.rst 2022-03-11 09:48:45.000000000 +0100 @@ -1,8 +1,8 @@ -cppy +Cppy ==== -.. image:: https://travis-ci.org/nucleic/cppy.svg?branch=master - :target: https://travis-ci.org/nucleic/cppy +.. image:: https://github.com/nucleic/cppy/actions/workflows/ci.yml/badge.svg + :target: https://github.com/nucleic/cppy/actions/workflows/ci.yml A small C++ header library which makes it easier to write Python extension modules. The primary feature is a PyObject smart pointer which automatically diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cmake/cppyConfig.cmake.in new/cppy-1.2.0/cmake/cppyConfig.cmake.in --- old/cppy-1.1.0/cmake/cppyConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/cmake/cppyConfig.cmake.in 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy/__init__.py new/cppy-1.2.0/cppy/__init__.py --- old/cppy-1.1.0/cppy/__init__.py 2020-03-25 23:12:02.000000000 +0100 +++ new/cppy-1.2.0/cppy/__init__.py 2022-03-11 09:48:45.000000000 +0100 @@ -1,21 +1,59 @@ -#------------------------------------------------------------------------------ -# Copyright (c) 2014-2020, Nucleic +# -------------------------------------------------------------------------------------- +# Copyright (c) 2014-2022, Nucleic Development Team. # # Distributed under the terms of the BSD 3-Clause License. # # The full license is in the file LICENSE, distributed with this software. -#------------------------------------------------------------------------------ -__major_version__ = 1 -__minor_version__ = 1 -__patch_version__ = 0 +# -------------------------------------------------------------------------------------- +import os +import sys +from setuptools.command.build_ext import build_ext -__version_info__ = (__major_version__, __minor_version__, __patch_version__) - - -__version__ = '%s.%s.%s' % __version_info__ +from .version import __version__, __version_info__ def get_include(): import os return os.path.join(os.path.dirname(__file__), 'include') + + +class CppyBuildExt(build_ext): + """A custom build extension enforcing c++11 standard on all platforms. + + On Windows, FH4 Exception Handling can be disabled by setting the CPPY_DISABLE_FH4 + environment variable. This avoids requiring VCRUNTIME140_1.dll + + """ + + # MSVC does not have a c++11 flag and default to c++14 anyway + c_opts = {"msvc": ["/EHsc"], "unix": ["-std=c++11"]} + + def build_extensions(self): + + ct = self.compiler.compiler_type + opts = self.c_opts.get(ct, []) + cppy_includes = get_include() + + for ext in self.extensions: + ext.include_dirs.insert(0, cppy_includes) + ext.extra_compile_args = opts + if sys.platform == "darwin": + # Only Unix compilers and their ports have `compiler_so` so on MacOS + # we can sure it will be present. + compiler_cmd = self.compiler.compiler_so + # Check if we are using Clang, accounting for absolute path + if compiler_cmd is not None and 'clang' in compiler_cmd[0]: + # If so ensure we use a recent enough version of the stdlib + ext.extra_compile_args += ["-stdlib=libc++"] + ext.extra_link_args += ["-stdlib=libc++"] + if ct == "msvc" and os.environ.get("CPPY_DISABLE_FH4"): + # Disable FH4 Exception Handling implementation so that we don't + # require VCRUNTIME140_1.dll. For more details, see: + # https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/ + # https://github.com/joerick/cibuildwheel/issues/423#issuecomment-677763904 + ext.extra_compile_args.append("/d2FH4-") + build_ext.build_extensions(self) + + +__all__ = ["__version__", "__version_info__", "get_include", "CppyBuildExt"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy/include/cppy/errors.h new/cppy-1.2.0/cppy/include/cppy/errors.h --- old/cppy-1.1.0/cppy/include/cppy/errors.h 2020-03-25 23:12:07.000000000 +0100 +++ new/cppy-1.2.0/cppy/include/cppy/errors.h 2022-03-11 09:48:45.000000000 +0100 @@ -33,7 +33,7 @@ PyExc_TypeError, "Expected object of type `%s`. Got object of type `%s` instead.", expected, - ob->ob_type->tp_name ); + Py_TYPE( ob )->tp_name ); return 0; } @@ -64,7 +64,7 @@ PyErr_Format( PyExc_AttributeError, "'%s' object has no attribute '%s'", - ob->ob_type->tp_name, + Py_TYPE( ob )->tp_name, attr ); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy/include/cppy/ptr.h new/cppy-1.2.0/cppy/include/cppy/ptr.h --- old/cppy-1.1.0/cppy/include/cppy/ptr.h 2020-03-25 23:12:08.000000000 +0100 +++ new/cppy-1.2.0/cppy/include/cppy/ptr.h 2022-03-11 09:48:45.000000000 +0100 @@ -276,7 +276,7 @@ PyTypeObject* type() const { - return m_ob->ob_type; + return Py_TYPE( m_ob ); } int richcmp( PyObject* other, int opid ) const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy/version.py new/cppy-1.2.0/cppy/version.py --- old/cppy-1.1.0/cppy/version.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/cppy/version.py 2022-03-11 09:49:01.000000000 +0100 @@ -0,0 +1,26 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2014-2022, Nucleic Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ----------------------------------------------------------------------------- +# This file is auto-generated by setuptools-scm do NOT edit it. + +from collections import namedtuple + +#: A namedtuple of the version info for the current release. +_version_info = namedtuple("_version_info", "major minor micro status") + +parts = "1.2.0".split(".", 3) +__version_info__ = _version_info( + int(parts[0]), + int(parts[1]), + int(parts[2]), + parts[3] if len(parts) == 4 else "", +) + +# Remove everything but the 'version_info' from this module. +del namedtuple, _version_info, parts + +__version__ = "1.2.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy.egg-info/PKG-INFO new/cppy-1.2.0/cppy.egg-info/PKG-INFO --- old/cppy-1.1.0/cppy.egg-info/PKG-INFO 2020-03-25 23:14:31.000000000 +0100 +++ new/cppy-1.2.0/cppy.egg-info/PKG-INFO 2022-03-11 09:49:01.000000000 +0100 @@ -1,20 +1,24 @@ -Metadata-Version: 1.0 +Metadata-Version: 2.1 Name: cppy -Version: 1.1.0 +Version: 1.2.0 Summary: C++ headers for C extension development Home-page: https://github.com/nucleic/cppy Author: The Nucleic Development Team Author-email: sccolb...@gmail.com +Maintainer-email: m.dartia...@gmail.com License: UNKNOWN -Description: cppy - ==== - - .. image:: https://travis-ci.org/nucleic/cppy.svg?branch=master - :target: https://travis-ci.org/nucleic/cppy - - A small C++ header library which makes it easier to write Python extension - modules. The primary feature is a PyObject smart pointer which automatically - handles reference counting and provides convenience methods for performing - common object operations. - Platform: UNKNOWN +License-File: LICENSE + +Cppy +==== + +.. image:: https://github.com/nucleic/cppy/actions/workflows/ci.yml/badge.svg + :target: https://github.com/nucleic/cppy/actions/workflows/ci.yml + +A small C++ header library which makes it easier to write Python extension +modules. The primary feature is a PyObject smart pointer which automatically +handles reference counting and provides convenience methods for performing +common object operations. + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/cppy.egg-info/SOURCES.txt new/cppy-1.2.0/cppy.egg-info/SOURCES.txt --- old/cppy-1.1.0/cppy.egg-info/SOURCES.txt 2020-03-25 23:14:31.000000000 +0100 +++ new/cppy-1.2.0/cppy.egg-info/SOURCES.txt 2022-03-11 09:49:01.000000000 +0100 @@ -1,9 +1,18 @@ +.gitignore +.readthedocs.yaml +CMakeLists.txt LICENSE MANIFEST.in README.rst +pyproject.toml releasenotes.rst setup.py +.github/workflows/ci.yml +.github/workflows/docs.yml +.github/workflows/release.yml +cmake/cppyConfig.cmake.in cppy/__init__.py +cppy/version.py cppy.egg-info/PKG-INFO cppy.egg-info/SOURCES.txt cppy.egg-info/dependency_links.txt @@ -14,6 +23,7 @@ cppy/include/cppy/ptr.h docs/Makefile docs/make.bat +docs/requirements.txt docs/source/conf.py docs/source/errors.rst docs/source/index.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/requirements.txt new/cppy-1.2.0/docs/requirements.txt --- old/cppy-1.1.0/docs/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/docs/requirements.txt 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,2 @@ +sphinx>=4 +sphinx-rtd-theme>=1 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/source/conf.py new/cppy-1.2.0/docs/source/conf.py --- old/cppy-1.1.0/docs/source/conf.py 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/docs/source/conf.py 2022-03-11 09:48:45.000000000 +0100 @@ -15,7 +15,7 @@ # import os # import sys # sys.path.insert(0, os.path.abspath('.')) - +from cppy import __version__ # -- Project information ----------------------------------------------------- @@ -23,10 +23,8 @@ copyright = '2019, Nucleic team' author = 'Nucleic team' -# The short X.Y version -version = '' # The full version, including alpha/beta/rc tags -release = '1.1.0' +release = __version__ # -- General configuration --------------------------------------------------- @@ -88,7 +86,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/source/errors.rst new/cppy-1.2.0/docs/source/errors.rst --- old/cppy-1.1.0/docs/source/errors.rst 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/docs/source/errors.rst 2022-03-11 09:48:45.000000000 +0100 @@ -1,7 +1,7 @@ Error reporting =============== -In addition to `cppy::ptr`, cppy provides a set a convenience function for +In addition to `cppy::ptr`, cppy provides a set of convenience functions for reporting errors which all return a NULL pointer allowing them to be used as follows: @@ -11,14 +11,14 @@ { cppy::ptr obj_ptr( cppy::incref( obj ) ); if( !obj_ptr.is_bool() ) - return type_error( obj_ptr.get(), 'bool' ) - return obj_ptr.get() + return type_error( obj_ptr.get(), "bool" ); + return obj_ptr.get(); } Functions --------- -Functions taking two arguments provide sensible pre-formated error messages. +Functions taking two arguments provide sensible pre-formatted error messages. .. code:: c++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/source/index.rst new/cppy-1.2.0/docs/source/index.rst --- old/cppy-1.1.0/docs/source/index.rst 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/docs/source/index.rst 2022-03-11 09:48:45.000000000 +0100 @@ -3,10 +3,10 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to cppy's documentation! +Welcome to Cppy's documentation! ================================ -Cpppy is a small C++ header library which makes it easier to write Python +Cppy is a small C++ header library which makes it easier to write Python extension modules. The primary feature is a PyObject smart pointer which automatically handles reference counting and provides convenience methods for performing common object operations. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/source/installation.rst new/cppy-1.2.0/docs/source/installation.rst --- old/cppy-1.1.0/docs/source/installation.rst 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/docs/source/installation.rst 2022-03-11 09:48:45.000000000 +0100 @@ -1,21 +1,21 @@ Installation and use with setuptools ==================================== -Since cppy is nothing else than a collection of header that are only compiled +Since Cppy is nothing else than a collection of header that are only compiled when used, installing it is extremely straightforward using pip:: $ pip install cppy If you want to run the development version, you can install directly from -Github:: +GitHub:: - $ pip install https://github.com/nucleic/cppy + $ pip install git+https://github.com/nucleic/cppy -Using cppy in an extensions +Using Cppy in an extensions --------------------------- -To use cppy in your extension (written in C++), you simply need to include it. +To use Cppy in your extension (written in C++), you simply need to include it. .. code:: c++ @@ -24,7 +24,7 @@ Cppy includes Python.h so when including cppy.h you do not need to also include Python.h. -Every functions, classes exposed by cppy are stored in the `cppy` namespace. +Every functions, classes exposed by Cppy are stored in the `cppy` namespace. .. code:: c++ @@ -34,9 +34,23 @@ Use with setuptools ------------------- -Cppy is only needed during the installation step of the projects using it. The -following example setup.py script illustrates how to use cppy without requiring -it to be installed before `setup.py` is run. +Cppy is only needed during the installation step of the projects using it. + +When using a PEP 517 compatible build system, one can simply specify cppy as a +build requirement in ```pyproject.toml``:: + + [build-system] + requires = ["setuptools>=42", "wheel", "cppy>=1.2"] + +Which will ensure that cppy is available in setup.py allowing to import it at the +top level of the module. This allows in particular to import ``CppyBuildExt`` +which enforces the use of C++11 and provide access to the cppy headers. On Windows, +FH4 Exception Handling can be disabled by setting the CPPY_DISABLE_FH4 environment +variable. This avoids requiring VCRUNTIME140_1.dll + +In one is not using a PEP 517 compatible install, the following example setup.py +script illustrates how to use Cppy without requiring it to be installed before +`setup.py` is run. .. code:: python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/docs/source/pointer.rst new/cppy-1.2.0/docs/source/pointer.rst --- old/cppy-1.1.0/docs/source/pointer.rst 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/docs/source/pointer.rst 2022-03-11 09:48:45.000000000 +0100 @@ -22,15 +22,16 @@ reference count: - Owned references: - Most functions return a `new` reference which means that you are responsible + Most functions return a ``new`` reference which means that you are responsible for decrefing the object reference count when you are done with it (basically the function increfed the object reference count before returning). In this situation you own a reference. - Borrowed reference: - Some functions (`PyList_GetItem`, `PyTuple_GetItem`) do not incref the object - count before returning. In that case, you have only a borrowed reference, you - are not responsible for decrefing the object reference count. + Some functions (``PyList_GetItem``, ``PyTuple_GetItem``, ``PyDict_GetItem``, ...) + do not incref the object count before returning. In that case, you have only + a borrowed reference, you are not responsible for decrefing the object + reference count. Borrowed references allow to avoid the cost of increfing/decrefing which is nice. However since you do not own the reference, if the object referenced is @@ -47,7 +48,7 @@ it. Note that this does not apply in general to Python container since those are manipulated using functions that take care of it. There are however some exceptions that steals a reference, meaning that you are not the owner of the -reference after the call. `PyList_SetItem`, for example, steal references. +reference after the call. ``PyList_SetItem``, for example, steal references. An easy way to get reference count wrong is forgetting to decref some intermediate object before leaving a function. This is particularly true if the @@ -67,7 +68,7 @@ Cppy smart pointer class ------------------------ -Cppy smart pointer (`cppy::ptr`) can be initialized with a pointer to a Python +Cppy smart pointer (``cppy::ptr``) can be initialized with a pointer to a Python object as follows: .. code:: c++ @@ -88,22 +89,22 @@ .. note:: Cppy provides convenient inline function for common reference manipulation: - - `cppy::incref`, `cppy::xincref`, `cppy::decref`, `cppy::xdecref` use the + - ``cppy::incref``, ``cppy::xincref``, ``cppy::decref``, ``cppy::xdecref`` use the the similarly named Python macros and return the input value. - - `cppy::clear`, `cppy::replace` are similar but return void. + - ``cppy::clear``, ``cppy::replace`` are similar but return void. -You can also initialize a `cppy::ptr` from another `cppy::ptr` in which case +You can also initialize a ``cppy::ptr`` from another ``cppy::ptr`` in which case the reference count will always be incremented. -The main advantage provided by `cppy::ptr` is that it implements a destructor -that will be invoked automatically by the c++ runtime when the `cppy::ptr` +The main advantage provided by ``cppy::ptr`` is that it implements a destructor +that will be invoked automatically by the c++ runtime when the ``cppy::ptr`` goes out of scope. The destructor will decref the reference for you. As a consequence you can be sure that your reference you always be decremented when you leave the function. Sometimes, however, that is not what you want, because you want to return the -reference the `cppy::ptr` manage. You can request the `cppy::ptr` to give back -the reference using its `release` method. Lets illustrate on a tiny example: +reference the ``cppy::ptr`` manage. You can request the ``cppy::ptr`` to give back +the reference using its ``release`` method. Lets illustrate on a tiny example: .. code:: c++ @@ -113,9 +114,9 @@ return repr_ptr.release(); } -Function which are part of Python C-API are not aware of of `cppy::ptr` and -when calling them you need to provide the original `PyObject*`. To access, you -simply need to call the `get` method of the `cppy::ptr` object. +Function which are part of Python C-API are not aware of of ``cppy::ptr`` and +when calling them you need to provide the original ``PyObject*``. To access, you +simply need to call the ``get`` method of the ``cppy::ptr`` object. .. code:: c++ @@ -127,7 +128,7 @@ return l_ptr.release(); } -Here we see that because we use `cppy::ptr` to manage the list, we do not have +Here we see that because we use ``cppy::ptr`` to manage the list, we do not have to worry about decrefing the reference if an exception occurs, the runtime will do it for us. If no exception occurs, we stop managing the reference and we are good. @@ -137,10 +138,10 @@ function that may fail), you can still leak references. However it does alleviate some of the complexity. -Cppy::ptr methods ------------------ +``cppy::ptr`` methods +--------------------- -All methods that takes a `PyObject*` can also accept a `cppy::ptr`. +All methods that takes a ``PyObject*`` can also accept a ``cppy::ptr``. Most names should be self-explanatory, and apart from the is\_ methods most of them rely on the PyObject\_ functions similarly named: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/pyproject.toml new/cppy-1.2.0/pyproject.toml --- old/cppy-1.1.0/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/cppy-1.2.0/pyproject.toml 2022-03-11 09:48:45.000000000 +0100 @@ -0,0 +1,72 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) 2022, Nucleic Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# -------------------------------------------------------------------------------------- + +[project] +name = "cppy" +readme = "README.rst" +requires-python = ">=3.7" +license = {file = "LICENSE"} +authors = [ + {name = "The Nucleic Development Team", email = "sccolb...@gmail.com"} +] +maintainers = [ + {name = "Matthieu C. Dartiailh", email = "m.dartia...@gmail.com"} +] +classifiers = [ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", +] + + +[project.urls] +homepage = "https://github.com/nucleic/cppy" +documentation = "https://cppy.readthedocs.io/en/latest/" +repository = "https://github.com/nucleic/cppy" +changelog = "https://github.com/nucleic/cppy/blob/main/releasenotes.rst" + + +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "cppy/version.py" +write_to_template = """ +# ----------------------------------------------------------------------------- +# Copyright (c) 2014-2022, Nucleic Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ----------------------------------------------------------------------------- +# This file is auto-generated by setuptools-scm do NOT edit it. + +from collections import namedtuple + +#: A namedtuple of the version info for the current release. +_version_info = namedtuple("_version_info", "major minor micro status") + +parts = "{version}".split(".", 3) +__version_info__ = _version_info( + int(parts[0]), + int(parts[1]), + int(parts[2]), + parts[3] if len(parts) == 4 else "", +) + +# Remove everything but the 'version_info' from this module. +del namedtuple, _version_info, parts + +__version__ = "{version}" +""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/releasenotes.rst new/cppy-1.2.0/releasenotes.rst --- old/cppy-1.1.0/releasenotes.rst 2020-03-25 23:12:04.000000000 +0100 +++ new/cppy-1.2.0/releasenotes.rst 2022-03-11 09:48:45.000000000 +0100 @@ -1,7 +1,13 @@ Cppy Release Notes -=================== +================== -1.1.0 - unreleased +1.2.0 - 03/11/2022 +------------------ +- expose a build_ext subclass that can be re-used in other projects PR #16 +- use a PEP 517 compatible install procedure PR #16 +- do not access directly ob_type on PyObject use Py_TYPE + +1.1.0 - 06/25/2020 ------------------ - drop Python 2 support PR #3 - add documentation and tests PR #3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cppy-1.1.0/setup.py new/cppy-1.2.0/setup.py --- old/cppy-1.1.0/setup.py 2020-01-16 02:14:13.000000000 +0100 +++ new/cppy-1.2.0/setup.py 2022-03-11 09:48:45.000000000 +0100 @@ -1,25 +1,20 @@ -#------------------------------------------------------------------------------ -# Copyright (c) 2014-2019, Nucleic +# ------------------------------------------------------------------------------ +# Copyright (c) 2014-2022, Nucleic # # Distributed under the terms of the BSD 3-Clause License. # # The full license is in the file LICENSE, distributed with this software. -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ from setuptools import setup -# Before releasing the version needs to be updated in: -# - setup.py -# - cppy/__init__.py -# - docs/source/conf.py - setup( - name='cppy', - version='1.1.0', - author='The Nucleic Development Team', - author_email='sccolb...@gmail.com', - url='https://github.com/nucleic/cppy', - description='C++ headers for C extension development', - long_description=open('README.rst').read(), - packages=['cppy'], - package_data={'cppy': ['include/cppy/*.h']}, + name="cppy", + author="The Nucleic Development Team", + author_email="sccolb...@gmail.com", + maintainer_email="m.dartia...@gmail.com", + url="https://github.com/nucleic/cppy", + description="C++ headers for C extension development", + long_description=open("README.rst").read(), + packages=["cppy"], + package_data={"cppy": ["include/cppy/*.h"]}, )