Skip to content

Doesn't build on python 3.11 #192

@llimllib

Description

@llimllib

thriftpy2 can't be installed from pypi against python3.11, because it expects the longintrepr.h header, which was removed in: python/cpython#28968

Apparently this was fixed in cython here: cython/cython#4428

On my system, the result of pip install thriftpy2 while using an asdf-installed python 3.11 is:

build output
$ pip install thriftpy2
Collecting thriftpy2
  Using cached thriftpy2-0.4.14.tar.gz (361 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: ply<4.0,>=3.4 in ./.asdf/installs/python/3.11.0/lib/python3.11/site-packages (from thriftpy2) (3.11)
Installing collected packages: thriftpy2
  DEPRECATION: thriftpy2 is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for thriftpy2 ... error
  error: subprocess-exited-with-error

  × Running setup.py install for thriftpy2 did not run successfully.
  │ exit code: 1
  ╰─> [124 lines of output]
      running install
      /Users/llimllib/.asdf/installs/python/3.11.0/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-13.0-arm64-cpython-311
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/server.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/hook.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/thrift.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/rpc.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/utils.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/tornado.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/http.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      copying thriftpy2/_compat.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/_ssl.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/sslsocket.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/socket.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/base.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/binary.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/compact.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/exc.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/multiplex.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/json.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      copying thriftpy2/protocol/base.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/parser
      copying thriftpy2/parser/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/parser
      copying thriftpy2/parser/parser.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/parser
      copying thriftpy2/parser/exc.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/parser
      copying thriftpy2/parser/lexer.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/parser
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib
      copying thriftpy2/contrib/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/memory
      copying thriftpy2/transport/memory/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/memory
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/buffered
      copying thriftpy2/transport/buffered/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/buffered
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/framed
      copying thriftpy2/transport/framed/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/framed
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/server.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/client.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/processor.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/rpc.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      copying thriftpy2/contrib/aio/socket.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/tracking
      copying thriftpy2/contrib/tracking/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/tracking
      copying thriftpy2/contrib/tracking/tracker.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/tracking
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/transport
      copying thriftpy2/contrib/aio/transport/buffered.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/transport
      copying thriftpy2/contrib/aio/transport/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/transport
      copying thriftpy2/contrib/aio/transport/base.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/transport
      copying thriftpy2/contrib/aio/transport/framed.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/transport
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/protocol
      copying thriftpy2/contrib/aio/protocol/binary.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/protocol
      copying thriftpy2/contrib/aio/protocol/compact.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/protocol
      copying thriftpy2/contrib/aio/protocol/__init__.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/protocol
      copying thriftpy2/contrib/aio/protocol/base.py -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/aio/protocol
      running egg_info
      writing thriftpy2.egg-info/PKG-INFO
      writing dependency_links to thriftpy2.egg-info/dependency_links.txt
      writing requirements to thriftpy2.egg-info/requires.txt
      writing top-level names to thriftpy2.egg-info/top_level.txt
      reading manifest file 'thriftpy2.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'thriftpy2.egg-info/SOURCES.txt'
      /Users/llimllib/.asdf/installs/python/3.11.0/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'thriftpy2.protocol.cybin' as data is deprecated, please list it in `packages`.
          !!


          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'thriftpy2.protocol.cybin' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.

          'thriftpy2.protocol.cybin' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).

          Please make sure that 'thriftpy2.protocol.cybin' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).

          You can read more about "package discovery" and "data files" on setuptools
          documentation page.


      !!

        check.warn(importable)
      copying thriftpy2/transport/cybase.c -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/cybase.pxd -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      copying thriftpy2/transport/cybase.pyx -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      creating build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol/cybin
      copying thriftpy2/protocol/cybin/cybin.c -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol/cybin
      copying thriftpy2/protocol/cybin/cybin.pyx -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol/cybin
      copying thriftpy2/protocol/cybin/endian_port.h -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/protocol/cybin
      copying thriftpy2/transport/memory/cymemory.c -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/memory
      copying thriftpy2/transport/memory/cymemory.pyx -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/memory
      copying thriftpy2/transport/buffered/cybuffered.c -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/buffered
      copying thriftpy2/transport/buffered/cybuffered.pyx -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/buffered
      copying thriftpy2/transport/framed/cyframed.c -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/framed
      copying thriftpy2/transport/framed/cyframed.pyx -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/transport/framed
      copying thriftpy2/contrib/tracking/tracking.thrift -> build/lib.macosx-13.0-arm64-cpython-311/thriftpy2/contrib/tracking
      running build_ext
      building 'thriftpy2.transport.cybase' extension
      creating build/temp.macosx-13.0-arm64-cpython-311
      creating build/temp.macosx-13.0-arm64-cpython-311/thriftpy2
      creating build/temp.macosx-13.0-arm64-cpython-311/thriftpy2/transport
      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Users/llimllib/.asdf/installs/python/3.11.0/include/python3.11 -c thriftpy2/transport/cybase.c -o build/temp.macosx-13.0-arm64-cpython-311/thriftpy2/transport/cybase.o
      thriftpy2/transport/cybase.c:209:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.h"
                 ^~~~~~~~~~~~~~~
      1 error 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: legacy-install-failure

× Encountered error while trying to install package.
╰─> thriftpy2

note: This is an issue with the package mentioned above, not pip.

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