Skip to content

Commit b16ff40

Browse files
committed
Update 3.6 to 3.6.0b3 and refactor update.sh to handle pre-releases in a saner manner
1 parent b031a3a commit b16ff40

File tree

8 files changed

+58
-14
lines changed

8 files changed

+58
-14
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ language: bash
22
services: docker
33

44
env:
5-
- VERSION=3.6 VARIANT=
6-
- VERSION=3.6 VARIANT=slim
7-
- VERSION=3.6 VARIANT=alpine
5+
- VERSION=3.6-rc VARIANT=
6+
- VERSION=3.6-rc VARIANT=slim
7+
- VERSION=3.6-rc VARIANT=alpine
88
- VERSION=3.5 VARIANT=
99
- VERSION=3.5 VARIANT=slim
1010
- VERSION=3.5 VARIANT=alpine

3.6/Dockerfile renamed to 3.6-rc/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM buildpack-deps:jessie
28

39
# ensure local python is preferred over distribution python
@@ -14,7 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1420
&& rm -rf /var/lib/apt/lists/*
1521

1622
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
17-
ENV PYTHON_VERSION 3.6.0b2
23+
ENV PYTHON_VERSION 3.6.0b3
1824

1925
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
2026
ENV PYTHON_PIP_VERSION 8.1.2

3.6/alpine/Dockerfile renamed to 3.6-rc/alpine/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM alpine:3.4
28

39
# ensure local python is preferred over distribution python
@@ -12,7 +18,7 @@ ENV LANG C.UTF-8
1218
RUN apk add --no-cache ca-certificates
1319

1420
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
15-
ENV PYTHON_VERSION 3.6.0b2
21+
ENV PYTHON_VERSION 3.6.0b3
1622

1723
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
1824
ENV PYTHON_PIP_VERSION 8.1.2

3.6/onbuild/Dockerfile renamed to 3.6-rc/onbuild/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
FROM python:3.6
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM python:3.6-rc
28

39
RUN mkdir -p /usr/src/app
410
WORKDIR /usr/src/app

3.6/slim/Dockerfile renamed to 3.6-rc/slim/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM debian:jessie
28

39
# ensure local python is preferred over distribution python
@@ -16,7 +22,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1622
&& rm -rf /var/lib/apt/lists/*
1723

1824
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
19-
ENV PYTHON_VERSION 3.6.0b2
25+
ENV PYTHON_VERSION 3.6.0b3
2026

2127
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
2228
ENV PYTHON_PIP_VERSION 8.1.2

3.6/windows/windowsservercore/Dockerfile renamed to 3.6-rc/windows/windowsservercore/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
17
FROM microsoft/windowsservercore
28

39
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
410

5-
ENV PYTHON_VERSION 3.6.0b2
11+
ENV PYTHON_VERSION 3.6.0b3
612
ENV PYTHON_RELEASE 3.6.0
713

814
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"

generate-stackbrew-library.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -eu
33

44
declare -A aliases=(
5+
[3.6-rc]='rc'
56
[3.5]='3 latest'
67
[2.7]='2'
78
)

update.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,31 @@ generated_warning() {
4747

4848
travisEnv=
4949
for version in "${versions[@]}"; do
50-
# <span class="release-number"><a href="/downloads/release/python-278/">Python 2.7.8</a></span>
51-
# <span class="release-number"><a href="/downloads/release/python-341/">Python 3.4.1</a></span>
52-
fullVersion="$(curl -fsSL 'https://www.python.org/downloads/' | awk -F 'Python |</a>' '/<span class="release-number"><a[^>]+>Python '"$version"'./ { print $2 }' | grep -v 'rc' | sort -V | tail -1)"
53-
# TODO figure out a better way to handle RCs than just filtering them out
50+
rcGrepV='-v'
51+
rcVersion="${version%-rc}"
52+
if [ "$rcVersion" != "$version" ]; then
53+
rcGrepV=
54+
fi
55+
56+
possibles=( $(curl -fsSL 'https://www.python.org/ftp/python/' | grep '<a href="'"$rcVersion." | sed -r 's!.*<a href="([^"/]+)/?".*!\1!' | sort -rV) )
57+
fullVersion=
58+
for possible in "${possibles[@]}"; do
59+
possibleVersions=( $(curl -fsSL "https://www.python.org/ftp/python/$possible/" | grep '<a href="Python-'"$rcVersion"'.*\.tar\.xz"' | sed -r 's!.*<a href="Python-([^"/]+)\.tar\.xz".*!\1!' | grep $rcGrepV -E -- '[a-zA-Z]+' | sort -rV) )
60+
if [ "${#possibleVersions[@]}" -gt 0 ]; then
61+
fullVersion="${possibleVersions[0]}"
62+
break
63+
fi
64+
done
65+
5466
if [ -z "$fullVersion" ]; then
5567
{
5668
echo
5769
echo
58-
echo " warning: cannot find $version (alpha/beta/rc?)"
70+
echo " error: cannot find $version (alpha/beta/rc?)"
5971
echo
6072
echo
6173
} >&2
74+
exit 1
6275
else
6376
if [[ "$version" != 2.* ]]; then
6477
for variant in \
@@ -86,7 +99,7 @@ for version in "${versions[@]}"; do
8699
(
87100
set -x
88101
sed -ri \
89-
-e 's/^(ENV GPG_KEY) .*/\1 '"${gpgKeys[$version]}"'/' \
102+
-e 's/^(ENV GPG_KEY) .*/\1 '"${gpgKeys[$rcVersion]}"'/' \
90103
-e 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' \
91104
-e 's/^(ENV PYTHON_RELEASE) .*/\1 '"${fullVersion%%[a-z]*}"'/' \
92105
-e 's/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/' \

0 commit comments

Comments
 (0)