UV Wheel Build and Fabric Install Guide
Purpose
Use this guide to package this repository as a distributable Python wheel (.whl) with uv, then install that wheel into a Microsoft Fabric Environment.
This keeps the MVP notebook focused on data product logic while loading framework capabilities from a versioned package, instead of copying helper code between notebooks.
Prerequisites
Before starting, confirm you have:
- VS Code
- Git
- Python
>=3.11(matchespyproject.toml) uvinstalled locally- Access to a Microsoft Fabric workspace and Environment management
- This repository cloned locally
Local setup in VS Code
From a terminal in the repo root:
git checkout main
git pull
uv sync
Run validation checks before building:
# Test suite (this repo has pytest configured)
uv run python -m pytest -q
# Lightweight compile sanity check
uv run python -m compileall src
If you are making release-bound changes, you can also compile tests:
uv run python -m compileall src tests
Build the wheel
Build package artifacts:
uv build
Expected output location:
dist/*.whl(wheel)dist/*.tar.gz(source distribution)
At a high level:
.whl: prebuilt install artifact (recommended for Fabric Environments).tar.gz: source archive for source-based installs/build pipelines
For Fabric notebook environments, upload the .whl artifact.
Versioning before rebuild
Package version currently needs to stay aligned between:
pyproject.tomlunder[project].versionsrc/fabricops_kit/__init__.pyin__version__
Recommended versioning practice for this framework:
- Patch bump (
0.1.0->0.1.1) for small fixes (docs/runtime-safe adjustments) - Minor bump (
0.1.0->0.2.0) for new framework capabilities
After bumping version:
- Rebuild with
uv build - Upload the new wheel to Fabric
- Publish the Environment
- Restart notebook session
Avoid uploading multiple different wheel files with the same version while iterating; it makes Fabric runtime verification and team handover confusing.
Upload and install into Microsoft Fabric
Fabric UI labels can change slightly by tenant/release. The flow is generally:
- Open your Fabric workspace.
- Open an existing Environment (or create one).
- In Environment libraries, use Custom libraries to upload the wheel from
dist/. - Save/publish the Environment.
- Wait for the Environment publish/install step to finish.
- Attach that Environment to your notebook.
- Restart the notebook session/kernel after the library change.
- Run import verification cells.
You may also see Public libraries in the same UI area; for this repo package, use the custom wheel upload path.
Verify inside a Fabric notebook
The package import path for this repository is:
import fabricops_kit as fdpf
Practical verification cells:
import fabricops_kit as fdpf
print("Package loaded:", fdpf.__name__)
print("Module path:", fdpf.__file__)
print("Package version:", getattr(fdpf, "__version__", "unknown"))
from fabricops_kit.profiling import profile_dataframe
import pandas as pd
sample_df = pd.DataFrame(
{
"order_id": [1, 2, 3],
"amount": [10.0, 20.5, 30.25],
"status": ["NEW", "PAID", "NEW"],
}
)
profile = profile_dataframe(sample_df, dataset_name="wheel_install_smoke", engine="auto")
print("Profile keys:", list(profile.keys())[:10])
import fabricops_kit
print([name for name in dir(fabricops_kit) if not name.startswith("_")][:25])
Use with the MVP notebook template
After wheel installation, use this flow:
- Attach the Environment (with the uploaded wheel) to the notebook session.
- Open/copy
templates/notebooks/fabric_data_product_mvp.pyinto Fabric. - Configure notebook parameters (
ENVIRONMENT, source/target table values, dataset/run metadata). - Declare source read logic.
- Run source profiling.
- Generate or load DQ rules.
- Run DQ validation.
- Run transformation logic.
- Write output.
- Write metadata/run summary artifacts.
- Export AI handoff/lineage context where your workflow requires it.
For long-term maintainability, prefer package imports from fabricops_kit over %run 00_config-style helper reuse.
Troubleshooting
- Old framework behavior still appears: old wheel version may still be active in the Environment or running session.
- Import still fails after upload: restart notebook session/kernel and confirm Environment publish finished.
- Wrong Environment attached: verify notebook is bound to the Environment where your wheel was uploaded.
- Import path mismatch: use
import fabricops_kit(module name), not package distribution name with hyphens. - Missing dependencies: check
pyproject.tomldependencies and rebuild/re-upload. - Runtime dependency conflict in Fabric: review Fabric Environment libraries (custom/public) for conflicting versions.
- Wheel built before version bump: increment version, rebuild, re-upload, publish, restart.
- Imported version is not the version you expected: ensure both
pyproject.tomlandsrc/fabricops_kit/__init__.pywere bumped, rebuild the wheel, re-upload it, publish the Environment, and restart the notebook session. - Local tests pass but Fabric calls fail: some runtime behavior depends on Fabric-only execution context and must be validated in Fabric.
Recommended release checklist
- Pull latest
main. - Run local checks (
uv sync, tests, compile checks). - Bump package version in
pyproject.toml. - Run
uv build. - Upload the new wheel to Fabric Environment custom libraries.
- Publish/save the Environment.
- Restart notebook session.
- Run MVP notebook smoke test end to end.
- Record tested package version in handover/release notes.