Closed heggi closed 1 week ago
I was trying to run the tests of the project but they expect protoc
to be in the PATH. And even then all the tests fail with
/usr/lib/python3.12/subprocess.py:413: CalledProcessError
None: program not found or is not executable
Are the tests expecting some specific environment variables to be set?
Yes, I get this same subprocess problem too, I didn't try to solve it, but I also have the same problem on main branch.
This would be helpful indeed 🙏 any option to upgrade support to latest?
there's a PR open here https://github.com/cpcloud/protoletariat/pull/1033
I faced similar issues as @Jazzinghen, and I solved this issue by creating a protoc wrapper script in my makefile:
VENV_PATH := .venv
PROTOC_WRAPPER := $(VENV_PATH)/bin/protoc
.PHONY: all dep build clean test coverage coverhtml lint protoc
# Step to create the protoc script
create_protoc_script:
@echo '#!/bin/sh' > protoc && \
echo 'python -m grpc_tools.protoc "$$@"' >> protoc && \
chmod +x protoc && \
mkdir -p $(VENV_PATH)/bin && \
cp protoc $(PROTOC_WRAPPER)
# Clean up the script after copying (optional)
clean_protoc_script:
@rm -f protoc
protoletariat expects protoc
to be in the PATH, so this approach works for a virtualenv. In other cases, installing protoc
via system package managers can also work. brew install protobuf
seems to resolve this on macOS for me.
@technusm1 that sounds cool. I'll try to do something like this to run the tests.
brew install protobuf
seems to resolve this on macOS for me.
Sadly on Linux the protobuf/protoc packets are pretty outdated, so there needs to be a way to handle this test without protoc
in the system path
Closed by #1035
Hello!
This library requires protobuf<5. Are there any known issues using it with protobuf 5.*?