feat: allow overriding tool versions and base url for predefined Python interpreters (#647)

diff --git a/python/repositories.bzl b/python/repositories.bzl
index bb7d72d..60ab918 100644
--- a/python/repositories.bzl
+++ b/python/repositories.bzl
@@ -20,6 +20,7 @@
 load("//python/private:toolchains_repo.bzl", "resolved_interpreter_os_alias", "toolchains_repo")
 load(
     ":versions.bzl",
+    "DEFAULT_RELEASE_BASE_URL",
     "MINOR_MAPPING",
     "PLATFORMS",
     "TOOL_VERSIONS",
@@ -40,7 +41,8 @@
 
     platform = rctx.attr.platform
     python_version = rctx.attr.python_version
-    (release_filename, url) = get_release_url(platform, python_version)
+    base_url = rctx.attr.base_url
+    (release_filename, url) = get_release_url(platform, python_version, base_url)
 
     if release_filename.endswith(".zst"):
         rctx.download(
@@ -160,6 +162,10 @@
     _python_repository_impl,
     doc = "Fetches the external tools needed for the Python toolchain.",
     attrs = {
+        "base_url": attr.string(
+            doc = "The base URL used for releases, will be joined to the templated 'url' field in the tool_versions dict",
+            default = DEFAULT_RELEASE_BASE_URL,
+        ),
         "distutils": attr.label(
             allow_single_file = True,
             doc = "A distutils.cfg file to be included in the Python installation. " +
@@ -203,6 +209,7 @@
         python_version,
         distutils = None,
         distutils_content = None,
+        tool_versions = TOOL_VERSIONS,
         **kwargs):
     """Convenience macro for users which does typical setup.
 
@@ -218,13 +225,15 @@
         python_version: the Python version.
         distutils: see the distutils attribute in the python_repository repository rule.
         distutils_content: see the distutils_content attribute in the python_repository repository rule.
+        tool_versions: a dict containing a mapping of version with SHASUM and platform info. If not supplied, the defaults
+        in python/versions.bzl will be used
         **kwargs: passed to each python_repositories call.
     """
     if python_version in MINOR_MAPPING:
         python_version = MINOR_MAPPING[python_version]
 
     for platform in PLATFORMS.keys():
-        sha256 = TOOL_VERSIONS[python_version]["sha256"].get(platform, None)
+        sha256 = tool_versions[python_version]["sha256"].get(platform, None)
         if not sha256:
             continue
 
diff --git a/python/versions.bzl b/python/versions.bzl
index 23bc1c3..8aaa4a0 100644
--- a/python/versions.bzl
+++ b/python/versions.bzl
@@ -20,15 +20,15 @@
 LINUX_NAME = "linux"
 WINDOWS_NAME = "windows"
 
-_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
+DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/releases/download"
 
-def get_release_url(platform, python_version):
+def get_release_url(platform, python_version, base_url = DEFAULT_RELEASE_BASE_URL):
     release_filename = TOOL_VERSIONS[python_version]["url"].format(
         platform = platform,
         python_version = python_version,
         build = "static-install_only" if (WINDOWS_NAME in platform) else "install_only",
     )
-    url = "/".join([_RELEASE_BASE_URL, release_filename])
+    url = "/".join([base_url, release_filename])
     return (release_filename, url)
 
 # When updating the versions and releases, run the following command to get