Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.11 #1308

Closed
wieczorek1990 opened this issue Oct 25, 2022 · 7 comments
Closed

Support Python 3.11 #1308

wieczorek1990 opened this issue Oct 25, 2022 · 7 comments
Assignees
Labels
cat: core core language and typing features enhancement

Comments

@wieczorek1990
Copy link
Contributor

Tried to build with Python 3.11 and this is the output:

  Building wheel for pytype (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pytype (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [566 lines of output]
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      running build_ext
      building 'pytype.typegraph.cfg' extension
      In file included from pytype/typegraph/cfg.cc:1:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:45:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/attr.h:13:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/cast.h:446:36: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
                      "  " + handle(frame->f_code->co_filename).cast<std::string>() +
                                         ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:45:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/attr.h:13:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/cast.h:448:29: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
                      handle(frame->f_code->co_name).cast<std::string>() + "\n";
                                  ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:45:
      In file included from /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/attr.h:13:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/cast.h:449:26: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
                  frame = frame->f_back;
                               ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2210:49: error: no member named 'frame' in '_ts'
          PyFrameObject *frame = PyThreadState_Get()->frame;
                                 ~~~~~~~~~~~~~~~~~~~  ^
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2211:41: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
          if (frame && (std::string) str(frame->f_code->co_name) == name &&
                                              ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2212:14: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
              frame->f_code->co_argcount > 0) {
                   ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2215:18: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
                  frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
                       ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      In file included from pytype/typegraph/cfg.cc:1:
      /private/var/folders/_l/49d5phzs6tgf325gmsp5xljr0000gn/T/pip-build-env-ixsnf6o5/overlay/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2215:52: error: member access into incomplete type 'PyFrameObject' (aka '_frame')
                  frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0));
                                                         ^
      /Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of '_frame'
      typedef struct _frame PyFrameObject;
                     ^
      pytype/typegraph/cfg.cc:505:42: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        PyVarObject_HEAD_INIT(&PyType_Type, 0) tp_name : "Program",
                                               ^~~~~~~~~
                                               .tp_name =
      pytype/typegraph/cfg.cc:506:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_basicsize : sizeof(PyProgramObj),
        ^~~~~~~~~~~~~~
        .tp_basicsize =
      pytype/typegraph/cfg.cc:507:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_itemsize : 0,
        ^~~~~~~~~~~~~
        .tp_itemsize =
      pytype/typegraph/cfg.cc:508:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dealloc : ProgramDealloc,
        ^~~~~~~~~~~~
        .tp_dealloc =
      pytype/typegraph/cfg.cc:510:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_vectorcall_offset: -1,
        ^~~~~~~~~~~~~~~~~~~~~
        .tp_vectorcall_offset =
      pytype/typegraph/cfg.cc:514:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattr : nullptr,
        ^~~~~~~~~~~~
        .tp_getattr =
      pytype/typegraph/cfg.cc:515:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattr : nullptr,
        ^~~~~~~~~~~~
        .tp_setattr =
      pytype/typegraph/cfg.cc:517:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_async : nullptr,
        ^~~~~~~~~~~~~
        .tp_as_async =
      pytype/typegraph/cfg.cc:521:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_repr : nullptr,
        ^~~~~~~~~
        .tp_repr =
      pytype/typegraph/cfg.cc:522:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_number : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_number =
      pytype/typegraph/cfg.cc:523:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_sequence : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_as_sequence =
      pytype/typegraph/cfg.cc:524:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_mapping : nullptr,
        ^~~~~~~~~~~~~~~
        .tp_as_mapping =
      pytype/typegraph/cfg.cc:525:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_hash : nullptr,
        ^~~~~~~~~
        .tp_hash =
      pytype/typegraph/cfg.cc:526:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_call : nullptr,
        ^~~~~~~~~
        .tp_call =
      pytype/typegraph/cfg.cc:527:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_str : nullptr,
        ^~~~~~~~
        .tp_str =
      pytype/typegraph/cfg.cc:528:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattro : ProgramGetAttro,
        ^~~~~~~~~~~~~
        .tp_getattro =
      pytype/typegraph/cfg.cc:529:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattro : ProgramSetAttro,
        ^~~~~~~~~~~~~
        .tp_setattro =
      pytype/typegraph/cfg.cc:530:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_buffer : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_buffer =
      pytype/typegraph/cfg.cc:531:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_flags : 0,
        ^~~~~~~~~~
        .tp_flags =
      pytype/typegraph/cfg.cc:532:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_doc : program_doc,
        ^~~~~~~~
        .tp_doc =
      pytype/typegraph/cfg.cc:533:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_traverse : nullptr,
        ^~~~~~~~~~~~~
        .tp_traverse =
      pytype/typegraph/cfg.cc:534:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_clear : nullptr,
        ^~~~~~~~~~
        .tp_clear =
      pytype/typegraph/cfg.cc:535:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_richcompare : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_richcompare =
      pytype/typegraph/cfg.cc:536:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_weaklistoffset : 0,
        ^~~~~~~~~~~~~~~~~~~
        .tp_weaklistoffset =
      pytype/typegraph/cfg.cc:537:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iter : nullptr,
        ^~~~~~~~~
        .tp_iter =
      pytype/typegraph/cfg.cc:538:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iternext : nullptr,
        ^~~~~~~~~~~~~
        .tp_iternext =
      pytype/typegraph/cfg.cc:539:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_methods : program_methods,
        ^~~~~~~~~~~~
        .tp_methods =
      pytype/typegraph/cfg.cc:540:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_members : nullptr,
        ^~~~~~~~~~~~
        .tp_members =
      pytype/typegraph/cfg.cc:541:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getset : nullptr,
        ^~~~~~~~~~~
        .tp_getset =
      pytype/typegraph/cfg.cc:542:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_base : nullptr,
        ^~~~~~~~~
        .tp_base =
      pytype/typegraph/cfg.cc:543:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dict : nullptr,
        ^~~~~~~~~
        .tp_dict =
      pytype/typegraph/cfg.cc:544:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_descr_get : nullptr,
        ^~~~~~~~~~~~~~
        .tp_descr_get =
      pytype/typegraph/cfg.cc:545:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_descr_set : nullptr,
        ^~~~~~~~~~~~~~
        .tp_descr_set =
      pytype/typegraph/cfg.cc:546:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dictoffset : 0,
        ^~~~~~~~~~~~~~~
        .tp_dictoffset =
      pytype/typegraph/cfg.cc:547:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_init : nullptr,
        ^~~~~~~~~
        .tp_init =
      pytype/typegraph/cfg.cc:548:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_alloc : nullptr,
        ^~~~~~~~~~
        .tp_alloc =
      pytype/typegraph/cfg.cc:549:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_new : ProgramNew,
        ^~~~~~~~
        .tp_new =
      pytype/typegraph/cfg.cc:770:42: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        PyVarObject_HEAD_INIT(&PyType_Type, 0) tp_name : "CFGNode",
                                               ^~~~~~~~~
                                               .tp_name =
      pytype/typegraph/cfg.cc:771:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_basicsize : sizeof(PyCFGNodeObj),
        ^~~~~~~~~~~~~~
        .tp_basicsize =
      pytype/typegraph/cfg.cc:772:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_itemsize : 0,
        ^~~~~~~~~~~~~
        .tp_itemsize =
      pytype/typegraph/cfg.cc:773:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dealloc : CFGNodeDealloc,
        ^~~~~~~~~~~~
        .tp_dealloc =
      pytype/typegraph/cfg.cc:775:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_vectorcall_offset: -1,
        ^~~~~~~~~~~~~~~~~~~~~
        .tp_vectorcall_offset =
      pytype/typegraph/cfg.cc:779:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattr : nullptr,
        ^~~~~~~~~~~~
        .tp_getattr =
      pytype/typegraph/cfg.cc:780:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattr : nullptr,
        ^~~~~~~~~~~~
        .tp_setattr =
      pytype/typegraph/cfg.cc:782:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_async : nullptr,
        ^~~~~~~~~~~~~
        .tp_as_async =
      pytype/typegraph/cfg.cc:786:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_repr : CFGNodeRepr,
        ^~~~~~~~~
        .tp_repr =
      pytype/typegraph/cfg.cc:787:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_number : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_number =
      pytype/typegraph/cfg.cc:788:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_sequence : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_as_sequence =
      pytype/typegraph/cfg.cc:789:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_mapping : nullptr,
        ^~~~~~~~~~~~~~~
        .tp_as_mapping =
      pytype/typegraph/cfg.cc:790:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_hash : nullptr,
        ^~~~~~~~~
        .tp_hash =
      pytype/typegraph/cfg.cc:791:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_call : nullptr,
        ^~~~~~~~~
        .tp_call =
      pytype/typegraph/cfg.cc:792:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_str : CFGNodeRepr,
        ^~~~~~~~
        .tp_str =
      pytype/typegraph/cfg.cc:793:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattro : CFGNodeGetAttro,
        ^~~~~~~~~~~~~
        .tp_getattro =
      pytype/typegraph/cfg.cc:794:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattro : CFGNodeSetAttro,
        ^~~~~~~~~~~~~
        .tp_setattro =
      pytype/typegraph/cfg.cc:795:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_buffer : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_buffer =
      pytype/typegraph/cfg.cc:796:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_flags : 0,
        ^~~~~~~~~~
        .tp_flags =
      pytype/typegraph/cfg.cc:797:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_doc : cfg_node_doc,
        ^~~~~~~~
        .tp_doc =
      pytype/typegraph/cfg.cc:798:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_traverse : nullptr,
        ^~~~~~~~~~~~~
        .tp_traverse =
      pytype/typegraph/cfg.cc:799:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_clear : nullptr,
        ^~~~~~~~~~
        .tp_clear =
      pytype/typegraph/cfg.cc:800:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_richcompare : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_richcompare =
      pytype/typegraph/cfg.cc:801:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_weaklistoffset : 0,
        ^~~~~~~~~~~~~~~~~~~
        .tp_weaklistoffset =
      pytype/typegraph/cfg.cc:802:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iter : nullptr,
        ^~~~~~~~~
        .tp_iter =
      pytype/typegraph/cfg.cc:803:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iternext : nullptr,
        ^~~~~~~~~~~~~
        .tp_iternext =
      pytype/typegraph/cfg.cc:804:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_methods : cfg_node_methods,
        ^~~~~~~~~~~~
        .tp_methods =
      pytype/typegraph/cfg.cc:825:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        name: const_cast<char*>("Origin"),
        ^~~~~
        .name =
      pytype/typegraph/cfg.cc:826:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        doc: origin_doc,
        ^~~~
        .doc =
      pytype/typegraph/cfg.cc:827:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        fields: origin_fields,
        ^~~~~~~
        .fields =
      pytype/typegraph/cfg.cc:828:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        n_in_sequence: 2,
        ^~~~~~~~~~~~~~
        .n_in_sequence =
      pytype/typegraph/cfg.cc:1006:42: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        PyVarObject_HEAD_INIT(&PyType_Type, 0) tp_name : "Binding",
                                               ^~~~~~~~~
                                               .tp_name =
      pytype/typegraph/cfg.cc:1007:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_basicsize : sizeof(PyBindingObj),
        ^~~~~~~~~~~~~~
        .tp_basicsize =
      pytype/typegraph/cfg.cc:1008:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_itemsize : 0,
        ^~~~~~~~~~~~~
        .tp_itemsize =
      pytype/typegraph/cfg.cc:1009:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dealloc : BindingDealloc,
        ^~~~~~~~~~~~
        .tp_dealloc =
      pytype/typegraph/cfg.cc:1011:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_vectorcall_offset: -1,
        ^~~~~~~~~~~~~~~~~~~~~
        .tp_vectorcall_offset =
      pytype/typegraph/cfg.cc:1015:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattr : nullptr,
        ^~~~~~~~~~~~
        .tp_getattr =
      pytype/typegraph/cfg.cc:1016:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattr : nullptr,
        ^~~~~~~~~~~~
        .tp_setattr =
      pytype/typegraph/cfg.cc:1018:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_async : nullptr,
        ^~~~~~~~~~~~~
        .tp_as_async =
      pytype/typegraph/cfg.cc:1022:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_repr : BindingRepr,
        ^~~~~~~~~
        .tp_repr =
      pytype/typegraph/cfg.cc:1023:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_number : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_number =
      pytype/typegraph/cfg.cc:1024:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_sequence : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_as_sequence =
      pytype/typegraph/cfg.cc:1025:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_mapping : nullptr,
        ^~~~~~~~~~~~~~~
        .tp_as_mapping =
      pytype/typegraph/cfg.cc:1026:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_hash : nullptr,
        ^~~~~~~~~
        .tp_hash =
      pytype/typegraph/cfg.cc:1027:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_call : nullptr,
        ^~~~~~~~~
        .tp_call =
      pytype/typegraph/cfg.cc:1028:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_str : BindingRepr,
        ^~~~~~~~
        .tp_str =
      pytype/typegraph/cfg.cc:1029:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattro : BindingGetAttro,
        ^~~~~~~~~~~~~
        .tp_getattro =
      pytype/typegraph/cfg.cc:1030:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattro : nullptr,
        ^~~~~~~~~~~~~
        .tp_setattro =
      pytype/typegraph/cfg.cc:1031:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_buffer : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_buffer =
      pytype/typegraph/cfg.cc:1032:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_flags : 0,
        ^~~~~~~~~~
        .tp_flags =
      pytype/typegraph/cfg.cc:1033:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_doc : binding_doc,
        ^~~~~~~~
        .tp_doc =
      pytype/typegraph/cfg.cc:1034:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_traverse : nullptr,
        ^~~~~~~~~~~~~
        .tp_traverse =
      pytype/typegraph/cfg.cc:1035:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_clear : nullptr,
        ^~~~~~~~~~
        .tp_clear =
      pytype/typegraph/cfg.cc:1036:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_richcompare : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_richcompare =
      pytype/typegraph/cfg.cc:1037:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_weaklistoffset : 0,
        ^~~~~~~~~~~~~~~~~~~
        .tp_weaklistoffset =
      pytype/typegraph/cfg.cc:1038:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iter : nullptr,
        ^~~~~~~~~
        .tp_iter =
      pytype/typegraph/cfg.cc:1039:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iternext : nullptr,
        ^~~~~~~~~~~~~
        .tp_iternext =
      pytype/typegraph/cfg.cc:1040:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_methods : binding_methods,
        ^~~~~~~~~~~~
        .tp_methods =
      pytype/typegraph/cfg.cc:1405:42: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        PyVarObject_HEAD_INIT(&PyType_Type, 0) tp_name : "Variable",
                                               ^~~~~~~~~
                                               .tp_name =
      pytype/typegraph/cfg.cc:1406:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_basicsize : sizeof(PyVariableObj),
        ^~~~~~~~~~~~~~
        .tp_basicsize =
      pytype/typegraph/cfg.cc:1407:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_itemsize : 0,
        ^~~~~~~~~~~~~
        .tp_itemsize =
      pytype/typegraph/cfg.cc:1408:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_dealloc : VariableDealloc,
        ^~~~~~~~~~~~
        .tp_dealloc =
      pytype/typegraph/cfg.cc:1410:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_vectorcall_offset: -1,
        ^~~~~~~~~~~~~~~~~~~~~
        .tp_vectorcall_offset =
      pytype/typegraph/cfg.cc:1414:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattr : nullptr,
        ^~~~~~~~~~~~
        .tp_getattr =
      pytype/typegraph/cfg.cc:1415:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattr : nullptr,
        ^~~~~~~~~~~~
        .tp_setattr =
      pytype/typegraph/cfg.cc:1417:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_async : nullptr,
        ^~~~~~~~~~~~~
        .tp_as_async =
      pytype/typegraph/cfg.cc:1421:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_repr : VariableRepr,
        ^~~~~~~~~
        .tp_repr =
      pytype/typegraph/cfg.cc:1422:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_number : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_number =
      pytype/typegraph/cfg.cc:1423:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_sequence : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_as_sequence =
      pytype/typegraph/cfg.cc:1424:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_mapping : nullptr,
        ^~~~~~~~~~~~~~~
        .tp_as_mapping =
      pytype/typegraph/cfg.cc:1425:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_hash : nullptr,
        ^~~~~~~~~
        .tp_hash =
      pytype/typegraph/cfg.cc:1426:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_call : nullptr,
        ^~~~~~~~~
        .tp_call =
      pytype/typegraph/cfg.cc:1427:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_str : VariableRepr,
        ^~~~~~~~
        .tp_str =
      pytype/typegraph/cfg.cc:1428:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_getattro : VariableGetAttro,
        ^~~~~~~~~~~~~
        .tp_getattro =
      pytype/typegraph/cfg.cc:1429:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_setattro : VariableSetAttro,
        ^~~~~~~~~~~~~
        .tp_setattro =
      pytype/typegraph/cfg.cc:1430:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_as_buffer : nullptr,
        ^~~~~~~~~~~~~~
        .tp_as_buffer =
      pytype/typegraph/cfg.cc:1431:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_flags : 0,
        ^~~~~~~~~~
        .tp_flags =
      pytype/typegraph/cfg.cc:1432:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_doc : variable_doc,
        ^~~~~~~~
        .tp_doc =
      pytype/typegraph/cfg.cc:1433:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_traverse : nullptr,
        ^~~~~~~~~~~~~
        .tp_traverse =
      pytype/typegraph/cfg.cc:1434:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_clear : nullptr,
        ^~~~~~~~~~
        .tp_clear =
      pytype/typegraph/cfg.cc:1435:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_richcompare : nullptr,
        ^~~~~~~~~~~~~~~~
        .tp_richcompare =
      pytype/typegraph/cfg.cc:1436:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_weaklistoffset : 0,
        ^~~~~~~~~~~~~~~~~~~
        .tp_weaklistoffset =
      pytype/typegraph/cfg.cc:1437:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iter : nullptr,
        ^~~~~~~~~
        .tp_iter =
      pytype/typegraph/cfg.cc:1438:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_iternext : nullptr,
        ^~~~~~~~~~~~~
        .tp_iternext =
      pytype/typegraph/cfg.cc:1439:3: warning: use of GNU old-style field designator extension [-Wgnu-designator]
        tp_methods : variable_methods,
        ^~~~~~~~~~~~
        .tp_methods =
      In file included from pytype/typegraph/cfg.cc:11:
      In file included from pytype/typegraph/cfg_logging.h:6:
      pytype/typegraph/pylogging.h:64:22: warning: private field 'stream_' is not used [-Wunused-private-field]
        std::stringstream* stream_;
                           ^
      pytype/typegraph/pylogging.h:66:15: warning: private field 'method_name_' is not used [-Wunused-private-field]
        const char* method_name_;
                    ^
      pytype/typegraph/pylogging.h:67:13: warning: private field 'log_object_' is not used [-Wunused-private-field]
        PyObject* log_object_;
                  ^
      125 warnings and 8 errors generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytype
Successfully built autobahn django-simple-history iso-639 psycopg2-binary pyrsistent sendgrid-django wrapt zope-interface lazy-object-proxy libcst django-role-permissions
Failed to build pytype
ERROR: Could not build wheels for pytype, which is required to install pyproject.toml-based projects
@nth10sd
Copy link

nth10sd commented Oct 25, 2022

For reference for Python 3.11, 0f71fc3 enabled Python 3.10 support only about half a year after release of the new Python.

@rchen152 rchen152 added enhancement cat: core core language and typing features labels Oct 26, 2022
@rchen152 rchen152 changed the title Building with Python 3.11 Support Python 3.11 Oct 26, 2022
@rchen152
Copy link
Contributor

rchen152 commented Oct 26, 2022

pytype doesn't support Python 3.11 yet. Some very old versions of pytype don't set python_requires correctly, so you're probably getting one of those versions when you try to install pytype in 3.11.

rchen152 added a commit that referenced this issue Jan 17, 2023
* Adds new opcodes and magic numbers.
* Removes generate_opcode_diffs' dependency on pytype.platform_utils. This is
  supposed to be a standalone script.
* Handles a change to the MAKE_FUNCTION opcode: pre-3.11, it expects two values
  on the data stack, the function name and code. In 3.11, the name is removed.
* Adjusts _Loadmarshal.load_code. I couldn't find documentation anywhere on
  how/why load_code changed, so I compared the 3.10 and 3.11 code objects. This
  method is still not quite right, but it seems to be mostly working.
* Takes into account new JUMP_BACKWARD* opcodes in opcodes._dis.

This reduces the number of 3.11 failures (found by grepping for "FAIL:" and
"ERROR:" in the opensource test logs) from 3,676 to 3,066.

For #1308.

PiperOrigin-RevId: 501867542
rchen152 added a commit that referenced this issue Jan 21, 2023
@FeryET
Copy link

FeryET commented Jul 4, 2023

Is pytype usuable in Python 3.11 yet?

@martindemello
Copy link
Contributor

no, but we are actively working on it now, it should be usable in the next couple of months

rchen152 added a commit that referenced this issue Jul 21, 2023
Turns out that
acf4668
actually got pretty close to getting relative jumps in 3.11 working. I missed
that the flags for a couple existing jump opcodes changed from JABS to JREL.
The easiest way to handle this is to treat all jumps as relative in 3.11.

I improved generate_opcode_diffs to warn us when an opcode's flags change.

Also does a bit of flags-related cleanup:
* Makes Opcode.FLAGS private. I noticed that we have what are obviously
  intended to be public accessor methods but also occasionally accessed FLAGS
  directly.
* Deletes the unused Opcode.has_arg classmethod, which confusingly has a name
  very similar to the unrelated has_argument classmethod.

I tested this manually by calling dis.dis(...) on some jump-containing code and
checking that the jump targets match what pytype produces.

For #1308.

PiperOrigin-RevId: 549826871
peter-gy added a commit to cmudig/draco2 that referenced this issue Jul 23, 2023
Needed so that the repo Python version and the web Python version are in sync.
To be reverted as soon as google/pytype#1308 is addressed
and we can bump our repo Python version to `3.11`
peter-gy added a commit to cmudig/draco2 that referenced this issue Jul 23, 2023
Needed so that the repo Python version and the web Python version are in sync.
To be reverted as soon as google/pytype#1308 is addressed
and we can bump our repo Python version to `3.11`
rchen152 added a commit that referenced this issue Jul 26, 2023
Found by running typeshed's pytype_test in 3.11.
* typeshed uses "None" as a default value in places. I guess it counts as a
  "literal constant".
* NotRequired has one parameter.

For #1308.

PiperOrigin-RevId: 550049302
thiagowfx pushed a commit to GoogleChromeLabs/chromium-bidi that referenced this issue Sep 21, 2023
Docs: https://github.com/google/pytype

Not enabling pytype in pre-commit as it does not yet support python
3.11: google/pytype#1308
@rchen152 rchen152 self-assigned this Oct 10, 2023
@rchen152
Copy link
Contributor

The next pytype version will support 3.11. I'll update here once that's released.

@rchen152
Copy link
Contributor

rchen152 commented Oct 17, 2023

Ok, pytype-2023.10.17 has basic 3.11 support. Basic means that we don't yet fully support new 3.11 typing features. We have partial support for typing.dataclass_transform, and typing.Self is being actively worked on (#1283).

You can see the status of pytype support for various typing features here: https://google.github.io/pytype/support.html#typing. If there's a feature you'd like to use that doesn't yet have a tracking issue listed on that page, feel free to open one - it helps us with prioritization.

@austinnichols101
Copy link

Just an FYI...

Python 3.11 released 2022-10-24
Python 3.12 released 2023-10-02

peter-gy added a commit to cmudig/draco2 that referenced this issue Oct 20, 2023
Thanks to the resolution of google/pytype#1308
gnoliyil pushed a commit to gnoliyil/fuchsia that referenced this issue Jan 27, 2024
* Started noticing some new pytype errors on same code that used to work
  before even when using pinned version of pytype and python versions
* PyType currently does not work with 3.11 (version that fuchsia is
  planning to move from 3.8). More info @ google/pytype#1308

Since we already use 'mypy' for static type checking and 'pytype' is
just another tool doing the same and it is still unclear whether fuchsia
will adopt pytpe or mypy, for the time-being decided to not use pytype until
either above issues are resolved or if fuchsia adopts pytype

Change-Id: Idb9fd4be06bb73ff677b5dedd2e50356b0c03862
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/880171
Fuchsia-Auto-Submit: Pavan Kumar Juturu <jpavankumar@google.com>
Commit-Queue: Pavan Kumar Juturu <jpavankumar@google.com>
Reviewed-by: Kevin Cho <chok@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat: core core language and typing features enhancement
Projects
None yet
Development

No branches or pull requests

6 participants