├── .git_archival.txt ├── .gitattributes ├── .gitignore ├── .readthedocs.yaml ├── LICENSE ├── MANIFEST.in ├── README.md ├── docs ├── Makefile ├── abi_12.rst ├── abi_13.rst ├── annotations.rst ├── c_api.rst ├── command_line_tools.rst ├── conf.py ├── directives.rst ├── examples.rst ├── index.rst ├── introduction.rst ├── make.bat ├── module_v12_releases.md ├── module_v13_releases.md ├── other_topics.rst ├── pyproject_toml.rst ├── releases.md ├── requirements.in ├── requirements.txt ├── sipbuild_api.rst └── specification_files.rst ├── examples ├── package │ ├── README │ ├── core │ │ ├── README │ │ ├── core.sip │ │ ├── project.py │ │ └── pyproject.toml │ └── extras │ │ ├── README │ │ ├── extras.sip │ │ └── pyproject.toml └── standalone │ ├── README │ ├── fib.sip │ └── pyproject.toml ├── pyproject.toml ├── sipbuild ├── __init__.py ├── abstract_builder.py ├── abstract_project.py ├── api.py ├── argument_parser.py ├── bindings.py ├── buildable.py ├── builder.py ├── configurable.py ├── distinfo │ ├── __init__.py │ └── distinfo.py ├── distutils_builder.py ├── exceptions.py ├── generator │ ├── __init__.py │ ├── bindings_configuration.py │ ├── error_log.py │ ├── instantiations.py │ ├── outputs │ │ ├── __init__.py │ │ ├── api.py │ │ ├── code │ │ │ ├── __init__.py │ │ │ └── code.py │ │ ├── extracts.py │ │ ├── formatters │ │ │ ├── __init__.py │ │ │ ├── argument.py │ │ │ ├── enum.py │ │ │ ├── klass.py │ │ │ ├── misc.py │ │ │ ├── signature.py │ │ │ ├── template.py │ │ │ ├── value_list.py │ │ │ └── variable.py │ │ ├── pyi.py │ │ ├── type_hints.py │ │ └── xml.py │ ├── parser │ │ ├── __init__.py │ │ ├── annotations.py │ │ ├── parser.py │ │ ├── parser_manager.py │ │ ├── ply │ │ │ ├── __init__.py │ │ │ ├── lex.py │ │ │ └── yacc.py │ │ ├── python_exceptions.py │ │ ├── rules.py │ │ └── tokens.py │ ├── python_slots.py │ ├── resolver │ │ ├── __init__.py │ │ └── resolver.py │ ├── scoped_name.py │ ├── specification.py │ ├── templates.py │ └── utils.py ├── installable.py ├── module │ ├── __init__.py │ ├── abi_version.py │ ├── module.py │ └── source │ │ ├── 12 │ │ ├── 9 │ │ │ ├── LICENSE │ │ │ ├── LICENSE-GPL2 │ │ │ ├── LICENSE-GPL3 │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── array.c │ │ │ ├── array.h │ │ │ ├── bool.cpp │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 10 │ │ │ ├── LICENSE │ │ │ ├── LICENSE-GPL2 │ │ │ ├── LICENSE-GPL3 │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── array.c │ │ │ ├── array.h │ │ │ ├── bool.cpp │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 11 │ │ │ ├── LICENSE │ │ │ ├── LICENSE-GPL2 │ │ │ ├── LICENSE-GPL3 │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── bool.cpp │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 12 │ │ │ ├── LICENSE │ │ │ ├── LICENSE-GPL2 │ │ │ ├── LICENSE-GPL3 │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── bool.cpp │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 13 │ │ │ ├── LICENSE │ │ │ ├── LICENSE-GPL2 │ │ │ ├── LICENSE-GPL3 │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── bool.cpp │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 14 │ │ │ ├── LICENSE │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 15 │ │ │ ├── LICENSE │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ ├── 16 │ │ │ ├── LICENSE │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml.in │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ └── 17 │ │ │ ├── LICENSE │ │ │ ├── MANIFEST.in │ │ │ ├── README.in │ │ │ ├── apiversions.c │ │ │ ├── descriptors.c │ │ │ ├── int_convertors.c │ │ │ ├── objmap.c │ │ │ ├── pyproject.toml.in │ │ │ ├── qtlib.c │ │ │ ├── setup.cfg.in │ │ │ ├── setup.py.in │ │ │ ├── sip.h.in │ │ │ ├── sip.pyi │ │ │ ├── sip.rst.in │ │ │ ├── sip_array.c │ │ │ ├── sip_array.h │ │ │ ├── sipint.h │ │ │ ├── siplib.c │ │ │ ├── threads.c │ │ │ └── voidptr.c │ │ └── 13 │ │ ├── 1 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── array.c │ │ ├── array.h │ │ ├── bool.cpp │ │ ├── descriptors.c │ │ ├── int_convertors.c │ │ ├── objmap.c │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sipint.h │ │ ├── siplib.c │ │ ├── threads.c │ │ └── voidptr.c │ │ ├── 2 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── array.c │ │ ├── array.h │ │ ├── bool.cpp │ │ ├── descriptors.c │ │ ├── int_convertors.c │ │ ├── objmap.c │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sipint.h │ │ ├── siplib.c │ │ ├── threads.c │ │ └── voidptr.c │ │ ├── 3 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── array.c │ │ ├── array.h │ │ ├── bool.cpp │ │ ├── descriptors.c │ │ ├── int_convertors.c │ │ ├── objmap.c │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sipint.h │ │ ├── siplib.c │ │ ├── threads.c │ │ └── voidptr.c │ │ ├── 4 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_bool.cpp │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ ├── 5 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_bool.cpp │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ ├── 6 │ │ ├── LICENSE │ │ ├── LICENSE-GPL2 │ │ ├── LICENSE-GPL3 │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_bool.cpp │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ ├── 7 │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ ├── 8 │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ ├── 9 │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml.in │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c │ │ └── 10 │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.in │ │ ├── pyproject.toml.in │ │ ├── setup.cfg.in │ │ ├── setup.py.in │ │ ├── sip.h.in │ │ ├── sip.pyi │ │ ├── sip.rst.in │ │ ├── sip_array.c │ │ ├── sip_array.h │ │ ├── sip_core.c │ │ ├── sip_core.h │ │ ├── sip_descriptors.c │ │ ├── sip_enum.c │ │ ├── sip_enum.h │ │ ├── sip_int_convertors.c │ │ ├── sip_object_map.c │ │ ├── sip_threads.c │ │ └── sip_voidptr.c ├── project.py ├── py_versions.py ├── pyproject.py ├── setuptools_builder.py ├── toml.py ├── tools │ ├── __init__.py │ ├── build.py │ ├── distinfo.py │ ├── install.py │ ├── module.py │ ├── sdist.py │ └── wheel.py └── version.py └── test ├── README.md ├── imported_exceptions ├── __init__.py ├── handler_module.sip ├── test_imported_exceptions.py └── thrower_module.sip ├── int_convertors ├── __init__.py ├── int_convertors_module.sip └── test_int_convertors.py ├── movable ├── __init__.py ├── movable_module.sip └── test_movable.py ├── py_enums ├── __init__.py ├── py_enums_module.sip └── test_py_enums.py ├── py_properties ├── __init__.py ├── py_properties_module.sip └── test_py_properties.py ├── templates ├── __init__.py ├── templates_module.sip └── test_templates.py ├── timelines ├── __init__.py ├── test_timelines.py └── timelines_module.sip └── utils ├── __init__.py └── sip_test_case.py /.git_archival.txt: -------------------------------------------------------------------------------- 1 | node: 4f0ca7fd43b941311e070051f637d931e17fa5d7 2 | node-date: 2025-06-03T14:59:00+01:00 3 | describe-name: 6.12.0 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | .git_archival.txt export-subst 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local additions to Python.gitignore from GitHub. 2 | sipbuild/_version.py 3 | test/*/*.pyd 4 | test/*/*.so 5 | test/*/*.tar.gz 6 | test/*/*/* 7 | 8 | # Byte-compiled / optimized / DLL files 9 | __pycache__/ 10 | *.py[cod] 11 | *$py.class 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | share/python-wheels/ 28 | *.egg-info/ 29 | .installed.cfg 30 | *.egg 31 | MANIFEST 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .nox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | *.py,cover 48 | .hypothesis/ 49 | .pytest_cache/ 50 | cover/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Sphinx documentation 57 | docs/_build/ 58 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the OS, Python version and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.12" 13 | 14 | # Build documentation in the "docs/" directory with Sphinx 15 | sphinx: 16 | configuration: docs/conf.py 17 | 18 | # Optionally build your docs in additional formats such as PDF and ePub 19 | # formats: 20 | # - pdf 21 | # - epub 22 | 23 | # Optional but recommended, declare the Python requirements required 24 | # to build your documentation 25 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 26 | python: 27 | install: 28 | - requirements: docs/requirements.txt 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2025 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | exclude .git* 2 | exclude .readthedocs.yaml 3 | prune docs 4 | prune examples 5 | prune test 6 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | from datetime import date 7 | 8 | 9 | # -- Project information ----------------------------------------------------- 10 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 11 | 12 | project = 'sip' 13 | copyright = '{0} Phil Thompson '.format( 14 | date.today().year) 15 | author = 'Phil Thompson' 16 | version = 'v6.12.0' 17 | 18 | 19 | # -- General configuration --------------------------------------------------- 20 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 21 | 22 | extensions = ['myst_parser', 'sphinx.ext.intersphinx'] 23 | intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} 24 | 25 | #templates_path = ['_templates'] 26 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 27 | 28 | 29 | # -- Options for HTML output ------------------------------------------------- 30 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 31 | 32 | html_theme = 'sphinx_rtd_theme' 33 | #html_static_path = ['_static'] 34 | 35 | 36 | # MyST configuration 37 | myst_enable_extensions = {'deflist'} 38 | 39 | 40 | # -- Project-specific extensions ----------------------------------------------- 41 | 42 | def setup(app): 43 | """ Define roles specific to SIP. """ 44 | 45 | app.add_object_type('argument-annotation', 'aanno', 46 | indextemplate='single: %s (argument annotation)') 47 | 48 | app.add_object_type('class-annotation', 'canno', 49 | indextemplate='single: %s (class annotation)') 50 | 51 | app.add_object_type('enum-annotation', 'eanno', 52 | indextemplate='single: %s (enum annotation)') 53 | 54 | app.add_object_type('exception-annotation', 'xanno', 55 | indextemplate='single: %s (exception annotation)') 56 | 57 | app.add_object_type('function-annotation', 'fanno', 58 | indextemplate='single: %s (function annotation)') 59 | 60 | app.add_object_type('mapped-type-annotation', 'manno', 61 | indextemplate='single: %s (mapped type annotation)') 62 | 63 | app.add_object_type('typedef-annotation', 'tanno', 64 | indextemplate='single: %s (typedef annotation)') 65 | 66 | app.add_object_type('variable-annotation', 'vanno', 67 | indextemplate='single: %s (variable annotation)') 68 | 69 | app.add_object_type('sip-type', 'stype', 70 | indextemplate='single: %s (SIP type)') 71 | 72 | app.add_crossref_type('directive', 'directive', 73 | indextemplate='single: %s (directive)') 74 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | SIP Documentation 2 | ================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents 7 | 8 | introduction 9 | examples 10 | command_line_tools 11 | specification_files 12 | directives 13 | annotations 14 | other_topics 15 | c_api 16 | abi_13 17 | abi_12 18 | pyproject_toml 19 | sipbuild_api 20 | module_v13_releases 21 | module_v12_releases 22 | releases 23 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/module_v12_releases.md: -------------------------------------------------------------------------------- 1 | # `sip` Module v12 History 2 | 3 | 4 | ## v12.17 5 | 6 | - Added the `SIP_ABI_VERSION` module attribute. 7 | 8 | 9 | ## v12.16 10 | 11 | - Added support for the `/Deprecated/` annotation accepting an optional string. 12 | - The buffer protocol support for byte objects was fixed. (Resolves 13 | [#36](https://github.com/Python-SIP/sip/issues/36)) 14 | - Removed support for Python v3.8. 15 | 16 | 17 | ## v12.15 18 | 19 | - Conversions to and from `char` and Python integer objects on architectures 20 | where `char` was unsigned (eg. Linux on ARM) have been fixed. (Resolves 21 | [#29](https://github.com/Python-SIP/sip/issues/29)) 22 | 23 | 24 | ## v12.14 25 | 26 | - Relicensed under the BSD-2-Clause license. 27 | - Potential overflow problems on Windows 64 were fixed. (Resolves 28 | [#14](https://github.com/Python-SIP/sip/issues/14)) 29 | - C99 support is required. `_Bool`, `stdbool.h` and `va_copy` are assumed to 30 | be available on all supported platforms. (Resolves 31 | [#13](https://github.com/Python-SIP/sip/issues/13)) 32 | - Added support for Python v3.13. 33 | - Removed support for Python v3.7. 34 | 35 | 36 | ## v12.13 37 | 38 | - Added support for Python v3.12. 39 | - Added `sipPyTypeDictRef()` to the public API. 40 | - Deprecated `sipPyTypeDict()` in the public API. 41 | 42 | 43 | ## v12.12 44 | 45 | - A bug related to constructors with the `/Transfer/` annotation was fixed. 46 | - A garbage collection bug was fixed. 47 | 48 | 49 | ## v12.11 50 | 51 | - Added support for `sip.array`. 52 | 53 | 54 | ## v12.10 55 | 56 | - Added support for Python v3.11. 57 | - Removed support for Python v3.6. 58 | -------------------------------------------------------------------------------- /docs/module_v13_releases.md: -------------------------------------------------------------------------------- 1 | # `sip` Module v13 History 2 | 3 | 4 | ## v13.10 5 | 6 | - Added the `SIP_ABI_VERSION` module attribute. 7 | 8 | 9 | ## v13.9 10 | 11 | - Added support for the `/Deprecated/` annotation accepting an optional string. 12 | - The buffer protocol support for byte objects was fixed. (Resolves 13 | [#36](https://github.com/Python-SIP/sip/issues/36)) 14 | - Removed support for Python v3.8. 15 | 16 | 17 | ## v13.8 18 | 19 | - Conversions to and from `char` and Python integer objects on architectures 20 | where `char` was unsigned (eg. Linux on ARM) have been fixed. (Resolves 21 | [#29](https://github.com/Python-SIP/sip/issues/29)) 22 | 23 | 24 | ## v13.7 25 | 26 | - Relicensed under the BSD-2-Clause license. 27 | - Potential overflow problems on Windows 64 were fixed. (Resolves 28 | [#14](https://github.com/Python-SIP/sip/issues/14)) 29 | - C99 support is required. `_Bool`, `stdbool.h` and `va_copy` are assumed to 30 | be available on all supported platforms. (Resolves 31 | [#13](https://github.com/Python-SIP/sip/issues/13)) 32 | - Added support for Python v3.13. 33 | - Removed support for Python v3.7. 34 | 35 | 36 | ## v13.6 37 | 38 | - Added support for Python v3.12. 39 | - Added `sipPyTypeDictRef()` to the public API. 40 | - Deprecated `sipPyTypeDict()` in the public API. 41 | 42 | 43 | ## v13.5 44 | 45 | - A bug related to constructors with the `/Transfer/` annotation was fixed. 46 | - A garbage collection bug was fixed. 47 | 48 | 49 | ## v13.4 50 | 51 | - Added support for `sip.array`. 52 | - Enums with unexpected values are supported by automatically creating 53 | corresponding pseudo-members. 54 | 55 | 56 | ## v13.3 57 | 58 | - Added support for Python v3.11. 59 | - Removed support for Python v3.6. 60 | 61 | 62 | ## v13.2 63 | 64 | - Added support for enums with unsigned values. 65 | -------------------------------------------------------------------------------- /docs/requirements.in: -------------------------------------------------------------------------------- 1 | # Rin `pip-compile requirements.in` to create requirements.txt 2 | sphinx==7.2.6 3 | sphinx_rtd_theme==2.0.0 4 | myst_parser==2.0.0 5 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.12 3 | # by the following command: 4 | # 5 | # pip-compile requirements.in 6 | # 7 | alabaster==0.7.16 8 | # via sphinx 9 | babel==2.14.0 10 | # via sphinx 11 | certifi==2023.11.17 12 | # via requests 13 | charset-normalizer==3.3.2 14 | # via requests 15 | docutils==0.20.1 16 | # via 17 | # myst-parser 18 | # sphinx 19 | # sphinx-rtd-theme 20 | idna==3.6 21 | # via requests 22 | imagesize==1.4.1 23 | # via sphinx 24 | jinja2==3.1.3 25 | # via 26 | # myst-parser 27 | # sphinx 28 | markdown-it-py==3.0.0 29 | # via 30 | # mdit-py-plugins 31 | # myst-parser 32 | markupsafe==2.1.4 33 | # via jinja2 34 | mdit-py-plugins==0.4.0 35 | # via myst-parser 36 | mdurl==0.1.2 37 | # via markdown-it-py 38 | myst-parser==2.0.0 39 | # via -r requirements.in 40 | packaging==23.2 41 | # via sphinx 42 | pygments==2.17.2 43 | # via sphinx 44 | pyyaml==6.0.1 45 | # via myst-parser 46 | requests==2.31.0 47 | # via sphinx 48 | snowballstemmer==2.2.0 49 | # via sphinx 50 | sphinx==7.2.6 51 | # via 52 | # -r requirements.in 53 | # myst-parser 54 | # sphinx-rtd-theme 55 | # sphinxcontrib-jquery 56 | sphinx-rtd-theme==2.0.0 57 | # via -r requirements.in 58 | sphinxcontrib-applehelp==1.0.8 59 | # via sphinx 60 | sphinxcontrib-devhelp==1.0.6 61 | # via sphinx 62 | sphinxcontrib-htmlhelp==2.0.5 63 | # via sphinx 64 | sphinxcontrib-jquery==4.1 65 | # via sphinx-rtd-theme 66 | sphinxcontrib-jsmath==1.0.1 67 | # via sphinx 68 | sphinxcontrib-qthelp==1.0.7 69 | # via sphinx 70 | sphinxcontrib-serializinghtml==1.1.10 71 | # via sphinx 72 | urllib3==2.1.0 73 | # via requests 74 | -------------------------------------------------------------------------------- /examples/package/README: -------------------------------------------------------------------------------- 1 | Before running any of the examples in this directory you need to create and 2 | install the sip module that they all rely on. To do this, run: 3 | 4 | sip-module --sdist examples.sip 5 | pip install examples_sip-X.Y.Z.tar.gz 6 | -------------------------------------------------------------------------------- /examples/package/core/README: -------------------------------------------------------------------------------- 1 | This is the 'root' project of the examples package (i.e. it does not import any 2 | other module in the package (other than the examples.sip module). 3 | -------------------------------------------------------------------------------- /examples/package/core/core.sip: -------------------------------------------------------------------------------- 1 | // Define the SIP wrapper to the core library. 2 | 3 | %Module(name=examples.core, use_limited_api=True) 4 | 5 | %DefaultEncoding "ASCII" 6 | 7 | %Platforms {Linux macOS Windows} 8 | 9 | %If (Linux) 10 | const char *what_am_i(); 11 | %MethodCode 12 | sipRes = "Linux"; 13 | %End 14 | %End 15 | 16 | %If (macOS) 17 | const char *what_am_i(); 18 | %MethodCode 19 | sipRes = "macOS"; 20 | %End 21 | %End 22 | 23 | %If (Windows) 24 | const char *what_am_i(); 25 | %MethodCode 26 | sipRes = "Windows"; 27 | %End 28 | %End 29 | -------------------------------------------------------------------------------- /examples/package/core/project.py: -------------------------------------------------------------------------------- 1 | from sipbuild import Option, Project, PyProjectOptionException 2 | 3 | 4 | class CoreProject(Project): 5 | """ A project that adds an additional configuration option and introspects 6 | the system to determine its value. 7 | """ 8 | 9 | def get_options(self): 10 | """ Return the sequence of configurable options. """ 11 | 12 | # Get the standard options. 13 | options = super().get_options() 14 | 15 | # Add our new option. 16 | options.append(Option('platform')) 17 | 18 | return options 19 | 20 | def apply_nonuser_defaults(self, tool): 21 | """ Apply any non-user defaults. """ 22 | 23 | if self.platform is None: 24 | # The option wasn't specified in pyproject.toml so we introspect 25 | # the system. 26 | 27 | from sys import platform 28 | 29 | if platform == 'linux': 30 | self.platform = 'Linux' 31 | elif platform == 'darwin': 32 | self.platform = 'macOS' 33 | elif platform == 'win32': 34 | self.platform = 'Windows' 35 | else: 36 | raise PyProjectOptionException('platform', 37 | "the '{0}' platform is not supported".format(platform)) 38 | else: 39 | # The option was set in pyproject.toml so we just verify the value. 40 | if self.platform not in ('Linux', 'macOS', 'Windows'): 41 | raise PyProjectOptionException('platform', 42 | "'{0}' is not a valid platform".format(self.platform)) 43 | 44 | # Apply the defaults for the standard options. 45 | super().apply_nonuser_defaults(tool) 46 | 47 | def update(self, tool): 48 | """ Update the project configuration. """ 49 | 50 | # Get the 'core' bindings and add the platform to the list of tags. 51 | core_bindings = self.bindings['core'] 52 | core_bindings.tags.append(self.platform) 53 | -------------------------------------------------------------------------------- /examples/package/core/pyproject.toml: -------------------------------------------------------------------------------- 1 | # Specify sip v6 as the build system for the package. 2 | [build-system] 3 | requires = ["sip >=6, <7"] 4 | build-backend = "sipbuild.api" 5 | 6 | # Specify the PEP 621 metadata for the project. 7 | [project] 8 | name = "examples-core" 9 | 10 | # Specify each set of bindings. 11 | [tool.sip.bindings.core] 12 | 13 | # Configure the project itself. 14 | [tool.sip.project] 15 | sip-module = "examples.sip" 16 | dunder-init = true 17 | -------------------------------------------------------------------------------- /examples/package/extras/README: -------------------------------------------------------------------------------- 1 | This is a separate project to the 'examples-core' project (possibly with a 2 | different maintainer) that extends the 'extras' bindings to the 'example' 3 | package. 4 | -------------------------------------------------------------------------------- /examples/package/extras/extras.sip: -------------------------------------------------------------------------------- 1 | // Define the SIP wrapper to the extras library. 2 | 3 | %Module(name=examples.extras, use_limited_api=True) 4 | 5 | %Import core/core.sip 6 | 7 | %If (!Windows) 8 | bool am_i_posix(); 9 | %MethodCode 10 | sipRes = true; 11 | %End 12 | %End 13 | 14 | %If (Windows) 15 | bool am_i_posix(); 16 | %MethodCode 17 | sipRes = false; 18 | %End 19 | %End 20 | -------------------------------------------------------------------------------- /examples/package/extras/pyproject.toml: -------------------------------------------------------------------------------- 1 | # Specify sip v6 as the build system for the package. 2 | [build-system] 3 | requires = ["sip >=6, <7"] 4 | build-backend = "sipbuild.api" 5 | 6 | # Specify the PEP 621 metadata for the project. 7 | [project] 8 | name = "examples-extras" 9 | dependencies = ["examples-core"] 10 | 11 | # Specify each set of bindings. 12 | [tool.sip.bindings.extras] 13 | 14 | # Configure the project itself. 15 | [tool.sip.project] 16 | sip-module = "examples.sip" 17 | -------------------------------------------------------------------------------- /examples/standalone/README: -------------------------------------------------------------------------------- 1 | To create and install the extension module, run: 2 | 3 | sip-install 4 | or 5 | pip install . 6 | 7 | To create and install an sdist, run:: 8 | 9 | sip-sdist 10 | pip install fib-0.1.tar.gz 11 | 12 | To create and install a wheel, run:: 13 | 14 | sip-wheel 15 | pip install fib-0.1-*.whl 16 | 17 | To uninstall the extension module, run: 18 | 19 | pip uninstall fib 20 | -------------------------------------------------------------------------------- /examples/standalone/fib.sip: -------------------------------------------------------------------------------- 1 | // Define the SIP wrapper to the (theoretical) fib library. 2 | 3 | %Module(name=fib, language="C") 4 | 5 | int fib_n(int n); 6 | %MethodCode 7 | if (a0 <= 0) 8 | { 9 | sipRes = 0; 10 | } 11 | else 12 | { 13 | int a = 0, b = 1, c, i; 14 | 15 | for (i = 2; i <= a0; i++) 16 | { 17 | c = a + b; 18 | a = b; 19 | b = c; 20 | } 21 | 22 | sipRes = b; 23 | } 24 | %End 25 | -------------------------------------------------------------------------------- /examples/standalone/pyproject.toml: -------------------------------------------------------------------------------- 1 | # Specify sip v6 as the build system for the package. 2 | [build-system] 3 | requires = ["sip >=6, <7"] 4 | build-backend = "sipbuild.api" 5 | 6 | # Specify the PEP 621 metadata for the project. 7 | [project] 8 | name = "fib" 9 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # The project configuration for sip. 2 | 3 | [build-system] 4 | requires = ["setuptools>=77", "setuptools_scm>=8"] 5 | build-backend = "setuptools.build_meta" 6 | 7 | [tool.setuptools_scm] 8 | version_file = "sipbuild/_version.py" 9 | 10 | [project] 11 | name = "sip" 12 | description = "A Python bindings generator for C/C++ libraries" 13 | readme = "README.md" 14 | urls.homepage = "https://github.com/Python-SIP/sip" 15 | dependencies = ["packaging>=24.2", "setuptools>=75.8.1", "tomli; python_version<'3.11'"] 16 | requires-python = ">=3.9" 17 | license = "BSD-2-Clause" 18 | license-files = ["LICENSE"] 19 | dynamic = ["version"] 20 | 21 | [[project.authors]] 22 | name = "Phil Thompson" 23 | email = "phil@riverbankcomputing.com" 24 | 25 | [project.scripts] 26 | sip-distinfo = "sipbuild.tools.distinfo:main" 27 | sip-module = "sipbuild.tools.module:main" 28 | sip-build = "sipbuild.tools.build:main" 29 | sip-install = "sipbuild.tools.install:main" 30 | sip-sdist = "sipbuild.tools.sdist:main" 31 | sip-wheel = "sipbuild.tools.wheel:main" 32 | -------------------------------------------------------------------------------- /sipbuild/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the public API. 7 | from .abstract_builder import AbstractBuilder 8 | from .abstract_project import AbstractProject 9 | from .bindings import Bindings 10 | from .buildable import (Buildable, BuildableBindings, BuildableExecutable, 11 | BuildableFromSources, BuildableModule) 12 | from .builder import Builder 13 | from .configurable import Option 14 | from .exceptions import handle_exception, UserException 15 | from .installable import Installable 16 | from .project import Project 17 | from .pyproject import (PyProjectOptionException, 18 | PyProjectUndefinedOptionException) 19 | from .setuptools_builder import SetuptoolsBuilder 20 | from .version import SIP_VERSION, SIP_VERSION_STR 21 | 22 | # This is deprecated so allow it to fail. 23 | try: 24 | from .distutils_builder import DistutilsBuilder 25 | except ImportError: 26 | pass 27 | -------------------------------------------------------------------------------- /sipbuild/abstract_builder.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from abc import ABC, abstractmethod 7 | 8 | from .configurable import Configurable 9 | 10 | 11 | class AbstractBuilder(Configurable, ABC): 12 | """ This specifies the API of a builder. """ 13 | 14 | def __init__(self, project, **kwargs): 15 | """ Initialise the builder. """ 16 | 17 | super().__init__() 18 | 19 | self.project = project 20 | 21 | self.initialise_options(kwargs) 22 | 23 | @abstractmethod 24 | def build(self): 25 | """ Build the project in-situ. """ 26 | 27 | @abstractmethod 28 | def build_sdist(self, sdist_directory): 29 | """ Build an sdist for the project and return the name of the sdist 30 | file. 31 | """ 32 | 33 | @abstractmethod 34 | def build_wheel(self, wheel_directory): 35 | """ Build a wheel for the project and return the name of the wheel 36 | file. 37 | """ 38 | 39 | @abstractmethod 40 | def install(self): 41 | """ Install the project. """ 42 | -------------------------------------------------------------------------------- /sipbuild/api.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from .abstract_project import AbstractProject 7 | from .exceptions import handle_exception 8 | 9 | 10 | def build_sdist(sdist_directory, config_settings=None): 11 | """ The PEP 517 hook for building an sdist from pyproject.toml. """ 12 | 13 | project = AbstractProject.bootstrap('sdist', 14 | arguments=_convert_config_settings(config_settings)) 15 | 16 | # pip executes this in a separate process and doesn't handle exceptions 17 | # very well. However it does capture stdout and (eventually) show it to 18 | # the user so we use our standard exception handling. 19 | try: 20 | return project.build_sdist(sdist_directory) 21 | except Exception as e: 22 | handle_exception(e) 23 | 24 | 25 | def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): 26 | """ The PEP 517 hook for building a wheel from pyproject.toml. """ 27 | 28 | project = AbstractProject.bootstrap('wheel', 29 | arguments=_convert_config_settings(config_settings)) 30 | 31 | # pip executes this in a separate process and doesn't handle exceptions 32 | # very well. However it does capture stdout and (eventually) show it to 33 | # the user so we use our standard exception handling. 34 | try: 35 | return project.build_wheel(wheel_directory) 36 | except Exception as e: 37 | handle_exception(e) 38 | 39 | 40 | def _convert_config_settings(config_settings): 41 | """ Return any configuration settings from the frontend to a pseudo-command 42 | line. 43 | """ 44 | 45 | if config_settings is None: 46 | config_settings = {} 47 | 48 | args = [] 49 | 50 | for name, value in config_settings.items(): 51 | if value: 52 | if not isinstance(value, list): 53 | value = [value] 54 | 55 | for m_value in value: 56 | args.append(name + '=' + m_value) 57 | else: 58 | args.append(name) 59 | 60 | return args 61 | -------------------------------------------------------------------------------- /sipbuild/argument_parser.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from argparse import ArgumentParser as ArgParser 7 | 8 | from ._version import version 9 | 10 | 11 | class ArgumentParser(ArgParser): 12 | """ An argument parser for all sip command line tools. """ 13 | 14 | def __init__(self, description, build_tool=False, **kwargs): 15 | """ Initialise the parser. """ 16 | 17 | super().__init__(description=description, **kwargs) 18 | 19 | self.add_argument('-V', '--version', action='version', version=version) 20 | 21 | # This option is handled by the bootstrap process and is only here to 22 | # contribute to the help. 23 | if build_tool: 24 | self.add_argument('--deprecations-are-errors', action='store_true', 25 | help="using deprecated features is an error") 26 | -------------------------------------------------------------------------------- /sipbuild/distinfo/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .distinfo import create_distinfo, distinfo, write_metadata 8 | -------------------------------------------------------------------------------- /sipbuild/generator/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .parser import parse 8 | from .resolver import resolve 9 | -------------------------------------------------------------------------------- /sipbuild/generator/bindings_configuration.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | import os 7 | 8 | from ..exceptions import UserFileException, UserParseException 9 | from ..toml import toml_load 10 | 11 | 12 | def get_bindings_configuration(spec, sip_file, sip_include_dirs): 13 | """ Get the configuration of a set of bindings. """ 14 | 15 | # We make no assumption about the name of the .sip file but we assume that 16 | # the directory it is in is the name of the bindings. 17 | bindings_name = os.path.basename(os.path.dirname(sip_file)) 18 | 19 | # See if there is a .toml file. 20 | for sip_dir in sip_include_dirs: 21 | toml_file = os.path.join(sip_dir, bindings_name, 22 | bindings_name + '.toml') 23 | 24 | if os.path.isfile(toml_file): 25 | break 26 | else: 27 | return [], [] 28 | 29 | # Read the configuration. 30 | try: 31 | cfg = toml_load(toml_file) 32 | except Exception as e: 33 | raise UserParseException(toml_file, detail=str(e)) 34 | 35 | # Check the major ABI versions are the same. 36 | cfg_abi_version = cfg.get('sip-abi-version') 37 | if cfg_abi_version is None or not isinstance(cfg_abi_version, str): 38 | raise UserFileException(toml_file, 39 | "'sip-abi-version' must be specified as a string") 40 | 41 | cfg_abi_major = int(cfg_abi_version.split('.')[0]) 42 | 43 | if spec.target_abi is None: 44 | # Infer the target ABI major version if we don't yet know it. 45 | spec.target_abi = (cfg_abi_major, None) 46 | else: 47 | major_version = spec.target_abi[0] 48 | if cfg_abi_major != major_version: 49 | raise UserFileException(toml_file, 50 | f"'{bindings_name}' was built against ABI v{cfg_abi_major} " 51 | "but this module is being built against ABI v{major_version}") 52 | 53 | # Return the tags and disabled features. 54 | return (_get_string_list(toml_file, cfg, 'module-tags'), 55 | _get_string_list(toml_file, cfg, 'module-disabled-features')) 56 | 57 | 58 | def _get_string_list(toml_file, cfg, name): 59 | """ Get an option from the configuration and check it is a list of strings. 60 | """ 61 | 62 | option_list = cfg.get(name) 63 | if option_list is None: 64 | option_list = list() 65 | elif not isinstance(option_list, list): 66 | raise UserFileException(toml_file, "'{0}' must be a list".format(name)) 67 | 68 | for option in option_list: 69 | if not isinstance(option, str): 70 | raise UserFileException(toml_file, 71 | "elements of '{0}' must be strings".format(name)) 72 | 73 | return option_list 74 | -------------------------------------------------------------------------------- /sipbuild/generator/error_log.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ..exceptions import UserException 7 | 8 | 9 | class ErrorLog: 10 | """ This object logs errors and raises a corresponding exception when 11 | requested. 12 | """ 13 | 14 | def __init__(self): 15 | """ Initialise the error log. """ 16 | 17 | self._errors = [] 18 | 19 | def log(self, text, source_location=None): 20 | """ Log an error with an optional source location. """ 21 | 22 | # Format the entry. 23 | if source_location is None: 24 | entry = '' 25 | else: 26 | entry = source_location.sip_file + ": " 27 | 28 | if source_location.line > 0: 29 | entry += "line {0}: ".format(source_location.line) 30 | 31 | if source_location.column > 0: 32 | entry += "column {0}: ".format(source_location.column) 33 | 34 | entry += text 35 | 36 | self._errors.append(entry) 37 | 38 | def as_exception(self): 39 | """ Raise a UserException for any logged errors. """ 40 | 41 | if self._errors: 42 | raise UserException('\n'.join(self._errors)) 43 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .api import output_api 8 | from .code import output_code 9 | from .extracts import output_extract 10 | from .pyi import output_pyi 11 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/code/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .code import output_code 8 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/extracts.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ...exceptions import UserException 7 | 8 | 9 | def output_extract(spec, extract_ref): 10 | """ Output an extract. """ 11 | 12 | # Get the id and file name from the reference. 13 | extract_id, _, extract_file = extract_ref.partition(':') 14 | if not extract_file: 15 | raise UserException( 16 | "an extract must be in the form 'id:file', not '{0}'".format( 17 | extract_ref)) 18 | 19 | # Get all the parts of this extract. 20 | ordered_parts = [] 21 | appended_parts = [] 22 | 23 | for extract in spec.extracts: 24 | if extract.id == extract_id: 25 | if extract.order < 0: 26 | appended_parts.append(extract) 27 | else: 28 | ordered_parts.append(extract) 29 | 30 | # Put the parts in the correct order. 31 | ordered_parts.sort(key=lambda e: e.order) 32 | ordered_parts.extend(appended_parts) 33 | 34 | if len(ordered_parts) == 0: 35 | raise UserException( 36 | "there is no extract defined with the identifier '{0}'".format( 37 | extract_id)) 38 | 39 | # Write the parts to the file. 40 | with open(extract_file, 'w', encoding='UTF-8') as ef: 41 | for extract_part in ordered_parts: 42 | ef.write(extract_part.text) 43 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .argument import (fmt_argument_as_cpp_type, fmt_argument_as_name, 8 | fmt_argument_as_py_default_value, fmt_argument_as_py_type, 9 | fmt_argument_as_rest_ref, fmt_argument_as_type_hint) 10 | from .enum import (fmt_enum_as_cpp_type, fmt_enum_as_rest_ref, 11 | fmt_enum_as_type_hint) 12 | from .klass import (fmt_class_as_rest_ref, fmt_class_as_scoped_name, 13 | fmt_class_as_type_hint) 14 | from .misc import fmt_copying, fmt_scoped_py_name 15 | from .signature import (fmt_signature_as_cpp_declaration, 16 | fmt_signature_as_cpp_definition, fmt_signature_as_type_hint) 17 | from .value_list import (fmt_value_list_as_cpp_expression, 18 | fmt_value_list_as_rest_ref) 19 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/enum.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ...scoped_name import STRIP_NONE 7 | from ...specification import IfaceFileType 8 | 9 | from .misc import fmt_scoped_py_name, iface_is_defined 10 | 11 | 12 | def fmt_enum_member_as_rest_ref(enum_member): 13 | """ Return the fully qualified Python name of a member as a reST reference. 14 | """ 15 | 16 | enum = enum_member.scope 17 | module_name = enum.module.fq_py_name.name 18 | 19 | if enum.py_name is None: 20 | member_name = fmt_scoped_py_name(enum.scope, enum_member.py_name.name) 21 | 22 | return f':sip:ref:`~{module_name}.{member_name}`' 23 | 24 | enum_name = fmt_scoped_py_name(enum.scope, enum.py_name.name) 25 | member_name = enum_member.py_name.name 26 | 27 | return f':sip:ref:`~{module_name}.{enum_name}.{member_name}`' 28 | 29 | 30 | def fmt_enum_as_cpp_type(enum, make_public=False, strip=STRIP_NONE): 31 | """ Return an enum's fully qualified C++ type name. """ 32 | 33 | if enum.fq_cpp_name is None or (enum.is_protected and not make_public): 34 | return 'int' 35 | 36 | return enum.fq_cpp_name.cpp_stripped(strip) 37 | 38 | 39 | def fmt_enum_as_rest_ref(enum): 40 | """ Return a fully qualified Python name as a reST reference. """ 41 | 42 | module_name = enum.module.fq_py_name.name 43 | enum_name = fmt_scoped_py_name(enum.scope, enum.py_name.name) 44 | 45 | return f':sip:ref:`~{module_name}.{enum_name}`' 46 | 47 | 48 | def fmt_enum_as_type_hint(spec, enum, defined): 49 | """ Return the type hint. """ 50 | 51 | module = spec.module 52 | 53 | if enum.scope is None: 54 | # Global enums are defined early on. 55 | is_defined = True 56 | else: 57 | scope_iface = enum.scope.iface_file 58 | outer_scope = enum.scope.scope if scope_iface.type is IfaceFileType.CLASS else None 59 | 60 | is_defined = iface_is_defined(scope_iface, outer_scope, module, 61 | defined) 62 | 63 | quote = '' if is_defined else "'" 64 | 65 | # Include the module name if it is not the current one. 66 | module_name = enum.module.py_name + '.' if enum.module is not module and defined is not None else '' 67 | py_name = fmt_scoped_py_name(enum.scope, enum.py_name.name) 68 | 69 | return f'{quote}{module_name}{py_name}{quote}' 70 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/klass.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ...scoped_name import STRIP_NONE 7 | 8 | from .misc import fmt_scoped_py_name, iface_is_defined 9 | from .template import fmt_template_as_cpp_type 10 | 11 | 12 | def fmt_class_as_rest_ref(klass): 13 | """ Return a fully qualified Python name as a reST reference. """ 14 | 15 | module_name = klass.iface_file.module.fq_py_name.name 16 | klass_name = fmt_scoped_py_name(klass.scope, klass.py_name.name) 17 | 18 | return f':sip:ref:`~{module_name}.{klass_name}`' 19 | 20 | 21 | def fmt_class_as_scoped_name(spec, klass, scope=None, strip=STRIP_NONE, 22 | make_public=False, as_xml=False): 23 | """ Return a class's scoped name. """ 24 | 25 | if klass.no_type_name: 26 | return fmt_template_as_cpp_type(spec, klass.template, strip=strip, 27 | as_xml=as_xml) 28 | 29 | # Protected classes have to be explicitly scoped. 30 | if klass.is_protected and not make_public: 31 | # This should never happen. 32 | if scope is None: 33 | scope = klass.iface_file 34 | 35 | return f'sip{scope.fq_cpp_name.as_word}::sip{klass.iface_file.fq_cpp_name.base_name}' 36 | 37 | return klass.iface_file.fq_cpp_name.cpp_stripped(strip) 38 | 39 | 40 | def fmt_class_as_type_hint(spec, klass, defined): 41 | """ Return the type hint. """ 42 | 43 | module = spec.module 44 | 45 | # We assume that an external class will be handled properly by some 46 | # handwritten type hint code. 47 | quote = '' if klass.external or iface_is_defined(klass.iface_file, klass.scope, module, defined) else "'" 48 | 49 | # Include the module name if it is not the current one. 50 | module_name = klass.iface_file.module.py_name + '.' if klass.iface_file.module is not module and defined is not None else '' 51 | py_name = fmt_scoped_py_name(klass.scope, klass.py_name.name) 52 | 53 | return f'{quote}{module_name}{py_name}{quote}' 54 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/misc.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | def fmt_copying(copying, comment): 7 | """ Return a formatted %Copying text. """ 8 | 9 | s = ''.join([b.text for b in copying]).rstrip().replace('\n', '\n' + comment + ' ') 10 | 11 | if s: 12 | s = comment + '\n' + comment + ' ' + s + '\n' 13 | 14 | return s 15 | 16 | 17 | def fmt_scoped_py_name(scope, py_name): 18 | """ Return a formatted scoped Python name. """ 19 | 20 | if scope is None or scope.is_hidden_namespace: 21 | scope_s = '' 22 | else: 23 | scope_s = fmt_scoped_py_name(scope.scope, None) + scope.py_name.name + '.' 24 | 25 | if py_name is None: 26 | py_name_s = '' 27 | else: 28 | py_name_s = py_name 29 | 30 | return scope_s + py_name_s 31 | 32 | 33 | def iface_is_defined(iface_file, scope, module, defined): 34 | """ Return True if a type corresponding to an interface file has been 35 | defined in the context of a module. 36 | """ 37 | 38 | # It is implicitly defined if we are not keeping a record. 39 | if defined is None: 40 | return True 41 | 42 | # A type in another module would have been imported. 43 | if iface_file.module is not module: 44 | return True 45 | 46 | if iface_file not in defined: 47 | return False 48 | 49 | # Check all enclosing scopes have been defined as well. 50 | while scope is not None: 51 | if scope.iface_file not in defined: 52 | return False 53 | 54 | scope = scope.scope 55 | 56 | return True 57 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/template.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from ...scoped_name import STRIP_NONE 7 | 8 | from .signature import fmt_signature_as_cpp_declaration 9 | 10 | 11 | def fmt_template_as_cpp_type(spec, template, strip=STRIP_NONE, as_xml=False): 12 | """ Return the C++ representation of a template type. """ 13 | 14 | sig_s = fmt_signature_as_cpp_declaration(spec, template.types, strip=strip, 15 | as_xml=as_xml) 16 | 17 | # Handle digraphs. 18 | if sig_s.startswith('::'): 19 | sig_s = ' ' + sig_s 20 | 21 | return template.cpp_name.cpp_stripped(strip) + '<' + sig_s + '>' 22 | -------------------------------------------------------------------------------- /sipbuild/generator/outputs/formatters/variable.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | def fmt_variable_as_rest_ref(variable): 7 | """ Return the fully qualified Python name as a reST reference. """ 8 | 9 | module_name = variable.module.fq_py_name.name 10 | variable_name = fmt_scoped_py_name(self.scope, variable.py_name.name) 11 | 12 | return f':sip:ref:`~{module_name}.{variable_name}`' 13 | -------------------------------------------------------------------------------- /sipbuild/generator/parser/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .parser import parse 8 | -------------------------------------------------------------------------------- /sipbuild/generator/parser/parser.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from .parser_manager import ParserManager 7 | 8 | 9 | def parse(sip_file, hex_version, encoding, target_abi, tags, 10 | disabled_features, protected_is_public, include_dirs, sip_module, 11 | is_strict=True): 12 | """ Parse a .sip file and return a 3-tuple of a Specification object, a 13 | list of Module objects and a list of the .sip files that specify the module 14 | to be generated. A UserException is raised if there was an error. 15 | """ 16 | 17 | return ParserManager( 18 | hex_version, encoding, target_abi, tags, disabled_features, 19 | protected_is_public, include_dirs, sip_module, is_strict).parse( 20 | sip_file) 21 | -------------------------------------------------------------------------------- /sipbuild/generator/parser/ply/__init__.py: -------------------------------------------------------------------------------- 1 | # PLY package 2 | # Author: David Beazley (dave@dabeaz.com) 3 | # https://github.com/dabeaz/ply 4 | 5 | __version__ = '2022.10.27' 6 | -------------------------------------------------------------------------------- /sipbuild/generator/parser/python_exceptions.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # The builtin Python exceptions across all supported versions of Python. 7 | PYTHON_EXCEPTIONS = ( 8 | 'BaseException', 9 | 'Exception', 10 | 'StopIteration', 11 | 'GeneratorExit', 12 | 'ArithmeticError', 13 | 'LookupError', 14 | 'StandardError', # Python v2. 15 | 16 | 'AssertionError', 17 | 'AttributeError', 18 | 'BufferError', 19 | 'EOFError', 20 | 'FloatingPointError', 21 | 'OSError', 22 | 'ImportError', 23 | 'IndexError', 24 | 'KeyError', 25 | 'KeyboardInterrupt', 26 | 'MemoryError', 27 | 'NameError', 28 | 'OverflowError', 29 | 'RuntimeError', 30 | 'NotImplementedError', 31 | 'SyntaxError', 32 | 'IndentationError', 33 | 'TabError', 34 | 'ReferenceError', 35 | 'SystemError', 36 | 'SystemExit', 37 | 'TypeError', 38 | 'UnboundLocalError', 39 | 'UnicodeError', 40 | 'UnicodeEncodeError', 41 | 'UnicodeDecodeError', 42 | 'UnicodeTranslateError', 43 | 'ValueError', 44 | 'ZeroDivisionError', 45 | 'EnvironmentError', # Python v2. 46 | 'IOError', # Python v2. 47 | 'WindowsError', # Python v2. 48 | 'VMSError', # Python v2. 49 | 50 | 'BlockingIOError', 51 | 'BrokenPipeError', 52 | 'ChildProcessError', 53 | 'ConnectionError', 54 | 'ConnectionAbortedError', 55 | 'ConnectionRefusedError', 56 | 'ConnectionResetError', 57 | 'FileExistsError', 58 | 'FileNotFoundError', 59 | 'InterruptedError', 60 | 'IsADirectoryError', 61 | 'NotADirectoryError', 62 | 'PermissionError', 63 | 'ProcessLookupError', 64 | 'TimeoutError', 65 | 66 | 'Warning', 67 | 'UserWarning', 68 | 'DeprecationWarning', 69 | 'PendingDeprecationWarning', 70 | 'SyntaxWarning', 71 | 'RuntimeWarning', 72 | 'FutureWarning', 73 | 'ImportWarning', 74 | 'UnicodeWarning', 75 | 'BytesWarning', 76 | 'ResourceWarning', 77 | ) 78 | -------------------------------------------------------------------------------- /sipbuild/generator/resolver/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .resolver import resolve 8 | -------------------------------------------------------------------------------- /sipbuild/installable.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import os 7 | from shutil import copy2, copytree 8 | 9 | 10 | class Installable: 11 | """ Encapsulate a list of files and directories that will be installed into 12 | a target directory. 13 | """ 14 | 15 | def __init__(self, name, *, target_subdir=None): 16 | """ Initialise the installable. The optional target_subdir is the 17 | path of a sub-directory of the eventual target where the files will be 18 | installed. If target_subdir is an absolute pathname then it is used as 19 | the eventual target name. 20 | """ 21 | 22 | self.name = name 23 | self.target_subdir = target_subdir 24 | self.files = [] 25 | 26 | def get_full_target_dir(self, target_dir): 27 | """ Return the full target directory name. """ 28 | 29 | if self.target_subdir: 30 | if os.path.isabs(self.target_subdir): 31 | target_dir = self.target_subdir 32 | else: 33 | target_dir = os.path.join(target_dir, self.target_subdir) 34 | 35 | return target_dir 36 | 37 | def install(self, target_dir, installed, *, do_install=True): 38 | """ Optionally install the files in a target directory and update the 39 | given list of installed files. 40 | """ 41 | 42 | target_dir = self.get_full_target_dir(target_dir) 43 | 44 | if do_install: 45 | os.makedirs(target_dir, exist_ok=True) 46 | 47 | for fn in self.files: 48 | t_path = os.path.join(target_dir, os.path.basename(fn)) 49 | installed.append(t_path) 50 | 51 | if do_install: 52 | copy_fn = copytree if os.path.isdir(fn) else copy2 53 | copy_fn(fn, t_path) 54 | -------------------------------------------------------------------------------- /sipbuild/module/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | # Publish the API. This is private to the rest of sip. 7 | from .abi_version import (get_latest_version, get_source_version_range, 8 | parse_abi_version) 9 | from .module import copy_nonshared_sources, copy_sip_h, copy_sip_pyi, module 10 | -------------------------------------------------------------------------------- /sipbuild/module/abi_version.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | import os 7 | 8 | from ..exceptions import UserException 9 | 10 | 11 | # The directory containing the different module implementations. 12 | _module_source_dir = os.path.join(os.path.dirname(__file__), 'source') 13 | 14 | 15 | def get_latest_version(abi_major_version=None): 16 | """ Return the latest minor version for a major version (if given) 17 | otherwise return the latest major version. 18 | """ 19 | 20 | _, latest = get_source_version_range(abi_major_version) 21 | 22 | return latest 23 | 24 | 25 | def get_module_source_dir(abi_version): 26 | """ Return the name of the directory containing the source of the sip 27 | module that implements the given ABI version. 28 | """ 29 | 30 | major_version, minor_version = abi_version 31 | 32 | return os.path.join(_module_source_dir, str(major_version), 33 | str(minor_version)) 34 | 35 | 36 | def get_source_version_range(abi_major_version): 37 | """ Return a 2-tuple of the earliest and latest minor versions, for a 38 | particular major version, for which source code is available. 39 | """ 40 | 41 | source_dir = _module_source_dir 42 | 43 | if abi_major_version is not None: 44 | source_dir = os.path.join(source_dir, str(abi_major_version)) 45 | 46 | subdirs = sorted(os.listdir(source_dir), key=int) 47 | 48 | return int(subdirs[0]), int(subdirs[-1]) 49 | 50 | 51 | def parse_abi_version(abi_version): 52 | """ Return a 2-tuple of the valid major ABI version and the valid minor ABI 53 | version (or None if it was omitted). Both values are integers. 54 | """ 55 | 56 | try: 57 | parts = [int(p) for p in abi_version.split('.')] 58 | nr_parts = len(parts) 59 | 60 | if nr_parts > 2: 61 | raise ValueError() 62 | except ValueError: 63 | raise UserException(f"'{abi_version}' is not a valid ABI version") 64 | 65 | return parts[0], parts[1] if nr_parts == 2 else None 66 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2019 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _ARRAY_H 21 | #define _ARRAY_H 22 | 23 | 24 | #include 25 | 26 | #include "sipint.h" 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | extern PyTypeObject sipArray_Type; 35 | 36 | PyObject *sip_api_convert_to_array(void *data, const char *format, 37 | Py_ssize_t len, int flags); 38 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 39 | const char *format, size_t stride, Py_ssize_t len, int flags); 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/10/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/11/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/12/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/13/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.8', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/14/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.8', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/15/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=@_SIP_MINIMUM_SETUPTOOLS@"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.@_SIP_OLDEST_SUPPORTED_MINOR@', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/16/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2025 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=@_SIP_MINIMUM_SETUPTOOLS@"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='BSD-2-Clause', 21 | python_requires='>=3.@_SIP_OLDEST_SUPPORTED_MINOR@', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/17/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2025 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2019 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _ARRAY_H 21 | #define _ARRAY_H 22 | 23 | 24 | #include 25 | 26 | #include "sipint.h" 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | extern PyTypeObject sipArray_Type; 35 | 36 | PyObject *sip_api_convert_to_array(void *data, const char *format, 37 | Py_ssize_t len, int flags); 38 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 39 | const char *format, size_t stride, Py_ssize_t len, int flags); 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/12/9/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.5', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2019 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _ARRAY_H 21 | #define _ARRAY_H 22 | 23 | 24 | #include 25 | 26 | #include "sipint.h" 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | extern PyTypeObject sipArray_Type; 35 | 36 | PyObject *sip_api_convert_to_array(void *data, const char *format, 37 | Py_ssize_t len, int flags); 38 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 39 | const char *format, size_t stride, Py_ssize_t len, int flags); 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | 9 | [options.package_data] 10 | PyQt6.sip = py.types sip.pyi 11 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/1/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.6', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2025 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=@_SIP_MINIMUM_SETUPTOOLS@"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='BSD-2-Clause', 21 | python_requires='>=3.@_SIP_OLDEST_SUPPORTED_MINOR@', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2025 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/10/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the enum support. 5 | * 6 | * Copyright (c) 2025 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ENUM_H 11 | #define _SIP_ENUM_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 27 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 28 | int sip_api_is_enum_flag(PyObject *obj); 29 | 30 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 31 | sipIntInstanceDef **next_int_p, PyObject *dict); 32 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 33 | int sip_enum_init(void); 34 | int sip_enum_is_enum(PyObject *obj); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2019 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _ARRAY_H 21 | #define _ARRAY_H 22 | 23 | 24 | #include 25 | 26 | #include "sipint.h" 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | extern PyTypeObject sipArray_Type; 35 | 36 | PyObject *sip_api_convert_to_array(void *data, const char *format, 37 | Py_ssize_t len, int flags); 38 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 39 | const char *format, size_t stride, Py_ssize_t len, int flags); 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | 9 | [options.package_data] 10 | PyQt6.sip = py.types sip.pyi 11 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/2/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.6', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2019 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _ARRAY_H 21 | #define _ARRAY_H 22 | 23 | 24 | #include 25 | 26 | #include "sipint.h" 27 | 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | extern PyTypeObject sipArray_Type; 35 | 36 | PyObject *sip_api_convert_to_array(void *data, const char *format, 37 | Py_ssize_t len, int flags); 38 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 39 | const char *format, size_t stride, Py_ssize_t len, int flags); 40 | 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains all the C++ code that is needed by the sip module. 2 | // 3 | // Copyright (c) 2015 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. 19 | extern "C" void sipSetBool(void *ptr, int val) 20 | { 21 | *reinterpret_cast(ptr) = !!val; 22 | } 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | 9 | [options.package_data] 10 | PyQt6.sip = py.types sip.pyi 11 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/3/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include sip_bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('sip_bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/sip_bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains the support for C++ bools. 2 | // 3 | // Copyright (c) 2022 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. This is only 19 | // used on Windows. 20 | extern "C" void sip_set_bool(void *ptr, int val) 21 | { 22 | *reinterpret_cast(ptr) = !!val; 23 | } 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/4/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the enum support. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ENUM_H 21 | #define _SIP_ENUM_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 36 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 37 | int sip_api_is_enum_flag(PyObject *obj); 38 | 39 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 40 | sipIntInstanceDef **next_int_p, PyObject *dict); 41 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 42 | int sip_enum_init(void); 43 | int sip_enum_is_enum(PyObject *obj); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include sip_bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('sip_bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/sip_bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains the support for C++ bools. 2 | // 3 | // Copyright (c) 2022 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. This is only 19 | // used on Windows. 20 | extern "C" void sip_set_bool(void *ptr, int val) 21 | { 22 | *reinterpret_cast(ptr) = !!val; 23 | } 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/5/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the enum support. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ENUM_H 21 | #define _SIP_ENUM_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 36 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 37 | int sip_api_is_enum_flag(PyObject *obj); 38 | 39 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 40 | sipIntInstanceDef **next_int_p, PyObject *dict); 41 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 42 | int sip_enum_init(void); 43 | int sip_enum_is_enum(PyObject *obj); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/LICENSE: -------------------------------------------------------------------------------- 1 | RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP 2 | 3 | 1. This LICENSE AGREEMENT ("the SIP License") is between Riverbank Computing 4 | Limited ("Riverbank"), and the Individual or Organization ("Licensee") 5 | accessing and otherwise using SIP software in source or binary form and its 6 | associated documentation. SIP comprises a software tool for generating Python 7 | bindings for software C and C++ libraries, and a Python extension module used 8 | at runtime by those generated bindings. This License Agreement may also be 9 | applied to other software packages written by Riverbank. 10 | 11 | 2. Subject to the terms and conditions of this License Agreement, Riverbank 12 | hereby grants Licensee a nonexclusive, royalty-free, world-wide license to 13 | reproduce, analyze, test, perform and/or display publicly, prepare derivative 14 | works, distribute, and otherwise use SIP alone or in any derivative version, 15 | provided, however, that Riverbank's License Agreement and Riverbank's notice of 16 | copyright, e.g., "Copyright (c) 2015 Riverbank Computing Limited; All Rights 17 | Reserved" are retained in SIP alone or in any derivative version prepared by 18 | Licensee. 19 | 20 | 3. In the event Licensee prepares a derivative work that is based on or 21 | incorporates SIP or any part thereof, and wants to make the derivative work 22 | available to others as provided herein, then Licensee hereby agrees to include 23 | in any such work a brief summary of the changes made to SIP. 24 | 25 | 4. Licensee may not use SIP to generate Python bindings for any C or C++ 26 | library for which bindings are already provided by Riverbank. 27 | 28 | 5. Riverbank is making SIP available to Licensee on an "AS IS" basis. 29 | RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY 30 | OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY 31 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR 32 | PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 33 | 34 | 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY 35 | INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, 36 | DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF 37 | ADVISED OF THE POSSIBILITY THEREOF. 38 | 39 | 7. This License Agreement will automatically terminate upon a material breach 40 | of its terms and conditions. 41 | 42 | 8. Nothing in this License Agreement shall be deemed to create any relationship 43 | of agency, partnership, or joint venture between Riverbank and Licensee. This 44 | License Agreement does not grant permission to use Riverbank trademarks or 45 | trade name in a trademark sense to endorse or promote products or services of 46 | Licensee, or any third party. 47 | 48 | 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound 49 | by the terms and conditions of this License Agreement. 50 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include sip_bool.cpp 3 | include pyproject.toml 4 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Riverbank Computing Limited 5 | author_email = info@riverbankcomputing.com 6 | url = https://www.riverbankcomputing.com/software/sip/ 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/setup.py.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022, Riverbank Computing Limited 2 | # All rights reserved. 3 | # 4 | # This copy of SIP is licensed for use under the terms of the SIP License 5 | # Agreement. See the file LICENSE for more details. 6 | # 7 | # This copy of SIP may also used under the terms of the GNU General Public 8 | # License v2 or v3 as published by the Free Software Foundation which can be 9 | # found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 10 | # 11 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 12 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 13 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 14 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 15 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 16 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 17 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 18 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 19 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 20 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 21 | # POSSIBILITY OF SUCH DAMAGE. 22 | 23 | 24 | import glob 25 | import sys 26 | 27 | from setuptools import Extension, setup 28 | 29 | 30 | # Build the extension module. 31 | module_src = sorted(glob.glob('*.c')) 32 | 33 | if sys.platform == 'win32': 34 | module_src.append('sip_bool.cpp') 35 | 36 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 37 | 38 | # Do the setup. 39 | setup( 40 | name='@SIP_MODULE_PROJECT_NAME@', 41 | version='@SIP_MODULE_VERSION@', 42 | license='SIP', 43 | python_requires='>=3.7', 44 | ext_modules=[module] 45 | ) 46 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/sip_array.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the array type. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ARRAY_H 21 | #define _SIP_ARRAY_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | extern PyTypeObject sipArray_Type; 36 | 37 | PyObject *sip_api_convert_to_array(void *data, const char *format, 38 | Py_ssize_t len, int flags); 39 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 40 | const char *format, size_t stride, Py_ssize_t len, int flags); 41 | 42 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 43 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/sip_bool.cpp: -------------------------------------------------------------------------------- 1 | // This contains the support for C++ bools. 2 | // 3 | // Copyright (c) 2022 Riverbank Computing Limited 4 | // 5 | // This file is part of SIP. 6 | // 7 | // This copy of SIP is licensed for use under the terms of the SIP License 8 | // Agreement. See the file LICENSE for more details. 9 | // 10 | // This copy of SIP may also used under the terms of the GNU General Public 11 | // License v2 or v3 as published by the Free Software Foundation which can be 12 | // found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 13 | // 14 | // SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | 17 | 18 | // Set a C++ bool for the main C implementation of the module. This is only 19 | // used on Windows. 20 | extern "C" void sip_set_bool(void *ptr, int val) 21 | { 22 | *reinterpret_cast(ptr) = !!val; 23 | } 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/6/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file defines the API for the enum support. 3 | * 4 | * Copyright (c) 2022 Riverbank Computing Limited 5 | * 6 | * This file is part of SIP. 7 | * 8 | * This copy of SIP is licensed for use under the terms of the SIP License 9 | * Agreement. See the file LICENSE for more details. 10 | * 11 | * This copy of SIP may also used under the terms of the GNU General Public 12 | * License v2 or v3 as published by the Free Software Foundation which can be 13 | * found in the files LICENSE-GPL2 and LICENSE-GPL3 included in this package. 14 | * 15 | * SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 | */ 18 | 19 | 20 | #ifndef _SIP_ENUM_H 21 | #define _SIP_ENUM_H 22 | 23 | 24 | #define PY_SSIZE_T_CLEAN 25 | #include 26 | 27 | #include "sip.h" 28 | 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 36 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 37 | int sip_api_is_enum_flag(PyObject *obj); 38 | 39 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 40 | sipIntInstanceDef **next_int_p, PyObject *dict); 41 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 42 | int sip_enum_init(void); 43 | int sip_enum_is_enum(PyObject *obj); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.8', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/7/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the enum support. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ENUM_H 11 | #define _SIP_ENUM_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 27 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 28 | int sip_api_is_enum_flag(PyObject *obj); 29 | 30 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 31 | sipIntInstanceDef **next_int_p, PyObject *dict); 32 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 33 | int sip_enum_init(void); 34 | int sip_enum_is_enum(PyObject *obj); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ 5 | package. 6 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=30.3", "wheel"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.8', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/8/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the enum support. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ENUM_H 11 | #define _SIP_ENUM_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 27 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 28 | int sip_api_is_enum_flag(PyObject *obj); 29 | 30 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 31 | sipIntInstanceDef **next_int_p, PyObject *dict); 32 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 33 | int sip_enum_init(void); 34 | int sip_enum_is_enum(PyObject *obj); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Phil Thompson 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.h 2 | include pyproject.toml 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/README.in: -------------------------------------------------------------------------------- 1 | sip Extension Module 2 | ==================== 3 | 4 | The sip extension module provides support for the @SIP_MODULE_PACKAGE_NAME@ package. 5 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/pyproject.toml.in: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >=@_SIP_MINIMUM_SETUPTOOLS@"] 3 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/setup.cfg.in: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description = The sip module support for @SIP_MODULE_PACKAGE_NAME@ 3 | long_description = file: README 4 | author = Phil Thompson 5 | author_email = phil@riverbankcomputing.com 6 | url = https://github.com/Python-SIP/sip 7 | platforms = X11, macOS, Windows 8 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/setup.py.in: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | import glob 7 | 8 | from setuptools import Extension, setup 9 | 10 | 11 | # Build the extension module. 12 | module_src = sorted(glob.glob('*.c')) 13 | 14 | module = Extension('@_SIP_MODULE_FQ_NAME@', module_src) 15 | 16 | # Do the setup. 17 | setup( 18 | name='@SIP_MODULE_PROJECT_NAME@', 19 | version='@SIP_MODULE_VERSION@', 20 | license='SIP', 21 | python_requires='>=3.@_SIP_OLDEST_SUPPORTED_MINOR@', 22 | ext_modules=[module] 23 | ) 24 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/sip_array.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the array type. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ARRAY_H 11 | #define _SIP_ARRAY_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern PyTypeObject sipArray_Type; 27 | 28 | PyObject *sip_api_convert_to_array(void *data, const char *format, 29 | Py_ssize_t len, int flags); 30 | PyObject *sip_api_convert_to_typed_array(void *data, const sipTypeDef *td, 31 | const char *format, size_t stride, Py_ssize_t len, int flags); 32 | 33 | int sip_array_can_convert(PyObject *obj, const sipTypeDef *td); 34 | void sip_array_convert(PyObject *obj, void **data, Py_ssize_t *size); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/module/source/13/9/sip_enum.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: BSD-2-Clause */ 2 | 3 | /* 4 | * This file defines the API for the enum support. 5 | * 6 | * Copyright (c) 2024 Phil Thompson 7 | */ 8 | 9 | 10 | #ifndef _SIP_ENUM_H 11 | #define _SIP_ENUM_H 12 | 13 | 14 | /* Remove when Python v3.12 is no longer supported. */ 15 | #define PY_SSIZE_T_CLEAN 16 | #include 17 | 18 | #include "sip.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | PyObject *sip_api_convert_from_enum(int member, const sipTypeDef *td); 27 | int sip_api_convert_to_enum(PyObject *obj, const sipTypeDef *td); 28 | int sip_api_is_enum_flag(PyObject *obj); 29 | 30 | int sip_enum_create(sipExportedModuleDef *client, sipEnumTypeDef *etd, 31 | sipIntInstanceDef **next_int_p, PyObject *dict); 32 | const sipTypeDef *sip_enum_get_generated_type(PyObject *obj); 33 | int sip_enum_init(void); 34 | int sip_enum_is_enum(PyObject *obj); 35 | 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /sipbuild/py_versions.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | # The minimum required version of setuptools. This is the earliest version 7 | # that generates correct wheel names for PyPI. Remember to update 8 | # pyproject.toml in the root directory. 9 | MINIMUM_SETUPTOOLS = '75.8.1' 10 | 11 | # The oldest supported minor version of Python v3. Remember to update 12 | # pyproject.toml in the root directory. 13 | OLDEST_SUPPORTED_MINOR = 9 14 | -------------------------------------------------------------------------------- /sipbuild/toml.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | try: 7 | import tomllib 8 | except ImportError: 9 | import tomli as tomllib 10 | 11 | 12 | def toml_load(toml_file): 13 | """ Return a dict containing the decoded contents of a TOML file. """ 14 | 15 | with open(toml_file, 'rb') as f: 16 | return tomllib.load(f) 17 | 18 | 19 | def toml_loads(toml_str): 20 | """ Return a dict containing the decoded contents of a TOML string. """ 21 | 22 | return tomllib.loads(toml_str) 23 | -------------------------------------------------------------------------------- /sipbuild/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | -------------------------------------------------------------------------------- /sipbuild/tools/build.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ..abstract_project import AbstractProject 7 | from ..exceptions import handle_exception 8 | 9 | 10 | def main(): 11 | """ Build the project in-situ from the command line. """ 12 | 13 | try: 14 | project = AbstractProject.bootstrap('build', 15 | "Build the project in-situ.") 16 | project.build() 17 | project.progress("The project has been built.") 18 | except Exception as e: 19 | handle_exception(e) 20 | 21 | return 0 22 | 23 | 24 | if __name__ == '__main__': 25 | import sys 26 | 27 | sys.exit(main()) 28 | -------------------------------------------------------------------------------- /sipbuild/tools/distinfo.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ..argument_parser import ArgumentParser 7 | from ..distinfo import distinfo 8 | from ..exceptions import handle_exception 9 | 10 | 11 | def main(): 12 | """ Create and populate a .dist-info directory. """ 13 | 14 | # Parse the command line. 15 | parser = ArgumentParser("Create and populate a .dist-info directory.") 16 | 17 | parser.add_argument('--console-script', dest='console_scripts', 18 | action='append', help="the entry point of a console script", 19 | metavar='ENTRY-POINT') 20 | 21 | parser.add_argument('--generator', 22 | help="the name of the program generating the directory", 23 | metavar="NAME") 24 | 25 | parser.add_argument('--generator-version', 26 | help="the version of the program generating the directory", 27 | metavar="VERSION") 28 | 29 | parser.add_argument('--gui-script', dest='gui_scripts', action='append', 30 | help="the entry point of a GUI script", metavar='ENTRY-POINT') 31 | 32 | parser.add_argument('--inventory', required=True, 33 | help="the file containing the names of the files in the project", 34 | metavar="FILE") 35 | 36 | parser.add_argument('--metadata', dest='metadata_overrides', 37 | action='append', 38 | help="a name/value to override any pyproject.toml metadata", 39 | metavar='NAME[=VALUE]') 40 | 41 | parser.add_argument('--prefix', help="the installation prefix directory", 42 | metavar="DIR") 43 | 44 | parser.add_argument('--project-root', required=True, 45 | help="the directory containing pyproject.toml", metavar="DIR") 46 | 47 | parser.add_argument('--requires-dist', dest='requires_dists', 48 | action='append', help="additional Requires-Dist", metavar="EXPR") 49 | 50 | parser.add_argument('--wheel-tag', 51 | help="the tag if a wheel is being created", metavar="TAG") 52 | 53 | parser.add_argument(dest='names', nargs=1, 54 | help="the name of the .dist-info directory", metavar='directory') 55 | 56 | args = parser.parse_args() 57 | 58 | try: 59 | distinfo(name=args.names[0], console_scripts=args.console_scripts, 60 | gui_scripts=args.gui_scripts, generator=args.generator, 61 | generator_version=args.generator_version, 62 | inventory=args.inventory, 63 | metadata_overrides=args.metadata_overrides, prefix=args.prefix, 64 | project_root=args.project_root, 65 | requires_dists=args.requires_dists, wheel_tag=args.wheel_tag) 66 | except Exception as e: 67 | handle_exception(e) 68 | 69 | return 0 70 | 71 | 72 | if __name__ == '__main__': 73 | import sys 74 | 75 | sys.exit(main()) 76 | -------------------------------------------------------------------------------- /sipbuild/tools/install.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ..abstract_project import AbstractProject 7 | from ..exceptions import handle_exception 8 | 9 | 10 | def main(): 11 | """ Install the project from the command line. """ 12 | 13 | try: 14 | project = AbstractProject.bootstrap('install', 15 | "Build and install the project.") 16 | project.install() 17 | project.progress("The project has been installed.") 18 | except Exception as e: 19 | handle_exception(e) 20 | 21 | return 0 22 | 23 | 24 | if __name__ == '__main__': 25 | import sys 26 | 27 | sys.exit(main()) 28 | -------------------------------------------------------------------------------- /sipbuild/tools/module.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ..argument_parser import ArgumentParser 7 | from ..exceptions import handle_exception 8 | from ..module import module 9 | 10 | 11 | def main(): 12 | """ Create the source, interface and documentation of a sip module. """ 13 | 14 | # Parse the command line. 15 | parser = ArgumentParser("Generate a sip extension module.") 16 | 17 | parser.add_argument('--abi-version', help="the ABI version", 18 | metavar="MAJOR[.MINOR]") 19 | 20 | parser.add_argument('--project', help="the PyPI project name", 21 | metavar="NAME") 22 | 23 | parser.add_argument('--sdist', action='store_true', default=False, 24 | help="generate an sdist file") 25 | 26 | parser.add_argument('--setup-cfg', 27 | help="the name of the setup.cfg file to use", metavar="FILE") 28 | 29 | parser.add_argument('--sip-h', action='store_true', default=False, 30 | help="generate a sip.h file") 31 | 32 | parser.add_argument('--sip-rst', action='store_true', default=False, 33 | help="generate a sip.rst file") 34 | 35 | parser.add_argument('--target-dir', help="generate files in DIR", 36 | metavar="DIR") 37 | 38 | parser.add_argument(dest='sip_modules', nargs=1, 39 | help="the fully qualified name of the sip module", 40 | metavar="module") 41 | 42 | args = parser.parse_args() 43 | 44 | try: 45 | module(sip_module=args.sip_modules[0], abi_version=args.abi_version, 46 | project=args.project, sdist=args.sdist, 47 | setup_cfg=args.setup_cfg, sip_h=args.sip_h, 48 | sip_rst=args.sip_rst, target_dir=args.target_dir) 49 | except Exception as e: 50 | handle_exception(e) 51 | 52 | return 0 53 | 54 | 55 | if __name__ == '__main__': 56 | import sys 57 | 58 | sys.exit(main()) 59 | -------------------------------------------------------------------------------- /sipbuild/tools/sdist.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from ..abstract_project import AbstractProject 7 | from ..exceptions import handle_exception 8 | 9 | 10 | def main(): 11 | """ Build an sdist for the project from the command line. """ 12 | 13 | try: 14 | project = AbstractProject.bootstrap('sdist', 15 | "Build an sdist for the project.") 16 | sdist_file = project.build_sdist('.') 17 | project.progress(f"{sdist_file} has been built.") 18 | except Exception as e: 19 | handle_exception(e) 20 | 21 | return 0 22 | 23 | 24 | if __name__ == '__main__': 25 | import sys 26 | 27 | sys.exit(main()) 28 | -------------------------------------------------------------------------------- /sipbuild/tools/wheel.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from ..abstract_project import AbstractProject 7 | from ..exceptions import handle_exception 8 | 9 | 10 | def main(): 11 | """ Build a wheel for the project from the command line. """ 12 | 13 | try: 14 | project = AbstractProject.bootstrap('wheel', 15 | "Build a wheel for the project.") 16 | wheel_file = project.build_wheel('.') 17 | project.progress(f"{wheel_file} has been built.") 18 | except Exception as e: 19 | handle_exception(e) 20 | 21 | return 0 22 | 23 | 24 | if __name__ == '__main__': 25 | import sys 26 | 27 | sys.exit(main()) 28 | -------------------------------------------------------------------------------- /sipbuild/version.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from ._version import version, version_tuple 7 | 8 | 9 | # Convert the setuptools_scm generated version number to our historic names and 10 | # formats. 11 | 12 | SIP_VERSION_STR = version 13 | SIP_VERSION = (version_tuple[0] << 16) + (version_tuple[1] << 8) + version_tuple[2] 14 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Unit Tests 2 | 3 | Unit tests are written using Python's `unittest` module. Each sub-directory 4 | implements a single test case, each of which may contain any number of tests. 5 | 6 | 7 | ## Running Unit Tests 8 | 9 | To run the complete suite of tests, run: 10 | 11 | python -m unittest 12 | 13 | To run the tests of a particular test case, run: 14 | 15 | python -m unittest TEST_SUBDIR/test_TEST.py 16 | 17 | 18 | ## Writing Unit Tests 19 | 20 | Each test sub-directory should contain an empty `__init__.py` file, a Python 21 | test script with the prefix `test_` and one or more `.sip` files. 22 | 23 | The test script should contain a sub-class of `SIPTestCase`, which is imported 24 | from the `utils` module. This will automatically build any modules (defined by 25 | the `.sip` files) needed to run the tests. The modules will be available as 26 | top-level imports. A module's build is configurable to a limited extent - see 27 | the class attributes of `SIPTestCase` for the relevant information. 28 | 29 | Each `.sip` file should define a single module to build. The C/C++ 30 | implementation being wrapped would normally be embedded in the `.sip` file 31 | using appropriate code directives. 32 | -------------------------------------------------------------------------------- /test/imported_exceptions/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/imported_exceptions/handler_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the handler_module test module. 2 | 3 | 4 | %Module(name=handler_module) 5 | 6 | 7 | %Exception std::exception(SIP_Exception) /PyName=StdException, Default/ 8 | { 9 | %TypeHeaderCode 10 | #include 11 | %End 12 | 13 | %RaiseCode 14 | const char *detail = sipExceptionRef.what(); 15 | SIP_BLOCK_THREADS 16 | PyErr_SetString(sipException_std_exception, detail); 17 | SIP_UNBLOCK_THREADS 18 | %End 19 | }; 20 | -------------------------------------------------------------------------------- /test/imported_exceptions/test_imported_exceptions.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from utils import SIPTestCase 7 | 8 | 9 | class ImportedExceptionsTestCase(SIPTestCase): 10 | """ Test the support for imported exceptions. """ 11 | 12 | # Enable exception support. 13 | exceptions = True 14 | 15 | def test_Exceptions(self): 16 | """ Test the throwing of an imported exception. """ 17 | 18 | from handler_module import StdException 19 | from thrower_module import throwException 20 | 21 | self.assertRaises(StdException, throwException) 22 | -------------------------------------------------------------------------------- /test/imported_exceptions/thrower_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the thrower_module test module. 2 | 3 | 4 | %Module(name=thrower_module) 5 | 6 | %Import handler_module.sip 7 | 8 | 9 | %ModuleHeaderCode 10 | 11 | void throwException() 12 | { 13 | throw std::exception(); 14 | }; 15 | 16 | %End 17 | 18 | 19 | void throwException(); 20 | -------------------------------------------------------------------------------- /test/int_convertors/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/movable/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/movable/movable_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the movable_module test module. 2 | 3 | 4 | %Module(name=movable_module) 5 | 6 | 7 | template 8 | %MappedType std::unique_ptr /Movable, NoRelease, AllowNone/ 9 | { 10 | %TypeHeaderCode 11 | #include 12 | #include // For std::move(). 13 | %End 14 | 15 | %ConvertFromTypeCode 16 | const sipTypeDef *td = sipFindType("TYPE*"); 17 | 18 | return sipConvertFromNewType(sipCpp->release(), td, NULL); 19 | %End 20 | 21 | %ConvertToTypeCode 22 | const sipTypeDef *td = sipFindType("TYPE"); 23 | 24 | if (sipIsErr == NULL) 25 | return sipCanConvertToType(sipPy, td, 0); 26 | 27 | if (sipPy == Py_None) 28 | return 1; 29 | 30 | int state; 31 | TYPE *t = reinterpret_cast(sipConvertToType(sipPy, td, sipTransferObj, 0, &state, sipIsErr)); 32 | 33 | sipReleaseType(t, td, state); 34 | 35 | if (*sipIsErr) 36 | return 0; 37 | 38 | *sipCppPtr = new std::unique_ptr(t); 39 | 40 | return sipGetState(sipTransferObj); 41 | %End 42 | }; 43 | 44 | 45 | %ModuleHeaderCode 46 | class AnObject 47 | { 48 | public: 49 | AnObject(int i) : mI(i) {} 50 | virtual ~AnObject() {} 51 | 52 | int getValue() const 53 | { 54 | return mI; 55 | } 56 | 57 | void increment() 58 | { 59 | mI++; 60 | } 61 | 62 | private: 63 | int mI; 64 | }; 65 | %End 66 | 67 | 68 | class AnObject 69 | { 70 | public: 71 | AnObject(int i); 72 | virtual ~AnObject(); 73 | 74 | int getValue() const; 75 | }; 76 | 77 | 78 | %ModuleHeaderCode 79 | #include 80 | 81 | 82 | class ObjectWrapper 83 | { 84 | public: 85 | ObjectWrapper() {}; 86 | ObjectWrapper(const ObjectWrapper& other) : mObject(new AnObject(*other.mObject)) {} 87 | ObjectWrapper& operator=(const ObjectWrapper& other) 88 | { 89 | mObject.reset(new AnObject(*other.mObject)); 90 | return *this; 91 | }; 92 | virtual ~ObjectWrapper() {} 93 | 94 | int getObjectValue() const 95 | { 96 | return mObject ? mObject->getValue() : -1000; 97 | } 98 | 99 | std::unique_ptr takeObject() 100 | { 101 | return std::move(mObject); 102 | } 103 | 104 | void setObject(std::unique_ptr anObject) 105 | { 106 | mObject = std::move(anObject); 107 | mObject->increment(); 108 | } 109 | 110 | private: 111 | std::unique_ptr mObject; 112 | }; 113 | %End 114 | 115 | 116 | class ObjectWrapper 117 | { 118 | public: 119 | ObjectWrapper(); 120 | virtual ~ObjectWrapper(); 121 | 122 | int getObjectValue() const; 123 | 124 | std::unique_ptr takeObject(); 125 | 126 | void setObject(std::unique_ptr anObject); 127 | }; 128 | -------------------------------------------------------------------------------- /test/movable/test_movable.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from utils import SIPTestCase 7 | 8 | 9 | class MovableTestCase(SIPTestCase): 10 | """ Test the support for the /Movable/ mapped type annotation. (See 11 | issue/60.) 12 | """ 13 | 14 | def test_Movable(self): 15 | """ Test the support for /Movable/. It also verifies the test 16 | implementation of the std::unique_ptr mapped type. 17 | """ 18 | 19 | from sys import getrefcount 20 | from movable_module import AnObject, ObjectWrapper 21 | 22 | ao = AnObject(3) 23 | ow = ObjectWrapper() 24 | 25 | # Test the value of the object. 26 | self.assertEqual(ao.getValue(), 3) 27 | self.assertEqual(getrefcount(ao), 2) 28 | 29 | # Test an empty wrapper. 30 | self.assertEqual(ow.getObjectValue(), -1000) 31 | 32 | # Test an non-empty wrapper. 33 | ow.setObject(ao) 34 | self.assertEqual(getrefcount(ao), 3) 35 | self.assertEqual(ow.getObjectValue(), 4) 36 | 37 | # Unwrap the object and test the wrapper. 38 | ao2 = ow.takeObject() 39 | self.assertEqual(getrefcount(ao2), 2) 40 | self.assertEqual(ow.getObjectValue(), -1000) 41 | 42 | # Re-test the value of the object. 43 | self.assertEqual(ao2.getValue(), 4) 44 | 45 | # Check that the original Python object no longer wraps the C++ object. 46 | self.assertEqual(getrefcount(ao), 2) 47 | self.assertRaises(RuntimeError, ao.getValue) 48 | -------------------------------------------------------------------------------- /test/py_enums/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/py_properties/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/py_properties/py_properties_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the py_properties_module test module. 2 | 3 | 4 | %Module(name=py_properties_module) 5 | 6 | 7 | %ModuleHeaderCode 8 | class AnObject 9 | { 10 | public: 11 | AnObject(int int_val) : _int_val(int_val) {} 12 | 13 | int get_int_val() const 14 | { 15 | return _int_val; 16 | } 17 | 18 | void set_int_val(int int_val) 19 | { 20 | _int_val = int_val; 21 | } 22 | 23 | private: 24 | int _int_val; 25 | }; 26 | %End 27 | 28 | 29 | class AnObject 30 | { 31 | public: 32 | AnObject(int int_val); 33 | 34 | int get_int_val() const; 35 | void set_int_val(int int_val); 36 | %Property(name=int_val, get=get_int_val, set=set_int_val) 37 | }; 38 | -------------------------------------------------------------------------------- /test/py_properties/test_py_properties.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from utils import SIPTestCase 7 | 8 | 9 | class PyPropertiesTestCase(SIPTestCase): 10 | """ Test the support for the %Property directive. (See issue/74.) 11 | """ 12 | 13 | def test_PyProperties(self): 14 | """ Test the support for %Property. """ 15 | 16 | from py_properties_module import AnObject 17 | 18 | ao = AnObject(3) 19 | self.assertEqual(ao.int_val, 3) 20 | 21 | ao.int_val = 100 22 | self.assertEqual(ao.int_val, 100) 23 | -------------------------------------------------------------------------------- /test/templates/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/templates/templates_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the templates_module test module. 2 | 3 | 4 | %Module(name=templates_module) 5 | 6 | 7 | %ModuleHeaderCode 8 | 9 | class BaseClass 10 | { 11 | }; 12 | 13 | template 14 | class ValueWrapper : public BaseClass 15 | { 16 | public: 17 | T1 getValue() const { 18 | return T1(); 19 | } 20 | }; 21 | 22 | template 23 | class ExtendedValueWrapper : public ValueWrapper 24 | { 25 | }; 26 | 27 | class AValue 28 | { 29 | }; 30 | 31 | class BValue 32 | { 33 | }; 34 | 35 | typedef ExtendedValueWrapper AValueWrapper; 36 | typedef ExtendedValueWrapper BValueWrapper; 37 | 38 | 39 | template 40 | class SimpleWrapper : public T3 41 | { 42 | }; 43 | 44 | class CValue 45 | { 46 | }; 47 | 48 | typedef SimpleWrapper CWrapper; 49 | 50 | 51 | namespace Scope 52 | { 53 | class Nested 54 | { 55 | }; 56 | }; 57 | 58 | typedef SimpleWrapper NestedWrapper; 59 | 60 | %End 61 | 62 | 63 | class BaseClass 64 | { 65 | }; 66 | 67 | template 68 | class ValueWrapper : public BaseClass 69 | { 70 | public: 71 | T1 getValue() const; 72 | }; 73 | 74 | template 75 | class ExtendedValueWrapper : public ValueWrapper 76 | { 77 | }; 78 | 79 | class AValue 80 | { 81 | }; 82 | 83 | class BValue 84 | { 85 | }; 86 | 87 | typedef ExtendedValueWrapper AValueWrapper; 88 | typedef ExtendedValueWrapper BValueWrapper; 89 | 90 | 91 | template 92 | class SimpleWrapper : public T3 93 | { 94 | }; 95 | 96 | class CValue 97 | { 98 | }; 99 | 100 | typedef SimpleWrapper CWrapper; 101 | 102 | 103 | namespace Scope 104 | { 105 | class Nested 106 | { 107 | }; 108 | }; 109 | 110 | typedef SimpleWrapper NestedWrapper; 111 | -------------------------------------------------------------------------------- /test/templates/test_templates.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from utils import SIPTestCase 7 | 8 | 9 | class TemplatesTestCase(SIPTestCase): 10 | """ Test the support for templates. """ 11 | 12 | def test_SimpleTemplateSuperclasses(self): 13 | """ Test the use of simple template arguments as super-classes. """ 14 | 15 | from templates_module import CValue, CWrapper 16 | 17 | self.assertTrue(issubclass(CWrapper, CValue)) 18 | 19 | def test_ScopedTemplateSuperclasses(self): 20 | """ Test the use of simple template arguments as super-classes within 21 | a scope. 22 | """ 23 | 24 | from templates_module import NestedWrapper, Scope 25 | 26 | self.assertTrue(issubclass(NestedWrapper, Scope.Nested)) 27 | 28 | def test_TemplateSuperclasses(self): 29 | """ Test the use of template arguments as super-classes. """ 30 | 31 | from templates_module import (AValue, AValueWrapper, BaseClass, BValue, 32 | BValueWrapper) 33 | 34 | self.assertTrue(issubclass(AValueWrapper, BaseClass)) 35 | a = AValueWrapper() 36 | self.assertIsInstance(a.getValue(), AValue) 37 | 38 | self.assertTrue(issubclass(BValueWrapper, BaseClass)) 39 | b = BValueWrapper() 40 | self.assertIsInstance(b.getValue(), BValue) 41 | -------------------------------------------------------------------------------- /test/timelines/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | -------------------------------------------------------------------------------- /test/timelines/test_timelines.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2025 Phil Thompson 4 | 5 | 6 | from utils import SIPTestCase 7 | 8 | 9 | class TimelinesTestCase(SIPTestCase): 10 | """ Test the support for timelines. """ 11 | 12 | # The list of tags. 13 | tags = ['v2'] 14 | 15 | def test_Timelines(self): 16 | """ Test the support for timelines. """ 17 | 18 | import timelines_module 19 | 20 | mod_dict = timelines_module.__dict__ 21 | 22 | self.assertIn('between_v1_and_v3_enabled', mod_dict) 23 | self.assertIn('up_to_unknown_enabled', mod_dict) 24 | 25 | self.assertNotIn('up_to_v2_disabled', mod_dict) 26 | self.assertNotIn('v3_and_after_disabled', mod_dict) 27 | self.assertNotIn('unknown_and_after_disabled', mod_dict) 28 | self.assertNotIn('between_unknown1_and_unknown2_disabled', mod_dict) 29 | -------------------------------------------------------------------------------- /test/timelines/timelines_module.sip: -------------------------------------------------------------------------------- 1 | // The SIP implementation of the timelines_module test module. 2 | 3 | 4 | %Module(name=timelines_module) 5 | 6 | 7 | %Timeline {v1 v2 v3} 8 | 9 | 10 | %ModuleHeaderCode 11 | 12 | // We implement them all. 13 | void up_to_v2_disabled() {} 14 | void v3_and_after_disabled() {} 15 | void between_v1_and_v3_enabled() {} 16 | void up_to_unknown_enabled() {} 17 | void unknown_and_after_disabled() {} 18 | void between_unknown1_and_unknown2_disabled() {} 19 | 20 | %End 21 | 22 | 23 | %If (- v2) 24 | void up_to_v2_disabled(); 25 | %End 26 | 27 | 28 | %If (v3 -) 29 | void v3_and_after_disabled(); 30 | %End 31 | 32 | 33 | %If (v1 - v3) 34 | void between_v1_and_v3_enabled(); 35 | %End 36 | 37 | 38 | %If (- unknown) 39 | void up_to_unknown_enabled(); 40 | %End 41 | 42 | 43 | %If (unknown -) 44 | void unknown_and_after_disabled(); 45 | %End 46 | 47 | 48 | %If (unknown1 - unknown2) 49 | void between_unknown1_and_unknown2_disabled(); 50 | %End 51 | -------------------------------------------------------------------------------- /test/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: BSD-2-Clause 2 | 3 | # Copyright (c) 2024 Phil Thompson 4 | 5 | 6 | from .sip_test_case import SIPTestCase 7 | --------------------------------------------------------------------------------