diff --git a/.appveyor.yml b/.appveyor.yml index f2a5aa11b..d9acfa513 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -3,6 +3,8 @@ image: Visual Studio 2017 environment: matrix: + - version: 3.9-rc + variant: windowsservercore-ltsc2016 - version: 3.8 variant: windowsservercore-ltsc2016 - version: 3.7 diff --git a/.travis.yml b/.travis.yml index e21e5d746..9606425f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ services: docker matrix: include: + - os: linux + env: VERSION=3.9-rc VARIANT=buster + - os: linux + env: VERSION=3.9-rc VARIANT=alpine3.10 - os: linux env: VERSION=3.8 VARIANT=buster - os: linux diff --git a/3.9-rc/alpine3.10/Dockerfile b/3.9-rc/alpine3.10/Dockerfile new file mode 100644 index 000000000..ee735e9cd --- /dev/null +++ b/3.9-rc/alpine3.10/Dockerfile @@ -0,0 +1,134 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.10 + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# install ca-certificates so that HTTPS works consistently +# other runtime dependencies for Python are installed later +RUN apk add --no-cache ca-certificates + +ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 +ENV PYTHON_VERSION 3.9.0a1 + +RUN set -ex \ + && apk add --no-cache --virtual .fetch-deps \ + gnupg \ + tar \ + xz \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" python.tar.xz.asc \ + && mkdir -p /usr/src/python \ + && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ + && rm python.tar.xz \ + \ + && apk add --no-cache --virtual .build-deps \ + bzip2-dev \ + coreutils \ + dpkg-dev dpkg \ + expat-dev \ + findutils \ + gcc \ + gdbm-dev \ + libc-dev \ + libffi-dev \ + libnsl-dev \ + libtirpc-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl-dev \ + pax-utils \ + readline-dev \ + sqlite-dev \ + tcl-dev \ + tk \ + tk-dev \ + util-linux-dev \ + xz-dev \ + zlib-dev \ +# add build deps before removing fetch deps in case there's overlap + && apk del .fetch-deps \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ +# set thread stack size to 1MB so we don't segfault before we hit sys.getrecursionlimit() +# https://github.com/alpinelinux/aports/commit/2026e1259422d4e0cf92391ca2d3844356c649d0 + EXTRA_CFLAGS="-DTHREAD_STACK_SIZE=0x100000" \ + && make install \ + \ + && find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec scanelf --needed --nobanner --format '%n#p' '{}' ';' \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + | xargs -rt apk add --no-cache --virtual .python-rundeps \ + && apk del .build-deps \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# make some useful symlinks that are expected to exist +RUN cd /usr/local/bin \ + && ln -s idle3 idle \ + && ln -s pydoc3 pydoc \ + && ln -s python3 python \ + && ln -s python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 19.3.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/ffe826207a010164265d9cc807978e3604d18ca0/get-pip.py +ENV PYTHON_GET_PIP_SHA256 b86f36cc4345ae87bfd4f10ef6b2dbfa7a872fbff70608a1e43944d283fd0eee + +RUN set -ex; \ + \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ + \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.9-rc/buster/Dockerfile b/3.9-rc/buster/Dockerfile new file mode 100644 index 000000000..8473baaa9 --- /dev/null +++ b/3.9-rc/buster/Dockerfile @@ -0,0 +1,95 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:buster + +# ensure local python is preferred over distribution python +ENV PATH /usr/local/bin:$PATH + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# extra dependencies (over what buildpack-deps already includes) +RUN apt-get update && apt-get install -y --no-install-recommends \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +ENV GPG_KEY E3FF2839C048B25C084DEBE9B26995E310250568 +ENV PYTHON_VERSION 3.9.0a1 + +RUN set -ex \ + \ + && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \ + && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \ + && export GNUPGHOME="$(mktemp -d)" \ + && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ + && gpg --batch --verify python.tar.xz.asc python.tar.xz \ + && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ + && rm -rf "$GNUPGHOME" python.tar.xz.asc \ + && mkdir -p /usr/src/python \ + && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \ + && rm python.tar.xz \ + \ + && cd /usr/src/python \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && ./configure \ + --build="$gnuArch" \ + --enable-loadable-sqlite-extensions \ + --enable-optimizations \ + --enable-shared \ + --with-system-expat \ + --with-system-ffi \ + --without-ensurepip \ + && make -j "$(nproc)" \ + && make install \ + && ldconfig \ + \ + && find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' + \ + && rm -rf /usr/src/python \ + \ + && python3 --version + +# make some useful symlinks that are expected to exist +RUN cd /usr/local/bin \ + && ln -s idle3 idle \ + && ln -s pydoc3 pydoc \ + && ln -s python3 python \ + && ln -s python3-config python-config + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 19.3.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/ffe826207a010164265d9cc807978e3604d18ca0/get-pip.py +ENV PYTHON_GET_PIP_SHA256 b86f36cc4345ae87bfd4f10ef6b2dbfa7a872fbff70608a1e43944d283fd0eee + +RUN set -ex; \ + \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ + \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + "pip==$PYTHON_PIP_VERSION" \ + ; \ + pip --version; \ + \ + find /usr/local -depth \ + \( \ + \( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \ + -o \ + \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \ + \) -exec rm -rf '{}' +; \ + rm -f get-pip.py + +CMD ["python3"] diff --git a/3.9-rc/windows/windowsservercore-1809/Dockerfile b/3.9-rc/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..79533d17e --- /dev/null +++ b/3.9-rc/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,72 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV PYTHON_VERSION 3.9.0a1 +ENV PYTHON_RELEASE 3.9.0 + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3.5/using/windows.html#installing-without-ui + Start-Process python.exe -Wait \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=0', \ + 'Include_test=0' \ + ); \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + \ + Write-Host 'Complete.' + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 19.3.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/ffe826207a010164265d9cc807978e3604d18ca0/get-pip.py +ENV PYTHON_GET_PIP_SHA256 b86f36cc4345ae87bfd4f10ef6b2dbfa7a872fbff70608a1e43944d283fd0eee + +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ + ; \ + Remove-Item get-pip.py -Force; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/3.9-rc/windows/windowsservercore-ltsc2016/Dockerfile b/3.9-rc/windows/windowsservercore-ltsc2016/Dockerfile new file mode 100644 index 000000000..3b3c4b6ab --- /dev/null +++ b/3.9-rc/windows/windowsservercore-ltsc2016/Dockerfile @@ -0,0 +1,72 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2016 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV PYTHON_VERSION 3.9.0a1 +ENV PYTHON_RELEASE 3.9.0 + +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'python.exe'; \ + \ + Write-Host 'Installing ...'; \ +# https://docs.python.org/3.5/using/windows.html#installing-without-ui + Start-Process python.exe -Wait \ + -ArgumentList @( \ + '/quiet', \ + 'InstallAllUsers=1', \ + 'TargetDir=C:\Python', \ + 'PrependPath=1', \ + 'Shortcuts=0', \ + 'Include_doc=0', \ + 'Include_pip=0', \ + 'Include_test=0' \ + ); \ + \ +# the installer updated PATH, so we should refresh our local value + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' python --version'; python --version; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item python.exe -Force; \ + \ + Write-Host 'Complete.' + +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" +ENV PYTHON_PIP_VERSION 19.3.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/ffe826207a010164265d9cc807978e3604d18ca0/get-pip.py +ENV PYTHON_GET_PIP_SHA256 b86f36cc4345ae87bfd4f10ef6b2dbfa7a872fbff70608a1e43944d283fd0eee + +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ + python get-pip.py \ + --disable-pip-version-check \ + --no-cache-dir \ + ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ + ; \ + Remove-Item get-pip.py -Force; \ + \ + Write-Host 'Verifying pip install ...'; \ + pip --version; \ + \ + Write-Host 'Complete.' + +CMD ["python"] diff --git a/update.sh b/update.sh index d44ab381a..9cf7345ae 100755 --- a/update.sh +++ b/update.sh @@ -23,6 +23,10 @@ declare -A gpgKeys=( # gpg: key B26995E310250568: public key "\xc5\x81ukasz Langa (GPG langa.pl) " imported [3.8]='E3FF2839C048B25C084DEBE9B26995E310250568' # https://www.python.org/dev/peps/pep-0569/#release-manager-and-crew + + # gpg: key B26995E310250568: public key "\xc5\x81ukasz Langa (GPG langa.pl) " imported + [3.9]='E3FF2839C048B25C084DEBE9B26995E310250568' + # https://www.python.org/dev/peps/pep-0596/#release-manager-and-crew ) cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"