Skip to content

c-toxcore releases should include generated Python bindings #2702

Open
@emdee-is

Description

@emdee-is

c-toxcore releases should include generated Python bindings.

I wrote: #2694 (comment)

This should be labeled with api-break as changes it the fields in toxOptions.

iphy replied: #2694 (comment)

The memory layout of this struct (size, alignment, and field order) is not part of the ABI.

It takes more than a comment in a header file to determine a library's ABI: it's determined by the uses made of the library, for example complete wrappers into other languages is a good example. If they need access to the structure, then it should be considered in the ABI. Even if you want to make the structure private, you can't ignore the fact that the project has been adding getters and setters to the ABI with no discussion or ABIbreak tagging or version bump, and has turned long supported functionality into an optional feature without warning or version bump. That's doesn't conform to semantic versioning.

If the project followed semantic versioning and pushed minor releases for all these changes, the project would have more releases as they get merged in, which is a Good Thing. I doubt the project eill do the planning required for semantic versioning as things are "or not even not being discussed at all but being in developers' heads and then dropping as a surprise fully implemented PR, [which] is not very good."

The only way of doing something like a good wrapper into Python is if c-toxcore keeps up-to-date one of the existing ctypes wrappers, or uses the standard wrapper generator ctypesgen. I think the project should include a generated wrapper as a part of c-toxcore releases so that the code is always matched to the Ccode. (ctypesgen has no dependencies relying only on Python, and wraps c-toxcore in about a minute.) Many good projects ship the Python bindings with the C code (e.g. zmq).

All development in Python has been frozen for more than 2 years, and yet there's been no need for any tools other than ctypesgen, which is widely used and continually developed by some of the core Python developers, including the BDfL. The use of home-brewed tools written in a language not available, or explicitly banned, in corporate enviornments, that generates debugger-unfriendly code, is counter-productive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions