Open
Conversation
This was referenced Apr 22, 2026
Closed
ramonskie
approved these changes
Apr 22, 2026
Contributor
ramonskie
left a comment
There was a problem hiding this comment.
lgtm
the reason for the different instalation method is explained within the pr description.
but maby we also need a small description within the code here
Contributor
|
#1156 needs to be fixed after we merge this as poetry-core is hardcoded there |
Author
Please do not merge it yet. I'll place a comment in the code. |
Contributor
|
#1182 adds poetry-core to the manifest.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add poetry-core bootstrap support for offline/vendored Python app deployments
Problem
When deploying a Python application with vendored dependencies (sdists) to Cloud Foundry, the buildpack fails with:
This happens because modern Python packages declare their build-time dependencies in
pyproject.tomlaccording to PEP 517. For example,flask-healthzdeclares:When pip installs a package from a source distribution (sdist) online, it automatically downloads and installs any declared build backends. In an offline/vendored deployment (
--no-index), pip cannot fetch them — and since pip 23.1 enforces PEP 517 strictly (no longer falling back to the legacysetup.py installmethod), the build fails entirely.Root Cause
The buildpack's
InstallCommonBuildDependencies()function already bootstrapssetuptools/wheel(used by Click, CacheLib, etc.). However,poetry-core— used byflask-healthzand other Poetry-managed packages — was not handled.poetry-core cannot be added to the app's
vendor/directory as a workaround because pip treatsvendor/as runtime dependencies to install, not as build backends to invoke during the build process.Solution
Ship
poetry-coreas a normal buildpack dependency, just like the other packaged dependencies. The tarball still lives inside the buildpack, but it is now declared inmanifest.ymland installed throughInstaller.InstallOnlyVersion("poetry-core", "/tmp/common_build_deps")before the bootstrap install:This keeps
poetry-coreon the standard manifest/installer path instead of special-casing manual tar extraction insupply.go.After these steps, pip can successfully build any app sdist that uses
flit-core,setuptools, orpoetry-coreas its build backend — fully offline.Testing
Verified with a Flask application using all-sdist-vendored dependencies, including
flask-healthz==1.0.1. All 13 packages installed successfully from source during staging with no internet access to PyPI.Dependecy
Depends on cloudfoundry/buildpacks-ci#621 & #1156
Fix
#165