Comments (7)
This is an issue with the documentation. The wheel file doesn't contain the dependency for the provalidate source files and must be generated. Ensure you follow the guide here to generate with buf.
You should have the following source files locally:
gen
└── buf
└── validate
├── expression_pb2.py
├── priv
│ └── private_pb2.py
└── validate_pb2.py
Now for python to find this package as buf.validate.expression_pb2
the following env variable is required to be set:
PYTHONPATH=gen
from protovalidate-python.
Glad you fixed it. It could be due to not having any imports for the validation library. Check your source files have import "buf/validate/validate.proto";
and use the import to validate. Run buf dep update
and check that a buf.lock
file is generated with a dep on buf.build/bufbuild/protovalidate
. Once you start to use the validation library --inlcude-imports
should work.
from protovalidate-python.
What should I do if I am using python -m grpcio_tools.protoc instead of buf to compile the proto file?
from protovalidate-python.
I faced same problem 🙋
from protovalidate-python.
Seeing the same
from protovalidate-python.
Thanks @emcfarlane . I found that running buf generate --include-imports
does not generate the buf
folder as expected, however, running buf generate buf.build/bufbuild/protovalidate
does generate the proper folder structure. Any ideas why that might be?
from protovalidate-python.
@emcfarlane Thanks! That indeed did fix it. Appreciate the help
from protovalidate-python.
Related Issues (13)
- [Question] How to install? HOT 2
- [BUG] Generated Python code leads to runtime errors HOT 3
- support proto-plus wrapped types HOT 1
- [BUG] Import error (buf/validate/validate.proto: does not exist)
- [BUG] requires-python = ">=3.7" in pyproject.toml is inaccurate
- [BUG] ImportError on import buf/validate HOT 4
- [BUG]: On import of protovalidate HOT 1
- Support for python <3.11 HOT 3
- Cannot import protovalidate `ModuleNotFoundError: No module named 'buf'` HOT 5
- Consider using a RE2 compliant CEL evaluator
- [BUG] python use python -m grpc_tools.proto gen code get ModuleNotFoundError: No module named 'buf' HOT 3
- Buf doesn't generate protovalidate python files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protovalidate-python.