Skip to content

Upgrade to Python 3 support #3

@jmw182

Description

@jmw182

Official Python 2.7 support is ending in January 2020. I have been working on upgrading our version of PyRTMA to use Python 3.7 with a cross-platform replacement for ctypeslib and ctypesgen that is Python 3 compatible.

I have had luck using ctypeslib2, which depends on the LLVM Clang compiler (which is the default compiler on Mac and can be installed on Windows/Linux) and the python Clang support package, both available through PyPi (aka pip). The h2xml and xml2py scripts previously used on Linux can be replaced by clang2py from ctypeslib2, which also works on Windows, replacing ctypesgen.

The biggest issue I have encountered is parsing multi-line macro definitions (e.g. DF_MSG_HEADER_FIELDS in Dragonfly_types.h) with ctypeslib2. I submitted an issue to ctypeslib2, but in the meantime a workaround is to remove the DF_MSG_HEADER_FIELDS definition and replace all references to it with the defined value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions