Updating version for pip for latest #1191
Conversation
for stack(s) cflinuxfs4, cflinuxfs5
This fixes the 'more than one version of pip found' error by ensuring each stack has exactly one pip version available: - cflinuxfs3: pip 25.2 - cflinuxfs4: pip 26.1.2 - cflinuxfs5: pip 26.1.2 The buildpack's InstallOnlyVersion() function requires exactly one version per dependency per stack. This follows the same pattern used by pipenv which has different versions for different stacks. Fixes the integration test failure: TestIntegration/integration/Pip/.../when_using_latest_version/uses_latest_from_manifest
Fix AppliedI've updated the PR to resolve the Root CauseThe buildpack's
This meant cflinuxfs4 and cflinuxfs5 had two pip versions available, triggering the error. SolutionRestricted pip 25.2 to cflinuxfs3 only:
Now each stack has exactly one pip version, following the same pattern used by pipenv in the manifest. Result
This is a non-breaking change since cflinuxfs3 continues working with its existing pip version. |
pip 26+ uses flit-core as its build backend (via PEP 517) instead of setuptools. When installing pip with BP_PIP_VERSION=latest, we need to provide flit-core in the --find-links directory so pip can build itself. Changes: - InstallPip() now downloads flit-core to /tmp/pip alongside pip - Gracefully handles missing flit-core (cflinuxfs3 with pip 25.2) - Only logs warning if flit-core unavailable (doesn't fail) This fixes the error: ERROR: Could not find a version that satisfies the requirement flit-core<4,>=3.11 (from versions: none) Note: flit-core is only in manifest for cflinuxfs4/5, which matches the stacks that use pip 26.1.2 after the previous commit. Related: - pip 26.1.2 pyproject.toml requires: flit-core<4,>=3.11 - Manifest has flit-core 3.12.0 for cflinuxfs4/cflinuxfs5
Complete Fix AppliedI've added a second commit to address the flit-core dependency issue that would have caused the tests to still fail. Issue #2: Missing flit-corepip 26.1.2 uses flit-core as its build backend (PEP 517), but the dependency was not being provided during installation. Error that would have occurred: SolutionModified Code change: // pip 26+ requires flit-core as a build dependency
// Install it to the same tempPath so pip can find it during build
if err := s.Installer.InstallOnlyVersion("flit-core", tempPath); err != nil {
// Log warning but continue - older pip versions don't need flit-core
s.Log.Warning("Could not install flit-core (required for pip 26+): %v", err)
}Why This Works
Complete Fix Summary
Integration tests should now pass completely. |
e616eb3 to
f9520f0
Compare
Fix CorrectedThe previous fix attempt was downloading flit-core but not installing it, which is why the tests still failed. Root Cause of the FailureThe flit-core package in the buildpack dependency repository contains source code, not a wheel or sdist. When we extracted it to Corrected SolutionNow we properly install flit-core into the Python environment before pip tries to use it: // Download flit-core source
if err := s.Installer.InstallOnlyVersion("flit-core", tempPath); err == nil {
// Install it into Python environment using pip
s.Log.Info("Installing flit-core (required for pip 26+)")
if err := s.runPipInstall(tempPath, "--no-build-isolation"); err != nil {
s.Log.Warning("Could not install flit-core: %v", err)
}
}This calls: Why This Works
PatternThis follows the exact same pattern as Test Status
The integration tests should now pass completely. |
pip 26+ uses flit-core as its build backend (via PEP 517) instead of setuptools. When installing pip with BP_PIP_VERSION=latest, we need to install flit-core into the Python environment so pip can use it. Changes: - InstallPip() now downloads flit-core to /tmp/pip alongside pip - Installs flit-core using 'python -m pip install' (not runPipInstall) - Uses 'python -m pip' directly since pip isn't in PATH yet - Gracefully handles missing flit-core (cflinuxfs3 with pip 25.2) This fixes the error: ERROR: Could not find a version that satisfies the requirement flit-core<4,>=3.11 (from versions: none) Key insights: 1. flit-core must be INSTALLED into Python environment, not just extracted 2. Must use 'python -m pip' not 'pip' since pip isn't installed yet 3. Extracted source code is not a wheel/sdist for --find-links Related: - pip 26.1.2 pyproject.toml requires: flit-core<4,>=3.11 - Manifest has flit-core 3.12.0 for cflinuxfs4/cflinuxfs5 - Follows pattern from InstallCommonBuildDependencies()
f9520f0 to
c4f8882
Compare
Final Correction AppliedThe previous attempt failed because pip wasn't in PATH yet. The IssueWhen The FixUse // Use "python -m pip" directly since pip isn't in PATH yet
if err := s.Command.Execute(s.Stager.BuildDir(), indentWriter(os.Stdout), indentWriter(os.Stderr),
"python", "-m", "pip", "install", tempPath, "--no-build-isolation"); err != nil {
s.Log.Warning("Could not install flit-core: %v", err)
}Why This Works
Test Status
This should be the final fix! |
Automated update of pip dependency for version line latest.