-
Notifications
You must be signed in to change notification settings - Fork 1
feat: configure cpython source #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,35 @@ just build-release | |
| ## Python Version | ||
| We currently bundle [Python 3.14.0], [build for WASI](https://docs.python.org/3/library/intro.html#webassembly-platforms). | ||
|
|
||
| ## Custom CPython Configuration | ||
| You can configure the build to use a custom CPython source by setting the following environment variables: | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could mention |
||
|
|
||
| - `PYTHON_SDK_BASE_URL`: Base URL to download the Python WASI SDK artifacts. This | ||
| should point to a location containing both the main SDK archive and the build | ||
| artifacts archive. | ||
| - `PYTHON_SDK_URL`: URL to download the main Python WASI SDK archive. This | ||
| should point to an artifact containing the pre-built Python runtime and | ||
| standard library for WASI. Will override `PYTHON_SDK_BASE_URL` if set. | ||
| - `BUILD_PYTHON_SDK_URL`: URL to download the build artifacts archive. This | ||
| should point to an artifact containing the compiled Python libraries (like | ||
| `libpython3.14.a`, `libmpdec.a`, etc.) needed for static linking. Will override | ||
| `PYTHON_SDK_BASE_URL` if set. | ||
|
|
||
| If these environment variables are not set, the build will use the default URLs pointing to the official [CPython WASI build releases](https://github.com/brettcannon/cpython-wasi-build/releases). | ||
|
|
||
| Example usage: | ||
| ```console | ||
| export PYTHON_SDK_URL="https://example.com/custom-python-sdk.zip" | ||
| export BUILD_PYTHON_SDK_URL="https://example.com/custom-build-python-sdk.zip" | ||
| just build-debug | ||
|
|
||
| # Or | ||
|
|
||
| export PYTHON_SDK_BASE_URL="https://example.com/custom-python-sdk-base/" | ||
| just build-debug | ||
| ``` | ||
|
|
||
| ## Python Standard Library | ||
| In contrast to a normal Python installation there are a few notable public[^public] modules **missing** from the [Python Standard Library]: | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new environment variables
PYTHON_SDK_BASE_URL,PYTHON_SDK_URL, andBUILD_PYTHON_SDK_URLshould be documented so users know they can configure custom download locations. Consider adding a section toguests/python/README.mdunder the "Build" section or toCONTRIBUTING.mdexplaining these configuration options and their use cases (e.g., using custom mirrors, air-gapped environments).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks copilot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally feel this is sufficiently described in the README as well, so the doc here seems a bit redundant. But I leave that up to you.