File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ package-protos:
4646 cp -r ${ROOT_DIR} /protos ${ROOT_DIR} /sdk/python/feast/protos
4747
4848compile-protos-python :
49- python setup.py build_python_protos
49+ python sdk/python/ setup.py build_python_protos
5050
5151install-python :
5252 cd sdk/python && python -m piptools sync requirements/py$(PYTHON ) -requirements.txt
Original file line number Diff line number Diff line change @@ -215,8 +215,14 @@ def _generate_python_protos(self, path: str):
215215 def run (self ):
216216 for sub_folder in self .sub_folders :
217217 self ._generate_python_protos (f"feast/{ sub_folder } /*.proto" )
218-
219- from pathlib import Path
218+ # We need the __init__ files for each of the generated subdirs
219+ # so that they are regular packages, and don't need the `--namespace-packages` flags
220+ # when being typechecked using mypy. BUT, we need to exclude `types` because that clashes
221+ # with an existing module in the python standard library.
222+ if sub_folder == "types" :
223+ continue
224+ with open (f"{ self .python_folder } /feast/{ sub_folder } /__init__.py" , 'w' ):
225+ pass
220226
221227 for path in Path ("feast/protos" ).rglob ("*.py" ):
222228 for folder in self .sub_folders :
You can’t perform that action at this time.
0 commit comments