-
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
Conversation
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.
Pull Request Overview
This PR adds configurability for CPython source downloads by introducing environment variables that allow users to specify custom URLs for Python SDK downloads. This is useful for environments with restricted internet access, custom package repositories, or mirrors.
- Adds three new configurable environment variables with sensible defaults
- Maintains backward compatibility by defaulting to the original brettcannon/cpython-wasi-build URLs
- Refactors hardcoded URLs to use the new configurable variables
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| PYTHON_VERSION_FULL := PYTHON_VERSION_MAJOR + "." + PYTHON_VERSION_MINOR + "." + PYTHON_VERSION_MICRO | ||
|
|
||
| # Configurable URLs for Python SDK downloads (with defaults) |
Copilot
AI
Nov 18, 2025
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, and BUILD_PYTHON_SDK_URL should be documented so users know they can configure custom download locations. Consider adding a section to guests/python/README.md under the "Build" section or to CONTRIBUTING.md explaining these configuration options and their use cases (e.g., using custom mirrors, air-gapped environments).
| # Configurable URLs for Python SDK downloads (with defaults) | |
| # Python SDK download URL configuration | |
| # | |
| # The following environment variables can be set to customize the download locations for the Python WASM SDK: | |
| # - PYTHON_SDK_BASE_URL: Base URL for Python SDK releases (default: official GitHub release) | |
| # - PYTHON_SDK_URL: Full URL for the pre-built Python SDK zip file | |
| # - BUILD_PYTHON_SDK_URL: Full URL for the build Python SDK zip file | |
| # | |
| # These variables are useful for: | |
| # - Using custom mirrors or internal artifact repositories | |
| # - Building in air-gapped or restricted network environments | |
| # - Overriding the default download source for testing or reliability | |
| # | |
| # Example usage: | |
| # export PYTHON_SDK_BASE_URL="https://my-mirror.local/python-wasi" | |
| # just build-release | |
| # |
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.
crepererum
left a comment
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.
Small suggestion, otherwise I think that's a nice change. Thank you.
|
|
||
| PYTHON_VERSION_FULL := PYTHON_VERSION_MAJOR + "." + PYTHON_VERSION_MINOR + "." + PYTHON_VERSION_MICRO | ||
|
|
||
| # Configurable URLs for Python SDK downloads (with defaults) |
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.
|
|
||
| ## Custom CPython Configuration | ||
| You can configure the build to use a custom CPython source by setting the following environment variables: | ||
|
|
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.
This could mention PYTHON_SDK_BASE_URL too, which is useful esp. when you fork https://github.com/brettcannon/cpython-wasi-build since it will "just work" (i.e. the two sub-URLs are correctly derived for your fork as well).
38c87dd to
c3aa651
Compare
Closes #152
Describe your proposed changes here.