2323 from setuptools .command .install import install
2424 from setuptools .command .develop import develop
2525 from setuptools .command .egg_info import egg_info
26+ from setuptools .command .sdist import sdist
27+
2628except ImportError :
2729 from distutils .core import setup
2830 from distutils .command .install import install
6163# README file from Feast repo root directory
6264repo_root = (
6365 subprocess .Popen (["git" , "rev-parse" , "--show-toplevel" ], stdout = subprocess .PIPE )
64- .communicate ()[0 ]
65- .rstrip ()
66- .decode ("utf-8" )
66+ .communicate ()[0 ]
67+ .rstrip ()
68+ .decode ("utf-8" )
6769)
6870README_FILE = os .path .join (repo_root , "README.md" )
6971with open (os .path .join (README_FILE ), "r" ) as f :
7678 r"^(?:[\/\w-]+)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$"
7779)
7880
79-
8081proto_dirs = [x for x in os .listdir (repo_root + "/protos/feast" )]
8182proto_dirs .remove ("third_party" )
8283
8384
8485def pre_install_build ():
85- """
86- Build Python protos when installing Feast using setup.py
87- """
8886 subprocess .check_call ("make compile-protos-python" , shell = True , cwd = f"{ repo_root } " )
8987 subprocess .check_call ("make build-sphinx" , shell = True , cwd = f"{ repo_root } " )
9088
9189
92- # Classes used to inject pre_install_build()
9390class CustomInstallCommand (install ):
9491 def do_egg_install (self ):
9592 pre_install_build ()
@@ -116,7 +113,7 @@ def run(self):
116113 long_description_content_type = "text/markdown" ,
117114 python_requires = REQUIRES_PYTHON ,
118115 url = URL ,
119- packages = find_packages (exclude = ("tests" ,)),
116+ packages = find_packages (exclude = ("tests" ,)) + [ '.' ] ,
120117 install_requires = REQUIRED ,
121118 # https://stackoverflow.com/questions/28509965/setuptools-development-requirements
122119 # Install dev requirements with: pip install -e .[dev]
@@ -143,6 +140,8 @@ def run(self):
143140 "protos/feast/**/*.proto" ,
144141 "protos/feast/third_party/grpc/health/v1/*.proto" ,
145142 "protos/tensorflow_metadata/proto/v0/*.proto" ,
143+ "feast/protos/feast/**/*.py" ,
144+ "tensorflow_metadata/proto/v0/*.py"
146145 ],
147146 },
148147 cmdclass = {
0 commit comments