The CI pipeline fails when uploading httpx-0.26.0.tar.gz to GitLab PyPI registry with the following error:
ERROR InvalidDistribution: Invalid distribution metadata: license-expression
introduced in metadata version 2.4, not 2.1
- httpx 0.26.0 uses Metadata-Version 2.4 - The upstream PyPI package for httpx 0.26.0 includes the
license-expressionfield, which was introduced in PEP 639 and requires Metadata-Version 2.4 - GitLab PyPI registry doesn't support Metadata-Version 2.4 - GitLab's package registry currently only supports up to Metadata-Version 2.1
- Newer httpx versions (0.27.x+) also use 2.4 - So we cannot upgrade httpx without hitting the same issue
litellm<1.60.0requireshttpx<0.28.0httpx 0.26.0is compatible withh11>=0.16.0(required by llama-stack)httpx 0.27.x+requires metadata 2.4, which GitLab doesn't support- We've constrained
litellm>=1.53.0,<1.60.0in constraints.txt
File: collections/llama-stack/cpu-ubi9/skip-packages.txt
# httpx 0.26.0 from PyPI uses Metadata-Version 2.4 (license-expression field)
# GitLab PyPI registry doesn't support metadata 2.4
# Fixes: https://issues.redhat.com/browse/RHAIENG-1790
# See also: constraints.txt for httpx version pinning
httpx
Intent: Packages listed in skip-packages.txt should NOT be uploaded to GitLab PyPI registry. Instead, they will be fetched directly from PyPI during installation.
File: collections/llama-stack/cpu-ubi9/constraints.txt
# httpx conflict resolution
# Fixes: https://issues.redhat.com/browse/RHAIENG-1762, RHAIENG-1775, RHAIENG-1787, RHAIENG-1788, RHAIENG-1790
# httpx 0.26.0 is compatible with h11>=0.16.0 (required by llama-stack)
# httpx 0.26.0 uses httpcore==1.* which supports h11>=0.16
# httpx 0.27.x uses Metadata-Version 2.4 which GitLab PyPI registry doesn't support
# httpx 0.26.0 from PyPI also uses Metadata-Version 2.4 (license-expression field)
# httpx is listed in skip-packages.txt to prevent upload to GitLab registry
# It will be fetched directly from PyPI during installation instead
httpx==0.26.0
httpcore==1.*File: distribution/build.yaml
build_system:
requires:
- wheel>=0.45.1
# setuptools < 70.1.0 to avoid Metadata-Version 2.4 generation
# setuptools 70.1.0+ generates metadata 2.4 for packages with license-expression
# GitLab PyPI registry doesn't support metadata 2.4, causing upload failures
# See: https://issues.redhat.com/browse/RHAIENG-1762, RHAIENG-1775
- setuptools>=69.0.0,<70.1.0Note: This prevents our packages from generating metadata 2.4, but doesn't affect upstream packages like httpx.
-
Builder version may not support skip-packages.txt
- Current builder version:
v24.0.2(from builder-image-version.yml) - The skip-packages.txt feature may not be implemented or has a bug in this version
- Current builder version:
-
CI cache issue
- Pipeline might be using cached source distributions built before skip-packages.txt was added
- Cache invalidation may be needed
-
File format issue
- skip-packages.txt might need a specific format (e.g., version specifiers, glob patterns)
- Need to verify the expected format from builder documentation
- Check if
redhat/rhel-ai/wheels/builder:v24.0.2supports skip-packages.txt - Review builder documentation/code for correct skip-packages.txt format
- Consider upgrading to a newer builder version if available
- Modify upload step: Filter out httpx before twine upload
- Rebuild source distribution: Patch httpx metadata during build to downgrade to 2.1
- Use --exclude flag: Check if builder pipeline has an exclude option
- Clear GitLab CI cache
- Force rebuild of all source distributions
- Ensure skip-packages.txt changes are picked up
- RHAIENG-1762: Initial httpx metadata issues
- RHAIENG-1775: mcp package removal due to httpx>=0.27.1 requirement
- RHAIENG-1787: Related httpx conflicts
- RHAIENG-1788: Related httpx conflicts
- RHAIENG-1790: This issue - httpx upload failure
- RHAIENG-1791: Added skip-packages.txt (fix attempt)
collections/llama-stack/cpu-ubi9/skip-packages.txt- Added httpx to skip listcollections/llama-stack/cpu-ubi9/constraints.txt- Extensive httpx pinning and documentationdistribution/build.yaml- Setuptools constraint, removed mcp providerdistribution/build.py- Filters to exclude google-cloud-aiplatform, google-genai, and mcp
- Runtime: httpx will be fetched from PyPI during installation (not from GitLab registry)
- Dependencies: All dependent packages (litellm, etc.) will continue to work
- Build time: No impact once the fix is working correctly