Index
flavor.packaging.python
¶
Module for flavorpack.
Classes¶
PyPaPipManager
¶
Dedicated PyPA pip command management.
Handles all pip-specific operations with proper platform support and manylinux2014 compatibility for Linux.
CRITICAL: This class contains essential PyPA functionality for: - Platform-specific wheel selection (manylinux2014 for Linux compatibility) - Proper dependency resolution that uv pip cannot handle - Binary wheel downloading for cross-platform builds - Correct Python version targeting
DO NOT REPLACE pip commands with uv pip - they have different capabilities!
Initialize the pip manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_version
|
str
|
Target Python version for pip operations |
'3.11'
|
Source code in flavor/packaging/python/pypapip_manager.py
Functions¶
build_wheel_from_source
¶
build_wheel_from_source(
python_exe: Path,
source_path: Path,
wheel_dir: Path,
no_deps: bool = True,
) -> None
Build wheel from source directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to Python executable |
required |
source_path
|
Path
|
Path to source directory with setup.py or pyproject.toml |
required |
wheel_dir
|
Path
|
Directory to place built wheel |
required |
no_deps
|
bool
|
Whether to build without dependencies |
True
|
Source code in flavor/packaging/python/pypapip_manager.py
download_wheels_for_packages
¶
Download wheels for specified packages.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to Python executable |
required |
packages
|
list[str]
|
List of package names/requirements |
required |
dest_dir
|
Path
|
Directory to download wheels to |
required |
Retries
Up to 3 attempts with exponential backoff for network errors
Source code in flavor/packaging/python/pypapip_manager.py
download_wheels_from_requirements
¶
download_wheels_from_requirements(
python_exe: Path,
requirements_file: Path,
dest_dir: Path,
) -> None
Download wheels for packages listed in requirements file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to Python executable |
required |
requirements_file
|
Path
|
Path to requirements.txt file |
required |
dest_dir
|
Path
|
Directory to download wheels to |
required |
Retries
Up to 3 attempts with exponential backoff for network errors
Source code in flavor/packaging/python/pypapip_manager.py
install_packages
¶
Install packages using pip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to Python executable |
required |
packages
|
list[str]
|
List of package names/requirements to install |
required |