Skip to content

Conversation

@Sl1mb0
Copy link
Contributor

@Sl1mb0 Sl1mb0 commented Nov 18, 2025

Closes #152

Describe your proposed changes here.

  • I've read the contributing section of the project CONTRIBUTING.md.
  • Signed CLA (if not already signed).

@Sl1mb0 Sl1mb0 marked this pull request as ready for review November 18, 2025 22:56
@Sl1mb0 Sl1mb0 requested review from Copilot and crepererum November 18, 2025 22:56
Copilot finished reviewing on behalf of Sl1mb0 November 18, 2025 22:58
Copy link
Contributor

Copilot AI left a 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)
Copy link

Copilot AI Nov 18, 2025

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).

Suggested change
# 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
#

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks copilot!

Copy link
Collaborator

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.

Copy link
Collaborator

@crepererum crepererum left a 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)
Copy link
Collaborator

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:

Copy link
Collaborator

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).

@Sl1mb0 Sl1mb0 force-pushed the tm/configure-cpython branch from 38c87dd to c3aa651 Compare November 19, 2025 13:06
@Sl1mb0 Sl1mb0 added this pull request to the merge queue Nov 19, 2025
Merged via the queue into main with commit 0d9c5b2 Nov 19, 2025
1 check passed
@Sl1mb0 Sl1mb0 deleted the tm/configure-cpython branch November 19, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optionally Pull CPython binary from InfluxData

4 participants