mxrch / ProtoDeep

🏄‍♂️ Decode and analyze protobuf efficiently.
MIT License
111 stars 5 forks source link

`grpcio-tools==1.51.3` is not compatible with `python3.12` #8

Open AmgdGocha opened 6 months ago

AmgdGocha commented 6 months ago

Hi fellows,

I'm getting this error while installing ProtoDeep, do you have any idea what might the cause and how to resolve it?

(venv) PS C:\Amged\Personal\my_projects> pip install protodeep
Collecting protodeep
  Using cached protodeep-1.1.0-py3-none-any.whl.metadata (8.7 kB)
Collecting six==1.16.0 (from protodeep)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting rich==12.6.0 (from protodeep)
  Using cached rich-12.6.0-py3-none-any.whl.metadata (18 kB)
Collecting rich-argparse==1.0.0 (from protodeep)
  Using cached rich_argparse-1.0.0-py3-none-any.whl.metadata (9.6 kB)
Collecting grpcio-tools==1.51.3 (from protodeep)
  Using cached grpcio-tools-1.51.3.tar.gz (2.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting protobuf==4.22.0 (from protodeep)
  Using cached protobuf-4.22.0-cp310-abi3-win_amd64.whl.metadata (540 bytes)
Requirement already satisfied: grpcio>=1.51.3 in c:\amged\personal\my_projects\venv\lib\site-packages (from grpcio-tools==1.51.3->protodeep) (1.64.0rc1)
Requirement already satisfied: setuptools in c:\amged\personal\my_projects\\venv\lib\site-packages (from grpcio-tools==1.51.3->protodeep) (69.5.1)
Collecting commonmark<0.10.0,>=0.9.0 (from rich==12.6.0->protodeep)
  Using cached commonmark-0.9.1-py2.py3-none-any.whl.metadata (5.7 kB)
Collecting pygments<3.0.0,>=2.6.0 (from rich==12.6.0->protodeep)
  Using cached pygments-2.18.0-py3-none-any.whl.metadata (2.5 kB)
Using cached protodeep-1.1.0-py3-none-any.whl (47 kB)
Using cached protobuf-4.22.0-cp310-abi3-win_amd64.whl (420 kB)
Using cached rich-12.6.0-py3-none-any.whl (237 kB)
Using cached rich_argparse-1.0.0-py3-none-any.whl (11 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Building wheels for collected packages: grpcio-tools
  Building wheel for grpcio-tools (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for grpcio-tools (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [96 lines of output]
      <string>:30: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\grpc_tools
      copying grpc_tools\command.py -> build\lib.win-amd64-cpython-312\grpc_tools
      copying grpc_tools\protoc.py -> build\lib.win-amd64-cpython-312\grpc_tools
      copying grpc_tools\__init__.py -> build\lib.win-amd64-cpython-312\grpc_tools
      creating build\lib.win-amd64-cpython-312\grpc_tools\_proto
      creating build\lib.win-amd64-cpython-312\grpc_tools\_proto\google
      creating build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\any.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\api.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\duration.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\empty.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\field_mask.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\source_context.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\struct.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\timestamp.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\type.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      copying grpc_tools\_proto\google\protobuf\wrappers.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      creating build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf\compiler
      copying grpc_tools\_proto\google\protobuf\compiler\plugin.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf\compiler
      copying grpc_tools\_proto\google\protobuf\descriptor.proto -> build\lib.win-amd64-cpython-312\grpc_tools\_proto\google\protobuf
      running build_ext
      building 'grpc_tools._protoc_compiler' extension
      creating build\temp.win-amd64-cpython-312
      creating build\temp.win-amd64-cpython-312\Release
      creating build\temp.win-amd64-cpython-312\Release\grpc_root
      creating build\temp.win-amd64-cpython-312\Release\grpc_root\src
      creating build\temp.win-amd64-cpython-312\Release\grpc_root\src\compiler
      creating build\temp.win-amd64-cpython-312\Release\grpc_tools
      creating build\temp.win-amd64-cpython-312\Release\third_party
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\cpp
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\csharp
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\java
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\objectivec
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\php
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\python
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\compiler\ruby
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\io
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\stubs
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\util
      creating build\temp.win-amd64-cpython-312\Release\third_party\protobuf\src\google\protobuf\util\internal
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWIN32_LEAN_AND_MEAN=1 -DMS_WIN64=1 -I. -Igrpc_root -Igrpc_root\include
 -Ithird_party\protobuf\src -IC:\Amged\Personal\my_projects\venv\include -IC:\Users\amged\AppData\Local\Programs\Python\Python312\include -IC:\Users\amged\AppData\Local\Programs\Python\Python312\Include "-IC:\Prog
ram Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\incl
ude\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0
\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /EHsc /Tpgrpc_root\src\compiler\python_generator.cc /Fobuild\temp.win-amd64-cpython-312\Release\grpc_root\src\compiler\python_generator.obj -std=c++14 /MT
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
      python_generator.cc
      grpc_root\src/compiler/python_generator_helpers.h(104): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
      grpc_root\src/compiler/python_generator_helpers.h(104): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
      grpc_root\src\compiler\python_generator.cc(852): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
      grpc_root\src\compiler\python_generator.cc(893): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
      grpc_root\src\compiler\python_generator.cc(893): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
      "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWIN32_LEAN_AND_MEAN=1 -DMS_WIN64=1 -I. -Igrpc_root -Igrpc_root\include
 -Ithird_party\protobuf\src -IC:\Amged\Personal\my_projects\venv\include -IC:\Users\amged\AppData\Local\Programs\Python\Python312\include -IC:\Users\amged\AppData\Local\Programs\Python\Python312\Include "-IC:\Prog
ram Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\incl
ude\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /EHsc /Tpgrpc_tools\_protoc_compiler.cpp /Fobuild\temp.win-amd64-cpython-312\Release\grpc_tools\_protoc_compiler.obj -std=c++14 /MT
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
      _protoc_compiler.cpp
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\pyconfig.h(130): warning C4005: 'MS_WIN64': macro redefinition
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\pyconfig.h(130): note: 'MS_WIN64' previously declared on the command line
      grpc_tools\_protoc_compiler.cpp(2180): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'int', possible loss of data
      grpc_tools\_protoc_compiler.cpp(3748): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(3888): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(4047): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(4156): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(6362): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(7109): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(7121): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(7125): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(7142): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(7335): error C2039: 'curexc_traceback': is not a member of '_ts'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts'
      grpc_tools\_protoc_compiler.cpp(7338): error C2039: 'curexc_traceback': is not a member of '_ts'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts'
      grpc_tools\_protoc_compiler.cpp(8238): warning C4996: 'PyDictObject::ma_version_tag': deprecated in 3.12
      grpc_tools\_protoc_compiler.cpp(8539): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(8594): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(8773): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(8828): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(8969): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(9024): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      grpc_tools\_protoc_compiler.cpp(10674): error C2039: 'ob_digit': is not a member of '_longobject'
      C:\Users\amged\AppData\Local\Programs\Python\Python312\include\cpython/longintrepr.h(87): note: see declaration of '_longobject'
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for grpcio-tools
Failed to build grpcio-tools
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (grpcio-tools)

BTW, grpcio-tools is installed successfully.

AmgdGocha commented 2 months ago

protodeep depends on grpcio-tools==1.51.3 which is not compatible with the newer versions of python3.12. can you just change the version to 1.66.1 so we can use your package on newer versions of python? here is an issue on the grpc project that fixes the computability issues https://github.com/grpc/grpc/issues/33063

mxrch commented 1 month ago

Heyo, sorry for the wait, I'm on it

mxrch commented 1 month ago

The version 1.66.2 seems to work with Python 3.13. I'll push it, let me know if it will fix your case, at least it pass the tests