fermyon / spin-python-sdk

Spin SDK for Python
https://developer.fermyon.com/spin/v2/python-components
Apache License 2.0
29 stars 11 forks source link

Support targeting the `spin-imports` world #110

Open dicej opened 2 months ago

dicej commented 2 months ago

When building a component intended for composition with other components, it may make sense to target the spin-imports world defined in the src/spin_sdk/wit/spin.wit file in this repo. However, that currently won't work because spin_sdk.http unconditionally imports spin_sdk.wit.exports, which won't exist when targeting spin-imports. One possible solution would be to wrap that import in a try/except block and then skip any code that requires it.