This document explains how Discogsography handles platform-specific Python package wheels to ensure compatibility with our Docker build environments.
Some Python packages (like Pillow) include platform-specific wheels for iOS that are incompatible with Docker builds on
Linux. These wheels cause uv sync to fail with errors like:
failed to parse `pillow-11.3.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl` as wheel filename:
The wheel filename has an invalid platform tag: Unknown platform tag format: ios_13_0_arm64_iphoneos
We use uv's built-in environment restrictions feature to limit which platform wheels are included in uv.lock.
In pyproject.toml, we've added:
[tool.uv]
environments = [
# Only support Linux platforms that we build for in CI/CD
"sys_platform == 'linux' and platform_machine == 'x86_64'", # linux/amd64
"sys_platform == 'linux' and platform_machine == 'aarch64'", # linux/arm64
# Also support local development on macOS
"sys_platform == 'darwin' and platform_machine == 'x86_64'", # macOS Intel
"sys_platform == 'darwin' and platform_machine == 'arm64'", # macOS Apple Silicon
]This configuration ensures uv.lock only includes wheels for:
- Linux amd64 (x86_64) - Used in production Docker containers
- Linux arm64 (aarch64) - Used in production Docker containers on ARM
- macOS Intel (x86_64) - For local development on Intel Macs
- macOS Apple Silicon (arm64) - For local development on M1/M2/M3 Macs
- No manual cleanup needed: iOS and other incompatible wheels are automatically excluded
- Consistent builds: Docker builds work reliably across all platforms
- Smaller lock file: Only includes relevant wheels for our target platforms
- Future-proof: Any new incompatible platforms are automatically excluded
When upgrading packages:
# The platform restrictions are automatically applied
./scripts/update-project.shOr when manually updating the lock file:
# uv automatically respects the environment restrictions
uv lock