Skip to content

Commit

Permalink
make superchain ship Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller committed Jul 26, 2023
1 parent 9e03b46 commit 17371dd
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 47 deletions.
33 changes: 13 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
with:
cache: yarn
node-version: '16'
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'
cache: pip
- name: Install python3-venv
run: sudo apt install -y python3-venv
Expand Down Expand Up @@ -130,10 +130,10 @@ jobs:
with:
cache: yarn
node-version: '16'
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'
cache: pip
- name: Install python3-venv
run: sudo apt install -y python3-venv
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
java: ['8']
node: ['16'] # EOL 2023-09-11
os: [ubuntu-latest]
python: ['3.7']
python: ['3.8']
# Add specific combinations to be tested against "node 14" (to restrict cardinality)
include:
# Test using Windows
Expand All @@ -207,69 +207,62 @@ jobs:
go: '1.18'
java: '8'
node: '16'
python: '3.7'
python: '3.8'
# Test using macOS
- title: 'macOS'
os: macos-latest
dotnet: '6.0.x'
go: '1.18'
java: '8'
node: '16'
python: '3.7'
python: '3.8'
# Test alternate Nodes
- title: 'Node 16'
java: '8'
dotnet: '6.0.x'
go: '1.18'
node: '16' # EOL 2023-09-11
os: ubuntu-latest
python: '3.7'
python: '3.8'
- title: 'Node 18'
java: '8'
dotnet: '6.0.x'
go: '1.18'
node: '18' # EOL 2025-04-30
os: ubuntu-latest
python: '3.7'
python: '3.8'
- title: 'Node 20'
java: '8'
dotnet: '6.0.x'
go: '1.18'
node: '20' # EOL 2026-04-30
os: ubuntu-latest
python: '3.7'
python: '3.8'
# Test alternate .NETs
- title: '.NET 7.0'
java: '8'
dotnet: '7.0.x'
go: '1.18'
node: '16'
os: ubuntu-latest
python: '3.7'
python: '3.8'
# Test alternate Gos
- title: 'Go 1.19'
java: '8'
dotnet: '6.0.x'
go: '1.19'
node: '16'
os: ubuntu-latest
python: '3.7'
python: '3.8'
# Test alternate Javas
- title: 'Java 11'
java: '11'
dotnet: '6.0.x'
go: '1.18'
node: '16'
os: ubuntu-latest
python: '3.7'
# Test alternate Pythons
- title: 'Python 3.8'
python: '3.8'
dotnet: '6.0.x'
go: '1.18'
java: '8'
node: '16'
os: ubuntu-latest
# Test alternate Pythons
- title: 'Python 3.9'
python: '3.9'
dotnet: '6.0.x'
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ in your development environment.
+ [`maven >= 3.0.5`](https://maven.apache.org)
- [.NET `6.0`] or later
+ *Recommended:* [`mono >= 6`](https://www.mono-project.com)
- [Python `3.7.3`] or later
- [Python `3.8`] or later
+ [`pip`](https://pip.pypa.io/en/stable/installing/)
+ [`setuptools >= 38.6.0`](https://pypi.org/project/setuptools/)
+ [`wheel`](https://pypi.org/project/wheel/)
Expand All @@ -57,7 +57,7 @@ in your development environment.
[Oracle's OpenJDK8]: http://openjdk.java.net/install/
[Amazon Corretto 8]: https://aws.amazon.com/corretto/
[.NET `6.0`]: https://www.microsoft.com/net/download
[Python `3.7.3`]: https://www.python.org/downloads/release/python-373/
[Python `3.8`]: https://www.python.org/downloads/
[Go]: https://go.dev/dl/

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/content/user-guides/language-support/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ in significant re-engineering effort:
- How are dependencies modeled? If [semantic versioning] is not the norm, what is the strategy to correctly represent
semantic version ranges?
- What are the toolchain and platform requirements?
- For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.7 or above,
- For example, **Java** requires an OpenJDK 8 distribution and `maven`, **Python** requires `python` 3.8 or above,
etc...

## Code Generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ The `python` target requires two configuration entries:
- Additionally, the following `Programming Language ::` classifiers are already set (more could be added by the user
if relevant):
- `Programming Language :: Python :: 3 :: Only`
- `Programming Language :: Python :: 3.7`
- `Programming Language :: Python :: 3.8`
- `Programming Language :: Python :: 3.9`
- `Programming Language :: Python :: 3.10`
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/content/user-guides/lib-author/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ to produce releasable artifacts.
| .NET | .NET ≥ 6.0 |
| Go | Go ≥ 1.18 |
| Java | JDK ≥ 8 *and* Maven ≥ 3.6 |
| Python | Python ≥ 3.7 |
| Python | Python ≥ 3.8 |


## :octicons-desktop-download-24: Download Locations
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/python-runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ exclude = '\.(git|mypy_cache|env)'
ignore_missing_imports = true

[tool.pyright]
pythonVersion = "3.7"
pythonVersion = "3.8"
venv = ".env"
venvPath = "."
3 changes: 1 addition & 2 deletions packages/@jsii/python-runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@
"python-dateutil",
"typing_extensions>=3.7,<5.0",
],
python_requires="~=3.7",
python_requires="~=3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: JavaScript",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
37 changes: 22 additions & 15 deletions superchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
########################################################################################################################
# Prepare install images of "manual" binary distributions (runs on BUILD platform for speed)
########################################################################################################################
FROM --platform=${BUILDPLATFORM} public.ecr.aws/debian/debian:10 as bindist
FROM --platform=${BUILDPLATFORM} public.ecr.aws/debian/debian:10-slim as bindist

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

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

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

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

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

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

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

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

# Install SAM CLI
RUN pip install aws-sam-cli \
RUN eval "$(pyenv init -)" && pip install aws-sam-cli \
&& sam --version

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

COPY --from=staging / /
VOLUME /var/lib/docker
Expand Down
2 changes: 1 addition & 1 deletion superchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SDK | Version
`mono` | `>= 6.8.0.105`
`Javascript` | see [NodeJS and NPM](#nodejs-and-npm)
`PowerShell` | `pwsh >= 7.1.3`
`Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2`
`Python 3` | `python3 >= 3.8` with `pip3 >= 23.2.1`
`Go` | `go >= 1.18`

## Image tags
Expand Down
6 changes: 3 additions & 3 deletions superchain/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ else
fi

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

0 comments on commit 17371dd

Please sign in to comment.