Skip to content

Add support for python 3.13 #21

Description

@mgierada

Installing latest version of upologon 0.1.11 throws the following error

      !!
        self._finalize_license_expression()
      upolygon/draw_polygon.c:849:59: warning: 'Py_UNICODE' is deprecated
      [-Wdeprecated-declarations]
        849 | static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
            |                                                           ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/unicodeobject.h:10:1:
      note: 'Py_UNICODE' has been explicitly marked deprecated here
         10 | Py_DEPRECATED(3.13) typedef wchar_t Py_UNICODE;
            | ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/pyport.h:251:54:
      note: expanded from macro 'Py_DEPRECATED'
        251 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
            |                                                      ^
      upolygon/draw_polygon.c:850:11: warning: 'Py_UNICODE' is deprecated
      [-Wdeprecated-declarations]
        850 |     const Py_UNICODE *u_end = u;
            |           ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/unicodeobject.h:10:1:
      note: 'Py_UNICODE' has been explicitly marked deprecated here
         10 | Py_DEPRECATED(3.13) typedef wchar_t Py_UNICODE;
            | ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/pyport.h:251:54:
      note: expanded from macro 'Py_DEPRECATED'
        251 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
            |                                                      ^
      upolygon/draw_polygon.c:1975:22: error: call to undeclared function
      '_PyList_Extend'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
       1975 |     PyObject* none = _PyList_Extend((PyListObject*)L, v);
            |                      ^
      upolygon/draw_polygon.c:1975:22: note: did you mean 'PyList_Extend'?
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/listobject.h:52:17:
      note: 'PyList_Extend' declared here
         52 | PyAPI_FUNC(int) PyList_Extend(PyObject *self, PyObject *iterable);
            |                 ^
      upolygon/draw_polygon.c:1975:15: error: incompatible integer to pointer conversion
      initializing 'PyObject *' (aka 'struct _object *') with an expression of type 'int'
      [-Wint-conversion]
       1975 |     PyObject* none = _PyList_Extend((PyListObject*)L, v);
            |               ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:25030:17: warning: 'Py_OptimizeFlag' is deprecated
      [-Wdeprecated-declarations]
       25030 |   if (unlikely(!Py_OptimizeFlag)) {
             |                 ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/pydebug.h:13:1:
      note: 'Py_OptimizeFlag' has been explicitly marked deprecated here
         13 | Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_OptimizeFlag;
            | ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/pyport.h:251:54:
      note: expanded from macro 'Py_DEPRECATED'
        251 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
            |                                                      ^
      upolygon/draw_polygon.c:32167:134: error: call to undeclared function
      '_PyGC_FINALIZED'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
       32167 |   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) &&
      Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
             |
      ^
      upolygon/draw_polygon.c:32352:104: error: call to undeclared function
      '_PyGC_FINALIZED'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
       32352 |   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) &&
      Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
             |
      ^
      upolygon/draw_polygon.c:32483:104: error: call to undeclared function
      '_PyGC_FINALIZED'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
       32483 |   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) &&
      Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
             |
      ^
      upolygon/draw_polygon.c:32736:104: error: call to undeclared function
      '_PyGC_FINALIZED'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
       32736 |   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) &&
      Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
             |
      ^
      upolygon/draw_polygon.c:39085:70: error: too few arguments to function call,
      expected 6, have 5
       39083 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       39084 |                                               bytes, sizeof(val),
       39085 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:39281:70: error: too few arguments to function call,
      expected 6, have 5
       39279 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       39280 |                                               bytes, sizeof(val),
       39281 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:39477:70: error: too few arguments to function call,
      expected 6, have 5
       39475 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       39476 |                                               bytes, sizeof(val),
       39477 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:39673:70: error: too few arguments to function call,
      expected 6, have 5
       39671 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       39672 |                                               bytes, sizeof(val),
       39673 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:39869:70: error: too few arguments to function call,
      expected 6, have 5
       39867 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       39868 |                                               bytes, sizeof(val),
       39869 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:40326:70: error: too few arguments to function call,
      expected 6, have 5
       40324 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
             |                           ~~~~~~~~~~~~~~~~~~~
       40325 |                                               bytes, sizeof(val),
       40326 |                                               is_little, !is_unsigned);
             |                                                                      ^
      /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/include/python3.13/cpython/longobject.h:111:17:
      note: '_PyLong_AsByteArray' declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^                   ~~~~~~~~~~~~~~~~
        112 |     unsigned char* bytes, size_t n,
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        113 |     int little_endian, int is_signed, int with_exceptions);
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      upolygon/draw_polygon.c:40625:13: error: call to undeclared function
      '_PyGen_SetStopIterationValue'; ISO C99 and later do not support implicit function
      declarations [-Wimplicit-function-declaration]
       40625 |             _PyGen_SetStopIterationValue(result);
             |             ^
      upolygon/draw_polygon.c:40625:13: note: did you mean
      '__Pyx_PyGen__FetchStopIterationValue'?
      upolygon/draw_polygon.c:40380:12: note: '__Pyx_PyGen__FetchStopIterationValue'
      declared here
       40380 | static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState
      *__pyx_tstate, PyObject **pvalue) {
             |            ^
      3 warnings and 13 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1

      hint: This usually indicates a problem with the package or the build environment.
  help: `upolygon` (v0.1.11) was included because `highfive-models[data]` depends on
        `darwin-py` (v3.1.0) which depends on `upolygon`
make[1]: *** [dep] Error 1
make: *** [install] Error 2

This suggest the package requires recompilation to properly access CPython internals.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions