asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

[Feature Request] Allow to use a mirror url for downloading?

Open TylerTemp opened this issue 11 months ago • 1 comments

PYTHON_BUILD_MIRROR_URL="https://my-custom-site" asdf install python 3.13.2

does not work. pyenv has this feature and is very useful

TylerTemp avatar Feb 20 '25 03:02 TylerTemp

Hi, I came across the same "issue" and my solution is to just use pyenv variables for e.g.:

# Dockerfile

ARG PYTHON_VER=3.13.8
RUN --mount=type=secret,id=MIRROR_USR,env=MIRROR_USR --mount=type=secret,id=MIRROR_PSW,env=MIRROR_PSW \
    asdf plugin add python \
    && export PYTHON_BUILD_MIRROR_URL=https://yourmirrorserver.com/repository/remote-python/ \
    && export PYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUM=1 \
    && export PYTHON_BUILD_HTTP_CLIENT=curl \
    && export PYTHON_BUILD_CURL_OPTS="-u $MIRROR_USR:$MIRROR_PSW" \
    && asdf install python ${PYTHON_VER} \
    && asdf set -u python ${PYTHON_VER}

This worked for me

https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#special-environment-variables

mdpdesign avatar Oct 08 '25 14:10 mdpdesign