Skip to content

Updating version for pip for latest #1191

Open
ari-wg-gitbot wants to merge 4 commits into
masterfrom
pr-by-releng-bot-1780479332
Open

Updating version for pip for latest #1191
ari-wg-gitbot wants to merge 4 commits into
masterfrom
pr-by-releng-bot-1780479332

Conversation

@ari-wg-gitbot

Copy link
Copy Markdown
Contributor

Automated update of pip dependency for version line latest.

ari-wg-gitbot and others added 2 commits June 3, 2026 09:35
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
@ivanovac

Copy link
Copy Markdown
Contributor

Fix Applied

I've updated the PR to resolve the more than one version of pip found error.

Root Cause

The buildpack's InstallOnlyVersion() function requires exactly one version per dependency per stack. The previous configuration had:

  • pip 25.2: cflinuxfs3, cflinuxfs4, cflinuxfs5
  • pip 26.1.2: cflinuxfs4, cflinuxfs5

This meant cflinuxfs4 and cflinuxfs5 had two pip versions available, triggering the error.

Solution

Restricted pip 25.2 to cflinuxfs3 only:

  • pip 25.2: cflinuxfs3
  • pip 26.1.2: cflinuxfs4, cflinuxfs5 ✅

Now each stack has exactly one pip version, following the same pattern used by pipenv in the manifest.

Result

  • cflinuxfs3 apps get pip 25.2
  • cflinuxfs4 apps get pip 26.1.2
  • cflinuxfs5 apps get pip 26.1.2
  • Integration tests should now pass

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
@ivanovac

Copy link
Copy Markdown
Contributor

Complete Fix Applied

I'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-core

pip 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:

ERROR: Could not find a version that satisfies the requirement flit-core<4,>=3.11

Solution

Modified InstallPip() to also download flit-core to /tmp/pip so pip can find it when building itself.

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

  • flit-core 3.12.0 is in manifest for cflinuxfs4/cflinuxfs5 (matches pip 26.1.2 stacks)
  • cflinuxfs3 uses pip 25.2 (doesn't need flit-core, gracefully skips)
  • Unit tests updated and passing ✅

Complete Fix Summary

  1. Commit 1: Restrict pip 25.2 to cflinuxfs3 only → fixes "more than one version" error
  2. Commit 2: Add flit-core installation → fixes "flit-core not found" error
  3. Commit 3: Update unit tests → ensures tests expect flit-core call

Integration tests should now pass completely.

@ivanovac ivanovac force-pushed the pr-by-releng-bot-1780479332 branch from e616eb3 to f9520f0 Compare July 10, 2026 11:41
@ivanovac

Copy link
Copy Markdown
Contributor

Fix Corrected

The previous fix attempt was downloading flit-core but not installing it, which is why the tests still failed.

Root Cause of the Failure

The flit-core package in the buildpack dependency repository contains source code, not a wheel or sdist. When we extracted it to /tmp/pip, pip couldn't find it via --find-links because pip expects distributable packages (.whl or .tar.gz), not extracted source.

Corrected Solution

Now 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: pip install /tmp/pip --no-build-isolation, which installs flit-core from the extracted source.

Why This Works

  1. flit-core is installed into the Python environment
  2. When pip tries to build pip-26.1.2.tar.gz, it needs flit-core as the build backend
  3. Python can now find the installed flit-core module
  4. pip builds successfully

Pattern

This follows the exact same pattern as InstallCommonBuildDependencies(), which also installs flit-core and poetry-core using runPipInstall().

Test Status

  • ✅ Unit tests: All 45 tests passing
  • ⏳ Integration tests: Waiting for CI/CD

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()
@ivanovac ivanovac force-pushed the pr-by-releng-bot-1780479332 branch from f9520f0 to c4f8882 Compare July 10, 2026 11:55
@ivanovac

Copy link
Copy Markdown
Contributor

Final Correction Applied

The previous attempt failed because pip wasn't in PATH yet.

The Issue

**WARNING** Could not install flit-core: exec: "pip": executable file not found in $PATH

When BP_PIP_VERSION=latest is set, pipCommand() returns ["pip"], but we're still in the process of installing pip - it's not in PATH yet!

The Fix

Use python -m pip directly instead of runPipInstall():

// 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

  • python -m pip uses Python's bundled pip module (from the Python installation)
  • This works even before pip is installed to bin/pip
  • It's the same command we use to install pip itself in the next step

Test Status

  • ✅ Unit tests: All 45 passing
  • ⏳ Integration tests: Running on CI/CD

This should be the final fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants