diff --git a/manifest.yml b/manifest.yml index 038923f4..482acfa2 100644 --- a/manifest.yml +++ b/manifest.yml @@ -77,18 +77,18 @@ dependencies: uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_25.2_linux_noarch_any-stack_7dc1e988.tgz sha256: 7dc1e9882eb18f53150261c3a0cde7d5a39cdb18843c930ee01db8582f6b4f27 cf_stacks: - - cflinuxfs5 - - cflinuxfs4 - cflinuxfs3 source: https://files.pythonhosted.org/packages/20/16/650289cd3f43d5a2fadfd98c68bd1e1e7f2550a1a5326768cddfbcedb2c5/pip-25.2.tar.gz source_sha256: 578283f006390f85bb6282dffb876454593d637f5d1be494b5202ce4877e71f2 - name: pip - version: 26.0.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.0.1_linux_noarch_any-stack_0750a38b.tgz - sha256: 0750a38b65c6038a0415a4ff15ef2df61fcaa6c1e5ec9d8c6678222dbac91306 - cf_stacks: [] - source: https://files.pythonhosted.org/packages/48/83/0d7d4e9efe3344b8e2fe25d93be44f64b65364d3c8d7bc6dc90198d5422e/pip-26.0.1.tar.gz - source_sha256: c4037d8a277c89b320abe636d59f91e6d0922d08a05b60e85e53b296613346d8 + version: 26.1.2 + uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.1.2_linux_noarch_cflinuxfs4_fc4720c5.tgz + sha256: fc4720c52cf407083abdb3a6375a3beb29ae6b68f650ed086d25dab4f24d3860 + cf_stacks: + - cflinuxfs4 + - cflinuxfs5 + source: https://files.pythonhosted.org/packages/01/91/47e7d486260f618783899587af63ccf7980fb60245c3e63dd4571c6b57ad/pip-26.1.2.tar.gz + source_sha256: f49cd134c61cf2fd75e0ce2676db03e4054504a5a4986d00f8299ae632dc4605 - name: pipenv version: 2024.4.1 uri: https://buildpacks.cloudfoundry.org/dependencies/pipenv/pipenv_2024.4.1_linux_noarch_cflinuxfs3_b3c74c78.tgz diff --git a/src/python/supply/supply.go b/src/python/supply/supply.go index 44cb9499..6bc7d77b 100644 --- a/src/python/supply/supply.go +++ b/src/python/supply/supply.go @@ -341,6 +341,19 @@ func (s *Supplier) InstallPip() error { return err } + // pip 26+ requires flit-core as a build dependency + // We need to install it into the Python environment, not just extract it + if err := s.Installer.InstallOnlyVersion("flit-core", tempPath); err == nil { + // flit-core found - install it so pip can use it as a build backend + // Use "python -m pip" directly since pip isn't in PATH yet + s.Log.Info("Installing flit-core (required for pip 26+)") + 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) + } + } + // If flit-core not found (e.g., cflinuxfs3), silently continue + if err := s.Command.Execute(s.Stager.BuildDir(), indentWriter(os.Stdout), indentWriter(os.Stderr), "python", "-m", "pip", diff --git a/src/python/supply/supply_test.go b/src/python/supply/supply_test.go index a8d15d41..9e1cc5b8 100644 --- a/src/python/supply/supply_test.go +++ b/src/python/supply/supply_test.go @@ -154,6 +154,8 @@ var _ = Describe("Supply", func() { It("installs latest from manifest", func() { mockInstaller.EXPECT().InstallOnlyVersion("pip", "/tmp/pip") + mockInstaller.EXPECT().InstallOnlyVersion("flit-core", "/tmp/pip") + mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "/tmp/pip", "--no-build-isolation") mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "pip", "--exists-action=w", "--no-index", "--ignore-installed", "--find-links=/tmp/pip") mockStager.EXPECT().LinkDirectoryInDepDir(filepath.Join(filepath.Join(depDir, "python"), "bin"), "bin")