nod-ai / SHARK-Platform

SHARK Inference Modeling and Serving
Apache License 2.0
9 stars 19 forks source link

[libshortfin] Re-land "Fix standalone Python package build to include subpackages." #225

Closed ScottTodd closed 6 days ago

ScottTodd commented 6 days ago

Progress on https://github.com/nod-ai/SHARK-Platform/issues/130. This reverts https://github.com/nod-ai/SHARK-Platform/pull/224 to re-land https://github.com/nod-ai/SHARK-Platform/pull/223.

This now uses SOURCE_DIR instead of SETUPPY_DIR to fix package discovery when running in pre-built mode, which will fix the errors reported on CI:

 ImportError while loading conftest '/home/runner/work/SHARK-Platform/SHARK-Platform/libshortfin/tests/conftest.py'.
tests/conftest.py:10: in <module>
    import shortfin as sf
E   ModuleNotFoundError: No module named 'shortfin'

Logs from a failed build:

   setup.py running in pre-built mode:
    SOURCE_DIR = /home/runner/work/SHARK-Platform/SHARK-Platform/libshortfin
    BINARY_DIR = /home/runner/work/SHARK-Platform/SHARK-Platform/libshortfin/build
  Found libshortfin packages: ['_shortfin_default']

Logs from a successful build:

   setup.py running in pre-built mode:
    SOURCE_DIR = /home/runner/work/SHARK-Platform/SHARK-Platform/libshortfin
    BINARY_DIR = /home/runner/work/SHARK-Platform/SHARK-Platform/libshortfin/build
  Found libshortfin packages: ['shortfin_apps', 'shortfin', '_shortfin', 'shortfin_apps.llm', 'shortfin_apps.llm.components', 'shortfin.interop', 'shortfin.support', 'shortfin.interop.fastapi', 'shortfin.interop.support']