wheel_builder
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
flavor.packaging.python.wheel_builder
¶
Wheel building and dependency resolution for FlavorPack packaging.
This module provides wheel building with complex dependency resolution logic, combining UV performance where appropriate with PyPA pip compatibility.
Classes¶
WheelBuilder
¶
Wheel builder with sophisticated dependency resolution.
Combines the speed of UV with the reliability of PyPA pip for complex Python package building scenarios.
This class handles: - Source package wheel building - Complex dependency resolution - Cross-platform wheel selection - Proper manylinux compatibility
Initialize the wheel builder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_version
|
str
|
Target Python version for wheel building |
'3.11'
|
Source code in flavor/packaging/python/wheel_builder.py
Functions¶
build_and_resolve_project
¶
build_and_resolve_project(
python_exe: Path,
project_dir: Path,
build_dir: Path,
requirements_file: Path | None = None,
extra_packages: list[str] | None = None,
) -> dict[str, Any]
Complete wheel building and dependency resolution for a project.
CRITICAL: The PROJECT wheel is ALWAYS built from LOCAL SOURCE. Runtime dependencies are resolved and downloaded from PyPI as normal. This ensures the packaged project is never downloaded from PyPI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Python executable to use |
required |
project_dir
|
Path
|
Project source directory |
required |
build_dir
|
Path
|
Directory for build artifacts |
required |
requirements_file
|
Path | None
|
Optional requirements file |
None
|
extra_packages
|
list[str] | None
|
Additional packages to include |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with build information and file paths |
Source code in flavor/packaging/python/wheel_builder.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
build_wheel_from_source
¶
build_wheel_from_source(
python_exe: Path,
source_path: Path,
wheel_dir: Path,
use_isolation: bool = True,
build_options: dict[str, Any] | None = None,
) -> Path
Build wheel from Python source package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Python executable to use |
required |
source_path
|
Path
|
Path to source directory |
required |
wheel_dir
|
Path
|
Directory to place built wheel |
required |
use_isolation
|
bool
|
Whether to use build isolation |
True
|
build_options
|
dict[str, Any] | None
|
Additional build options |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the built wheel file |
Source code in flavor/packaging/python/wheel_builder.py
download_wheels_for_resolved_deps
¶
download_wheels_for_resolved_deps(
python_exe: Path,
requirements_file: Path,
wheel_dir: Path,
use_uv_for_download: bool = False,
) -> list[Path]
Download wheels for resolved dependencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Python executable to use |
required |
requirements_file
|
Path
|
Locked requirements file |
required |
wheel_dir
|
Path
|
Directory to download wheels to |
required |
use_uv_for_download
|
bool
|
Whether to use UV for downloading |
False
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
List of downloaded wheel file paths |
Source code in flavor/packaging/python/wheel_builder.py
resolve_dependencies
¶
resolve_dependencies(
python_exe: Path,
requirements_file: Path | None = None,
packages: list[str] | None = None,
*,
output_dir: Path,
use_uv_for_resolution: bool = True,
) -> Path
Resolve dependencies and create a locked requirements file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Python executable to use |
required |
requirements_file
|
Path | None
|
Input requirements file |
None
|
packages
|
list[str] | None
|
List of packages to resolve |
None
|
output_dir
|
Path
|
Directory for output files |
required |
use_uv_for_resolution
|
bool
|
Whether to use UV for fast resolution |
True
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to locked requirements file |