From cf6ed0609ac3fcc1829232198ee7cfbd932c6ed0 Mon Sep 17 00:00:00 2001 From: Wong Hoi Sing Edison Date: Mon, 18 Jul 2022 14:40:51 +0800 Subject: [PATCH] alvistack/v2.9.2 git clean -xdf tar zcvf ../python-pybind11_2.9.2.orig.tar.gz --exclude=.git . debuild -uc -us cp python-pybind11.spec ../python-pybind11_2.9.2-2.spec mv ../python*-pybind11*2.9.2*.{gz,xz,spec,dsc} /osc/home\:alvistack/pybind-pybind11-2.9.2/ rm -rf ../*pybind11*2.9.2*.* See https://github.com/pybind/pybind11/pull/3923 Signed-off-by: Wong Hoi Sing Edison --- .github/workflows/ci.yml | 5 +- .github/workflows/upstream.yml | 2 +- .gitignore | 2 + debian/.gitignore | 7 + debian/changelog | 5 + debian/control | 52 ++++++ debian/copyright | 0 debian/pybind11-dev.install | 2 + debian/pybind11-dev.lintian-overrides | 3 + debian/python3-pybind11.lintian-overrides | 4 + debian/rules | 27 +++ debian/source/format | 1 + debian/source/lintian-overrides | 1 + include/pybind11/attr.h | 7 +- include/pybind11/detail/class.h | 4 + include/pybind11/embed.h | 98 +++++----- pybind11/commands.py | 14 +- pyproject.toml | 41 ----- python-pybind11.spec | 207 ++++++++++++++++++++++ setup.cfg | 1 + 20 files changed, 382 insertions(+), 101 deletions(-) create mode 100644 debian/.gitignore create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/pybind11-dev.install create mode 100644 debian/pybind11-dev.lintian-overrides create mode 100644 debian/python3-pybind11.lintian-overrides create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/lintian-overrides delete mode 100644 pyproject.toml create mode 100644 python-pybind11.spec diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c244a5e6f73..46c04d063db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - '3.6' - '3.9' - '3.10' + - '3.11-dev' - 'pypy-3.7' - 'pypy-3.8' @@ -200,8 +201,8 @@ jobs: - python-version: "3.9" python-debug: true valgrind: true - # - python-version: "3.11-dev" - # python-debug: false + - python-version: "3.11-dev" + python-debug: false name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64" runs-on: ubuntu-latest diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 138c9ad292b..81f692e235b 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -14,7 +14,7 @@ env: jobs: standard: - name: "🐍 3.11 dev • ubuntu-latest • x64" + name: "🐍 3.11 latest internals • ubuntu-latest • x64" runs-on: ubuntu-latest if: "contains(github.event.pull_request.labels.*.name, 'python dev')" diff --git a/.gitignore b/.gitignore index 3cf4fbbda02..7d65aa2c0a8 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ pybind11Targets.cmake /pybind11/share/* /docs/_build/* .ipynb_checkpoints/ +.pybuild/ +obj-x86_64-linux-gnu/ diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000000..3a394bd4847 --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,7 @@ +*.substvars +*debhelper* +.debhelper +files +pybind11-dev +python3-pybind11 +tmp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000000..04cc55204e8 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +python-pybind11 (100:2.9.2-2) UNRELEASED; urgency=medium + + * https://github.com/pybind/pybind11/releases/tag/v2.9.2 + + -- Wong Hoi Sing Edison Wed, 06 Jul 2022 06:35:48 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000000..3f135b8027d --- /dev/null +++ b/debian/control @@ -0,0 +1,52 @@ +Source: python-pybind11 +Section: libs +Priority: optional +Standards-Version: 4.5.0 +Maintainer: Wong Hoi Sing Edison +Homepage: https://github.com/pybind/pybind11/tags +Vcs-Browser: https://github.com/alvistack/pybind-pybind11 +Vcs-Git: https://github.com/alvistack/pybind-pybind11.git +Build-Depends: + debhelper, + debhelper-compat (= 10), + dh-python, + cmake (>= 3.4), + fdupes, + python3-dev, + python3-setuptools, + +Package: pybind11-dev +Architecture: all +Section: libdevel +Description: seamless operability between C++11 and Python + pybind11 is a lightweight header library that exposes C++ types in + Python and vice versa, mainly to create Python bindings of existing C++ + code. Its goals and syntax are similar to the excellent Boost.Python + library by David Abrahams: to minimize boilerplate code in traditional + extension modules by inferring type information using compile-time + introspection. + . + This package provides the header-only library. +Depends: + ${misc:Depends}, +Recommends: + libeigen3-dev, + +Package: python3-pybind11 +Architecture: all +Section: python +Description: pybind11 helper module for Python 3 + pybind11 is a lightweight header library that exposes C++ types in + Python and vice versa, mainly to create Python bindings of existing C++ + code. Its goals and syntax are similar to the excellent Boost.Python + library by David Abrahams: to minimize boilerplate code in traditional + extension modules by inferring type information using compile-time + introspection. + . + This package provides pybind11 for Python 3. +Depends: + ${misc:Depends}, + ${python3:Depends}, + pybind11-dev (= ${source:Version}), +Recommends: + python3-numpy, diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000000..e69de29bb2d diff --git a/debian/pybind11-dev.install b/debian/pybind11-dev.install new file mode 100644 index 00000000000..aef9f5a7f73 --- /dev/null +++ b/debian/pybind11-dev.install @@ -0,0 +1,2 @@ +usr/include +usr/share/cmake usr/lib diff --git a/debian/pybind11-dev.lintian-overrides b/debian/pybind11-dev.lintian-overrides new file mode 100644 index 00000000000..11ba2e395e4 --- /dev/null +++ b/debian/pybind11-dev.lintian-overrides @@ -0,0 +1,3 @@ +pybind11-dev: copyright-without-copyright-notice +pybind11-dev: initial-upload-closes-no-bugs +pybind11-dev: zero-byte-file-in-doc-directory diff --git a/debian/python3-pybind11.lintian-overrides b/debian/python3-pybind11.lintian-overrides new file mode 100644 index 00000000000..3872f8a4d94 --- /dev/null +++ b/debian/python3-pybind11.lintian-overrides @@ -0,0 +1,4 @@ +python3-pybind11: copyright-without-copyright-notice +python3-pybind11: initial-upload-closes-no-bugs +python3-pybind11: no-manual-page +python3-pybind11: zero-byte-file-in-doc-directory diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000000..3f4a39bc889 --- /dev/null +++ b/debian/rules @@ -0,0 +1,27 @@ +#!/usr/bin/make -f + +SHELL := /bin/bash + +export PYBUILD_NAME=pybind11 + +override_dh_auto_configure: + dh_auto_configure -- \ + -DPYBIND11_INSTALL="ON" \ + -DPYBIND11_TEST="OFF" + +override_dh_auto_build: + dh_auto_build --buildsystem=pybuild + dh_auto_build + +override_dh_auto_install: + dh_auto_install --buildsystem=pybuild + dh_auto_install + find debian/python3-pybind11/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \; + fdupes -qnrps debian/python3-pybind11/usr/lib/python*/*-packages + +override_dh_auto_test: + +override_dh_auto_clean: + +%: + dh $@ --buildsystem=cmake --with python3 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000000..163aaf8d82b --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 00000000000..5affc64c293 --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1 @@ +python-pybind11 source: no-debian-changes diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index de95f89d0fd..0ae971a64dc 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -345,9 +345,10 @@ struct type_record { bases.append((PyObject *) base_info->type); - if (base_info->type->tp_dictoffset != 0) { - dynamic_attr = true; - } + dynamic_attr |= base_info->type->tp_dictoffset != 0; +#if PY_VERSION_HEX >= 0x030B0000 + dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0; +#endif if (caster) { base_info->implicit_casts.emplace_back(type, caster); diff --git a/include/pybind11/detail/class.h b/include/pybind11/detail/class.h index 0e06b94f10a..f3f69604465 100644 --- a/include/pybind11/detail/class.h +++ b/include/pybind11/detail/class.h @@ -547,8 +547,12 @@ extern "C" inline int pybind11_clear(PyObject *self) { inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) { auto *type = &heap_type->ht_type; type->tp_flags |= Py_TPFLAGS_HAVE_GC; +#if PY_VERSION_HEX < 0x030B0000 type->tp_dictoffset = type->tp_basicsize; // place dict at the end type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it +#else + type->tp_flags |= Py_TPFLAGS_MANAGED_DICT; +#endif type->tp_traverse = pybind11_traverse; type->tp_clear = pybind11_clear; diff --git a/include/pybind11/embed.h b/include/pybind11/embed.h index 683f24280fb..8f48c00991a 100644 --- a/include/pybind11/embed.h +++ b/include/pybind11/embed.h @@ -125,47 +125,6 @@ inline wchar_t *widen_chars(const char *safe_arg) { return widened_arg; } -/// Python 2.x/3.x-compatible version of `PySys_SetArgv` -inline void set_interpreter_argv(int argc, const char *const *argv, bool add_program_dir_to_path) { - // Before it was special-cased in python 3.8, passing an empty or null argv - // caused a segfault, so we have to reimplement the special case ourselves. - bool special_case = (argv == nullptr || argc <= 0); - - const char *const empty_argv[]{"\0"}; - const char *const *safe_argv = special_case ? empty_argv : argv; - if (special_case) { - argc = 1; - } - - auto argv_size = static_cast(argc); -#if PY_MAJOR_VERSION >= 3 - // SetArgv* on python 3 takes wchar_t, so we have to convert. - std::unique_ptr widened_argv(new wchar_t *[argv_size]); - std::vector> widened_argv_entries; - widened_argv_entries.reserve(argv_size); - for (size_t ii = 0; ii < argv_size; ++ii) { - widened_argv_entries.emplace_back(widen_chars(safe_argv[ii])); - if (!widened_argv_entries.back()) { - // A null here indicates a character-encoding failure or the python - // interpreter out of memory. Give up. - return; - } - widened_argv[ii] = widened_argv_entries.back().get(); - } - - auto *pysys_argv = widened_argv.get(); -#else - // python 2.x - std::vector strings{safe_argv, safe_argv + argv_size}; - std::vector char_strings{argv_size}; - for (std::size_t i = 0; i < argv_size; ++i) - char_strings[i] = &strings[i][0]; - char **pysys_argv = char_strings.data(); -#endif - - PySys_SetArgvEx(argc, pysys_argv, static_cast(add_program_dir_to_path)); -} - PYBIND11_NAMESPACE_END(detail) /** \rst @@ -195,9 +154,64 @@ inline void initialize_interpreter(bool init_signal_handlers = true, pybind11_fail("The interpreter is already running"); } +#if PY_VERSION_HEX < 0x030B0000 + Py_InitializeEx(init_signal_handlers ? 1 : 0); - detail::set_interpreter_argv(argc, argv, add_program_dir_to_path); + // Before it was special-cased in python 3.8, passing an empty or null argv + // caused a segfault, so we have to reimplement the special case ourselves. + bool special_case = (argv == nullptr || argc <= 0); + + const char *const empty_argv[]{"\0"}; + const char *const *safe_argv = special_case ? empty_argv : argv; + if (special_case) { + argc = 1; + } + + auto argv_size = static_cast(argc); + // SetArgv* on python 3 takes wchar_t, so we have to convert. + std::unique_ptr widened_argv(new wchar_t *[argv_size]); + std::vector> widened_argv_entries; + widened_argv_entries.reserve(argv_size); + for (size_t ii = 0; ii < argv_size; ++ii) { + widened_argv_entries.emplace_back(detail::widen_chars(safe_argv[ii])); + if (!widened_argv_entries.back()) { + // A null here indicates a character-encoding failure or the python + // interpreter out of memory. Give up. + return; + } + widened_argv[ii] = widened_argv_entries.back().get(); + } + + auto *pysys_argv = widened_argv.get(); + + PySys_SetArgvEx(argc, pysys_argv, static_cast(add_program_dir_to_path)); +#else + PyConfig config; + PyConfig_InitIsolatedConfig(&config); + config.install_signal_handlers = init_signal_handlers ? 1 : 0; + + PyStatus status = PyConfig_SetBytesArgv(&config, argc, const_cast(argv)); + if (PyStatus_Exception(status)) { + // A failure here indicates a character-encoding failure or the python + // interpreter out of memory. Give up. + PyConfig_Clear(&config); + throw std::runtime_error(PyStatus_IsError(status) ? status.err_msg + : "Failed to prepare CPython"); + } + status = Py_InitializeFromConfig(&config); + PyConfig_Clear(&config); + if (PyStatus_Exception(status)) { + throw std::runtime_error(PyStatus_IsError(status) ? status.err_msg + : "Failed to init CPython"); + } + if (add_program_dir_to_path) { + PyRun_SimpleString("import sys, os.path; " + "sys.path.insert(0, " + "os.path.abspath(os.path.dirname(sys.argv[0])) " + "if sys.argv and os.path.exists(sys.argv[0]) else '')"); + } +#endif } /** \rst diff --git a/pybind11/commands.py b/pybind11/commands.py index 11f81d2d6da..e0848121726 100644 --- a/pybind11/commands.py +++ b/pybind11/commands.py @@ -5,17 +5,7 @@ def get_include(user=False): - # type: (bool) -> str - installed_path = os.path.join(DIR, "include") - source_path = os.path.join(os.path.dirname(DIR), "include") - return installed_path if os.path.exists(installed_path) else source_path - + return '/usr/include/pybind11' def get_cmake_dir(): - # type: () -> str - cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11") - if os.path.exists(cmake_installed_path): - return cmake_installed_path - else: - msg = "pybind11 not installed, installation required to access the CMake files" - raise ImportError(msg) + return '/usr/share/cmake/pybind11' diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 7d7a1c82136..00000000000 --- a/pyproject.toml +++ /dev/null @@ -1,41 +0,0 @@ -[build-system] -requires = ["setuptools>=42", "wheel", "cmake>=3.18", "ninja"] -build-backend = "setuptools.build_meta" - -[tool.check-manifest] -ignore = [ - "tests/**", - "docs/**", - "tools/**", - "include/**", - ".*", - "pybind11/include/**", - "pybind11/share/**", - "CMakeLists.txt", - "noxfile.py", -] - -[tool.isort] -# Needs the compiled .so modules and env.py from tests -known_first_party = "env,pybind11_cross_module_tests,pybind11_tests," -# For black compatibility -profile = "black" - -[tool.mypy] -files = "pybind11" -python_version = "2.7" -warn_unused_configs = true - -disallow_any_generics = true -disallow_subclassing_any = true -disallow_untyped_calls = true -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true -disallow_untyped_decorators = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_return_any = true -no_implicit_reexport = true -strict_equality = true diff --git a/python-pybind11.spec b/python-pybind11.spec new file mode 100644 index 00000000000..253a40d8dd5 --- /dev/null +++ b/python-pybind11.spec @@ -0,0 +1,207 @@ +%global debug_package %{nil} + +Name: python-pybind11 +Epoch: 100 +Version: 2.9.2 +Release: 2%{?dist} +BuildArch: noarch +Summary: Seamless operability between C++11 and Python +License: BSD-3-Clause +URL: https://github.com/pybind/pybind11/tags +Source0: %{name}_%{version}.orig.tar.gz +BuildRequires: cmake >= 3.4 +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: make +BuildRequires: python-rpm-macros +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description +pybind11 is a lightweight header-only library that exposes C++ types in +Python and vice versa, mainly to create Python bindings of existing C++ +code. + +%prep +%autosetup -T -c -n %{name}_%{version}-%{release} +tar -zx -f %{S:0} --strip-components=1 -C . + +%build +%py3_build +%cmake \ + -DPYBIND11_INSTALL="ON" \ + -DPYBIND11_TEST="OFF" +%cmake_build + +%install +%py3_install +%cmake_install +find %{buildroot}%{python3_sitelib} -type f -name '*.pyc' -exec rm -rf {} \; +fdupes -qnrps %{buildroot}%{python3_sitelib} +rm -rf %{buildroot}%{_includedir}/python* + +%check + +%if 0%{?suse_version} > 1500 +%package -n python%{python3_version_nodots}-pybind11 +Summary: Module for operability between C++11 and Python +Requires: python3 +Provides: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11 = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pybind11 = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pybind11) = %{epoch}:%{version}-%{release} + +%description -n python%{python3_version_nodots}-pybind11 +pybind11 is a lightweight header-only library that exposes C++ types in +Python and vice versa, mainly to create Python bindings of existing C++ +code. + +%package -n python-pybind11-common-devel +Summary: Development files for pybind11 +Provides: python2-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} + +%description -n python-pybind11-common-devel +This package contains files for developing applications using pybind11. + +%package -n python%{python3_version_nodots}-pybind11-devel +Summary: Development files for pybind11 +Requires: python-pybind11-common-devel = %{epoch}:%{version}-%{release} +Requires: python3-devel +Requires: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pybind11-devel) = %{epoch}:%{version}-%{release} + +%description -n python%{python3_version_nodots}-pybind11-devel +This package contains files for developing applications using pybind11. + +%files -n python%{python3_version_nodots}-pybind11 +%license LICENSE +%{_bindir}/* +%{python3_sitelib}/* +%exclude %{python3_sitelib}/pybind11/include + +%files -n python-pybind11-common-devel +%dir %{_datadir}/cmake +%{_datadir}/cmake/pybind11 +%{_includedir}/pybind11 + +%files -n python%{python3_version_nodots}-pybind11-devel +%{python3_sitelib}/pybind11/include +%endif + +%if 0%{?sle_version} > 150000 +%package -n python3-pybind11 +Summary: Module for operability between C++11 and Python +Requires: python3 +Provides: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11 = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11) = %{epoch}:%{version}-%{release} + +%description -n python3-pybind11 +pybind11 is a lightweight header-only library that exposes C++ types in +Python and vice versa, mainly to create Python bindings of existing C++ +code. + +%package -n python-pybind11-common-devel +Summary: Development files for pybind11 +Provides: python2-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-common-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-common-devel) = %{epoch}:%{version}-%{release} + +%description -n python-pybind11-common-devel +This package contains files for developing applications using pybind11. + +%package -n python3-pybind11-devel +Summary: Development files for pybind11 +Requires: python-pybind11-common-devel = %{epoch}:%{version}-%{release} +Requires: python3-devel +Requires: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-devel) = %{epoch}:%{version}-%{release} + +%description -n python3-pybind11-devel +This package contains files for developing applications using pybind11. + +%files -n python3-pybind11 +%license LICENSE +%{_bindir}/* +%{python3_sitelib}/* +%exclude %{python3_sitelib}/pybind11/include + +%files -n python-pybind11-common-devel +%dir %{_datadir}/cmake +%{_datadir}/cmake/pybind11 +%{_includedir}/pybind11 + +%files -n python3-pybind11-devel +%{python3_sitelib}/pybind11/include +%endif + +%if !(0%{?suse_version} > 1500) && !(0%{?sle_version} > 150000) +%package -n python3-pybind11 +Summary: Seamless operability between C++11 and Python +Requires: python3 +Requires: pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python3-pybind11 = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11 = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pybind11 = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pybind11) = %{epoch}:%{version}-%{release} + +%description -n python3-pybind11 +pybind11 is a lightweight header-only library that exposes C++ types in +Python and vice versa, mainly to create Python bindings of existing C++ +code. + +%package -n pybind11-devel +Summary: Development headers for pybind11 +Requires: cmake +Provides: pybind11-static = %{epoch}:%{version}-%{release} +Provides: python3-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python3dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(pybind11-devel) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-pybind11-devel = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(pybind11-devel) = %{epoch}:%{version}-%{release} + +%description -n pybind11-devel +This package contains the development headers for pybind11. + +%files -n python3-pybind11 +%license LICENSE +%{_bindir}/pybind11-config +%{python3_sitelib}/* +%exclude %{python3_sitelib}/pybind11/include + +%files -n pybind11-devel +%dir %{_datadir}/cmake +%{_datadir}/cmake/pybind11 +%{_includedir}/pybind11 +%{python3_sitelib}/pybind11/include +%endif + +%changelog diff --git a/setup.cfg b/setup.cfg index 317c44bbf63..84af448104a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,6 +21,7 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 License :: OSI Approved :: BSD License Programming Language :: Python :: Implementation :: PyPy Programming Language :: Python :: Implementation :: CPython