botan icon indicating copy to clipboard operation
botan copied to clipboard

Packaging botan3.py with pyproject.toml

Open arckoor opened this issue 4 months ago • 2 comments

Currently installation of the python binding is done by install.py via simply copy-pasting. It would be nice to also offer a setup.py, or for something more "modern", a pyproject.toml that can be used by build systems like setuptools (and then be consumed by other upstream projects, like nixpkgs) E.g. something very minimal but working

[project]
name = "botan3"
version = "3.8.1"
description = "Python bindings for Botan C++ crypto library"
license = "BSD-2-Clause"
requires-python = ">=3.2"

[build-system]
requires = [ "setuptools" ]
build-backend = "setuptools.build_meta"

[tool.setuptools]
py-modules = ["botan3"]

[tool.setuptools.package-dir]
"" = "src/python"

arckoor avatar Aug 04 '25 13:08 arckoor

Sounds good to me. We have a similar integration with CMake, where we install a Botan-config.cmake to be consumed by find_package().

Improving the integration with the python ecosystem would certainly be welcome. It would be nice to have some basic test in CI that upstream package managers can pick up the package and run a super basic script (say: calculate a hash, or encode some base64).

reneme avatar Aug 04 '25 17:08 reneme

Would help to also have it distributed through PyPI, as explained in https://github.com/randombit/botan/issues/5103 and for the package to be in its own subdirectory.

bkmgit avatar Sep 19 '25 05:09 bkmgit