bundle-examples icon indicating copy to clipboard operation
bundle-examples copied to clipboard

Request: Add `python_wheel_uv` example

Open philiporlando opened this issue 9 months ago • 4 comments

I'd like to request the addition of a python_wheel_uv bundle example to the knowledge base.

Many Python developers prefer using uv over Poetry or the default Databricks dependency management tools, but currently there is no official examples or guidance on how to configure this setup correctly within a Databricks bundle.

I've been following along with this community post, but I'm running into the following error when calling databricks bundle run my_project:

AttributeError: module 'my_project' has no attribute 'main'

It's currently unclear how the pyproject.toml should be configured to ensure that Databricks correctly detects the entry point into the main module during deployment.

Having an officially supported uv bundle example would be incredibly helpful and much appreciated by the community.

Thanks for considering!

philiporlando avatar Apr 11 '25 16:04 philiporlando

The error I was seeing above was actually due to a separate problem. I didn't realize that Databricks caches wheels based on their file name, and won't reinstall a wheel with the same version even if the content has changed. Incrementing the version number of my package before calling databricks bundle deploy -t dev ensured that the changes I made to incorporate uv (namely replacing the setup.py file with a pyproject.toml) were actually included in the new bundle. I'm still struggling to find any Databricks documentation that explains this behavior though...

philiporlando avatar Apr 11 '25 20:04 philiporlando

I found another helpful article on how to configure Databricks Asset Bundles with uv.

philiporlando avatar Apr 21 '25 16:04 philiporlando

+1, I've run into the same issue. An up to date example with uv and pyproject.toml would be helpful.

sastafford avatar Jul 23 '25 23:07 sastafford

It looks like some details related to uv have been included in the official docs! Haven't tried testing them yet though.

philiporlando avatar Jul 24 '25 17:07 philiporlando