Skip to content

Commit 17371dd

Browse files
committed
make superchain ship Python 3.8
1 parent 9e03b46 commit 17371dd

File tree

10 files changed

+45
-47
lines changed

10 files changed

+45
-47
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
with:
4848
cache: yarn
4949
node-version: '16'
50-
- name: Set up Python 3.7
50+
- name: Set up Python 3.8
5151
uses: actions/setup-python@v4
5252
with:
53-
python-version: '3.7'
53+
python-version: '3.8'
5454
cache: pip
5555
- name: Install python3-venv
5656
run: sudo apt install -y python3-venv
@@ -130,10 +130,10 @@ jobs:
130130
with:
131131
cache: yarn
132132
node-version: '16'
133-
- name: Set up Python 3.7
133+
- name: Set up Python 3.8
134134
uses: actions/setup-python@v4
135135
with:
136-
python-version: '3.7'
136+
python-version: '3.8'
137137
cache: pip
138138
- name: Install python3-venv
139139
run: sudo apt install -y python3-venv
@@ -197,7 +197,7 @@ jobs:
197197
java: ['8']
198198
node: ['16'] # EOL 2023-09-11
199199
os: [ubuntu-latest]
200-
python: ['3.7']
200+
python: ['3.8']
201201
# Add specific combinations to be tested against "node 14" (to restrict cardinality)
202202
include:
203203
# Test using Windows
@@ -207,69 +207,62 @@ jobs:
207207
go: '1.18'
208208
java: '8'
209209
node: '16'
210-
python: '3.7'
210+
python: '3.8'
211211
# Test using macOS
212212
- title: 'macOS'
213213
os: macos-latest
214214
dotnet: '6.0.x'
215215
go: '1.18'
216216
java: '8'
217217
node: '16'
218-
python: '3.7'
218+
python: '3.8'
219219
# Test alternate Nodes
220220
- title: 'Node 16'
221221
java: '8'
222222
dotnet: '6.0.x'
223223
go: '1.18'
224224
node: '16' # EOL 2023-09-11
225225
os: ubuntu-latest
226-
python: '3.7'
226+
python: '3.8'
227227
- title: 'Node 18'
228228
java: '8'
229229
dotnet: '6.0.x'
230230
go: '1.18'
231231
node: '18' # EOL 2025-04-30
232232
os: ubuntu-latest
233-
python: '3.7'
233+
python: '3.8'
234234
- title: 'Node 20'
235235
java: '8'
236236
dotnet: '6.0.x'
237237
go: '1.18'
238238
node: '20' # EOL 2026-04-30
239239
os: ubuntu-latest
240-
python: '3.7'
240+
python: '3.8'
241241
# Test alternate .NETs
242242
- title: '.NET 7.0'
243243
java: '8'
244244
dotnet: '7.0.x'
245245
go: '1.18'
246246
node: '16'
247247
os: ubuntu-latest
248-
python: '3.7'
248+
python: '3.8'
249249
# Test alternate Gos
250250
- title: 'Go 1.19'
251251
java: '8'
252252
dotnet: '6.0.x'
253253
go: '1.19'
254254
node: '16'
255255
os: ubuntu-latest
256-
python: '3.7'
256+
python: '3.8'
257257
# Test alternate Javas
258258
- title: 'Java 11'
259259
java: '11'
260260
dotnet: '6.0.x'
261261
go: '1.18'
262262
node: '16'
263263
os: ubuntu-latest
264-
python: '3.7'
265-
# Test alternate Pythons
266-
- title: 'Python 3.8'
267264
python: '3.8'
268-
dotnet: '6.0.x'
269-
go: '1.18'
270-
java: '8'
271-
node: '16'
272-
os: ubuntu-latest
265+
# Test alternate Pythons
273266
- title: 'Python 3.9'
274267
python: '3.9'
275268
dotnet: '6.0.x'

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ in your development environment.
4545
+ [`maven >= 3.0.5`](https://maven.apache.org)
4646
- [.NET `6.0`] or later
4747
+ *Recommended:* [`mono >= 6`](https://www.mono-project.com)
48-
- [Python `3.7.3`] or later
48+
- [Python `3.8`] or later
4949
+ [`pip`](https://pip.pypa.io/en/stable/installing/)
5050
+ [`setuptools >= 38.6.0`](https://pypi.org/project/setuptools/)
5151
+ [`wheel`](https://pypi.org/project/wheel/)
@@ -57,7 +57,7 @@ in your development environment.
5757
[Oracle's OpenJDK8]: http://openjdk.java.net/install/
5858
[Amazon Corretto 8]: https://aws.amazon.com/corretto/
5959
[.NET `6.0`]: https://www.microsoft.com/net/download
60-
[Python `3.7.3`]: https://www.python.org/downloads/release/python-373/
60+
[Python `3.8`]: https://www.python.org/downloads/
6161
[Go]: https://go.dev/dl/
6262

6363
## Getting Started

gh-pages/content/user-guides/language-support/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ in significant re-engineering effort:
6969
- How are dependencies modeled? If [semantic versioning] is not the norm, what is the strategy to correctly represent
7070
semantic version ranges?
7171
- What are the toolchain and platform requirements?
72-
- For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.7 or above,
72+
- For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.8 or above,
7373
etc...
7474

7575
## Code Generation

gh-pages/content/user-guides/lib-author/configuration/targets/python.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The `python` target requires two configuration entries:
1616
- Additionally, the following `Programming Language ::` classifiers are already set (more could be added by the user
1717
if relevant):
1818
- `Programming Language :: Python :: 3 :: Only`
19-
- `Programming Language :: Python :: 3.7`
2019
- `Programming Language :: Python :: 3.8`
2120
- `Programming Language :: Python :: 3.9`
2221
- `Programming Language :: Python :: 3.10`

gh-pages/content/user-guides/lib-author/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ to produce releasable artifacts.
1919
| .NET | .NET ≥ 6.0 |
2020
| Go | Go ≥ 1.18 |
2121
| Java | JDK ≥ 8 *and* Maven ≥ 3.6 |
22-
| Python | Python ≥ 3.7 |
22+
| Python | Python ≥ 3.8 |
2323

2424

2525
## :octicons-desktop-download-24: Download Locations

packages/@jsii/python-runtime/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ exclude = '\.(git|mypy_cache|env)'
1111
ignore_missing_imports = true
1212

1313
[tool.pyright]
14-
pythonVersion = "3.7"
14+
pythonVersion = "3.8"
1515
venv = ".env"
1616
venvPath = "."

packages/@jsii/python-runtime/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@
3838
"python-dateutil",
3939
"typing_extensions>=3.7,<5.0",
4040
],
41-
python_requires="~=3.7",
41+
python_requires="~=3.8",
4242
classifiers=[
4343
"Development Status :: 5 - Production/Stable",
4444
"Intended Audience :: Developers",
4545
"License :: OSI Approved :: Apache Software License",
4646
"Programming Language :: JavaScript",
4747
"Programming Language :: Python :: 3 :: Only",
48-
"Programming Language :: Python :: 3.7",
4948
"Programming Language :: Python :: 3.8",
5049
"Programming Language :: Python :: 3.9",
5150
"Programming Language :: Python :: 3.10",

superchain/Dockerfile

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
########################################################################################################################
1919
# Prepare install images of "manual" binary distributions (runs on BUILD platform for speed)
2020
########################################################################################################################
21-
FROM --platform=${BUILDPLATFORM} public.ecr.aws/debian/debian:10 as bindist
21+
FROM --platform=${BUILDPLATFORM} public.ecr.aws/debian/debian:10-slim as bindist
2222

2323
# Build & target platforms, they are provided by buildx and will look like "linux/amd64" or "linux/arm64"
2424
ARG BUILDPLATFORM
@@ -111,7 +111,7 @@ ENV LANG="C.UTF-8"
111111

112112
# Installing the system dependencies we need...
113113
RUN apt-get update \
114-
&& apt-get -y install \
114+
&& apt-get -y install --no-install-recommends \
115115
apt-transport-https \
116116
build-essential \
117117
ca-certificates \
@@ -137,7 +137,7 @@ RUN apt-key add /tmp/mono.asc && rm /tmp/mono.asc
137137
&& echo "deb https://download.mono-project.com/repo/debian stable-buster main" \
138138
> /etc/apt/sources.list.d/mono-official-stable.list \
139139
&& apt-get update \
140-
&& apt-get -y install mono-devel \
140+
&& apt-get -y install --no-install-recommends mono-devel \
141141
&& rm -rf /var/lib/apt/lists/*
142142

143143
# Install Rust (required for https://pypi.org/project/cryptography/ in certain circumstances... like ARM64 arch)
@@ -150,10 +150,16 @@ RUN set -eo pipefail
150150
ENV PATH=$PATH:${CARGO_HOME}/bin
151151

152152
# Install Python 3
153+
ENV PYENV_ROOT="/opt/.pyenv"
154+
ENV PATH="$PYENV_ROOT/bin:$PATH"
153155
RUN apt-get update \
154-
&& apt-get -y install python3 python3-dev python3-pip python3-venv \
156+
&& apt-get -y install --no-install-recommends libbz2-dev liblzma-dev libreadline-dev libsqlite3-dev zlib1g-dev \
157+
&& rm -rf /var/lib/apt/lists/* \
158+
&& curl -fSsL https://pyenv.run | bash \
159+
&& pyenv doctor && eval "$(pyenv init -)" \
160+
&& CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.8 && pyenv global 3.8 && pyenv rehash \
155161
&& python3 -m pip install --no-input --upgrade pip \
156-
&& python3 -m pip install --no-input --upgrade black setuptools twine wheel \
162+
&& python3 -m pip install --no-input --upgrade black setuptools twine wheel \
157163
&& rm -rf $(pip cache dir) \
158164
&& rm -rf /var/lib/apt/lists/*
159165

@@ -171,7 +177,7 @@ RUN apt-key add /tmp/corretto.asc && rm /tmp/corretto.asc
171177
&& echo "deb https://apt.corretto.aws stable main" > /etc/apt/sources.list.d/amazon-corretto.list \
172178
&& apt-get update \
173179
&& mkdir -p /usr/share/man/man1 \
174-
&& apt-get -y install java-20-amazon-corretto-jdk \
180+
&& apt-get -y install --no-install-recommends java-20-amazon-corretto-jdk \
175181
&& rm -rf /usr/share/man/man1 \
176182
&& rm -rf /var/lib/apt/lists/*
177183

@@ -180,18 +186,18 @@ COPY superchain/gpg/docker.asc /tmp/docker.asc
180186
RUN apt-key add /tmp/docker.asc && rm /tmp/docker.asc \
181187
&& echo "deb https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list \
182188
&& apt-get update \
183-
&& apt-get -y install docker-ce docker-ce-cli containerd.io \
189+
&& apt-get -y install --no-install-recommends docker-ce docker-ce-cli containerd.io \
184190
&& rm -rf /var/lib/apt/lists/*
185191
VOLUME /var/lib/docker
186192

187193
# Install GitHub CLI
188-
ARG GITHUB_CLI_VERSION="1.13.1"
194+
ARG GITHUB_CLI_VERSION="2.32.1"
189195
RUN BASE="https://github.com/cli/cli/releases/download" \
190196
&& echo "${BASE}/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_${TARGETPLATFORM#linux/}.deb" \
191197
&& curl -fSsL "${BASE}/v${GITHUB_CLI_VERSION}/gh_${GITHUB_CLI_VERSION}_linux_${TARGETPLATFORM#linux/}.deb" \
192198
-o /tmp/gh.deb \
193199
&& apt-get update \
194-
&& apt-get -y install /tmp/gh.deb \
200+
&& apt-get -y install --no-install-recommends /tmp/gh.deb \
195201
&& rm /tmp/gh.deb \
196202
&& rm -rf /var/lib/apt/lists/*
197203

@@ -220,17 +226,17 @@ RUN apt-key add /tmp/nodesource.asc && rm /tmp/nodesource.asc
220226
&& apt-key add /tmp/yarn.asc && rm /tmp/yarn.asc \
221227
&& echo "deb https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarnpkg.list \
222228
&& apt-get update \
223-
&& apt-get -y install nodejs yarn \
229+
&& apt-get -y install --no-install-recommends nodejs yarn \
224230
&& rm -rf /var/lib/apt/lists/*
225231

226232
# Install SAM CLI
227-
RUN pip install aws-sam-cli \
233+
RUN eval "$(pyenv init -)" && pip install aws-sam-cli \
228234
&& sam --version
229235

230236
# Install Amazon SSM agent (allows debugging of builds via `codebuild-breakpoint`, https://go.aws/3TVW7vL)
231237
RUN apt-get update \
232-
&& apt-get -y install curl \
233-
&& curl -fSsL "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_${TARGETPLATFORM#linux/}/amazon-ssm-agent.deb" \
238+
&& apt-get -y install --no-install-recommends curl systemd \
239+
&& curl -fSsL "https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_${TARGETPLATFORM#linux/}/amazon-ssm-agent.deb"\
234240
-o /tmp/amazon-ssm-agent.deb \
235241
&& dpkg -i /tmp/amazon-ssm-agent.deb \
236242
&& systemctl enable amazon-ssm-agent \
@@ -380,8 +386,9 @@ ENV LANG="C.UTF-8"
380386
\
381387
GOROOT="/opt/golang/go" \
382388
RUSTUP_HOME="/usr/local/rustup" \
383-
CARGO_HOME="/usr/local/cargo"
384-
ENV PATH="${PATH}:${CARGO_HOME}/bin:${GOROOT}/bin:${M2}"
389+
CARGO_HOME="/usr/local/cargo" \
390+
PYENV_ROOT="/opt/.pyenv"
391+
ENV PATH="${PYENV_ROOT}/shims:${PATH}:${CARGO_HOME}/bin:${GOROOT}/bin:${M2}:${PYENV_ROOT}/bin"
385392

386393
COPY --from=staging / /
387394
VOLUME /var/lib/docker

superchain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SDK | Version
1515
`mono` | `>= 6.8.0.105`
1616
`Javascript` | see [NodeJS and NPM](#nodejs-and-npm)
1717
`PowerShell` | `pwsh >= 7.1.3`
18-
`Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2`
18+
`Python 3` | `python3 >= 3.8` with `pip3 >= 23.2.1`
1919
`Go` | `go >= 1.18`
2020

2121
## Image tags

superchain/build-local.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ else
2020
fi
2121

2222
# Now on to building the image
23-
docker build \
23+
${DOCKER:-docker} build \
2424
--target superchain \
25-
--build-arg BUILDPLATFORM=linux/amd64 \
26-
--build-arg TARGETPLATFORM=linux/amd64 \
25+
--build-arg BUILDPLATFORM=linux/$(uname -m) \
26+
--build-arg TARGETPLATFORM=linux/$(uname -m) \
2727
--build-arg BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
2828
--build-arg REGISTRY="docker.io/library" \
2929
--build-arg COMMIT_ID=${COMMIT_ID} \

0 commit comments

Comments
 (0)