Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ dependencies:
source: https://files.pythonhosted.org/packages/20/16/650289cd3f43d5a2fadfd98c68bd1e1e7f2550a1a5326768cddfbcedb2c5/pip-25.2.tar.gz
source_sha256: 578283f006390f85bb6282dffb876454593d637f5d1be494b5202ce4877e71f2
- name: pip
version: 26.2.1
uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.2.1_linux_noarch_cflinuxfs4_22e7a825.tgz
sha256: 22e7a8258b20b0f50f713d1e506c228c1ca7620aa3b483b67266b90392eeb91e
version: 26.2.2
uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.2.2_linux_noarch_cflinuxfs4_d876df6b.tgz
sha256: d876df6b58ea3264950a319c11d4d98e9a4095a774ae9b6d98edec1563a98679
cf_stacks:
- cflinuxfs4
source: https://files.pythonhosted.org/packages/ae/15/4500e320e6b101ec3b719ae85b697d9940b6cda672bc555bd6016fc60c6f/pip-26.2.1.tar.gz
source_sha256: f6ad667e89a1fe78046c8f13232b247200f5258d7828f3f7883d660878e0813f
source: https://files.pythonhosted.org/packages/fa/e8/0842d757e483e895e670f655084cfe8b8c72580c6769a76b30b2789a0608/pip-26.2.2.tar.gz
source_sha256: 3a8e5c800492787f33a4114ef54444546c340df428974ebba17e0fd47e11af2f
- name: pip
version: 26.2.1
uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.2.1_linux_noarch_cflinuxfs5_22e7a825.tgz
sha256: 22e7a8258b20b0f50f713d1e506c228c1ca7620aa3b483b67266b90392eeb91e
version: 26.2.2
uri: https://buildpacks.cloudfoundry.org/dependencies/pip/pip_26.2.2_linux_noarch_cflinuxfs5_94205d18.tgz
sha256: 94205d18befb483e86afe50f75cd7a48a019da986af57d77330c0f446e8f5415
cf_stacks:
- cflinuxfs5
source: https://files.pythonhosted.org/packages/ae/15/4500e320e6b101ec3b719ae85b697d9940b6cda672bc555bd6016fc60c6f/pip-26.2.1.tar.gz
source_sha256: f6ad667e89a1fe78046c8f13232b247200f5258d7828f3f7883d660878e0813f
source: https://files.pythonhosted.org/packages/fa/e8/0842d757e483e895e670f655084cfe8b8c72580c6769a76b30b2789a0608/pip-26.2.2.tar.gz
source_sha256: 3a8e5c800492787f33a4114ef54444546c340df428974ebba17e0fd47e11af2f
- name: pipenv
version: 2024.4.1
uri: https://buildpacks.cloudfoundry.org/dependencies/pipenv/pipenv_2024.4.1_linux_noarch_cflinuxfs3_b3c74c78.tgz
Expand Down
24 changes: 23 additions & 1 deletion src/python/supply/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,35 @@ func (s *Supplier) InstallPip() error {
return err
}

// The pip dependency tarball bundles a flit-core wheel (the build backend
// required by pip's pyproject.toml). We must bootstrap flit-core into the
// Python environment before installing pip, because:
// - pip's pyproject.toml declares build-requires: flit-core >=3.11,<4
// - With build isolation, pip would try to install flit-core into a
// temporary venv, but --no-index prevents network access and the
// bundled flit-core version may not satisfy the <4 constraint
// - With --no-build-isolation, pip skips the isolated env but needs
// flit_core importable in the current environment
// This matches the pattern used by InstallCommonBuildDependencies().
s.Log.Info("Installing build backend flit-core (bootstrap)")
if err := s.Command.Execute(s.Stager.BuildDir(), indentWriter(os.Stdout), indentWriter(os.Stderr),
"python",
"-m", "pip",
"install", "flit-core",
"--no-index",
"--no-build-isolation",
fmt.Sprintf("--find-links=%s", tempPath),
); err != nil {
return fmt.Errorf("could not bootstrap flit-core: %v", err)
}

if err := s.Command.Execute(s.Stager.BuildDir(), indentWriter(os.Stdout), indentWriter(os.Stderr),
"python",
"-m", "pip",
"install", "pip",
"--exists-action=w",
"--no-index",
"--no-build-isolation",
"--ignore-installed",
fmt.Sprintf("--find-links=%s", tempPath),
); err != nil {
Expand Down Expand Up @@ -765,7 +788,6 @@ func (s *Supplier) InstallCommonBuildDependencies() error {
}
}


return nil
}

Expand Down
5 changes: 4 additions & 1 deletion src/python/supply/supply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ var _ = Describe("Supply", func() {

It("installs latest from manifest", func() {
mockInstaller.EXPECT().InstallOnlyVersion("pip", "/tmp/pip")
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "pip", "--exists-action=w", "--no-index", "--ignore-installed", "--find-links=/tmp/pip")
gomock.InOrder(
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "flit-core", "--no-index", "--no-build-isolation", "--find-links=/tmp/pip"),
mockCommand.EXPECT().Execute(buildDir, gomock.Any(), gomock.Any(), "python", "-m", "pip", "install", "pip", "--exists-action=w", "--no-index", "--no-build-isolation", "--ignore-installed", "--find-links=/tmp/pip"),
)
mockStager.EXPECT().LinkDirectoryInDepDir(filepath.Join(filepath.Join(depDir, "python"), "bin"), "bin")

Expect(supplier.InstallPip()).To(Succeed())
Expand Down
Loading