Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove python3.6 support #4635

Merged
merged 8 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions appveyor-iac-integration-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@ environment:
- PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_38_PIP: 1
INSTALL_PY_39_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true

- PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_39_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true

- PYTHON_VERSION: '3.9'
PYTHON_ARCH: '64'
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_38_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true
Expand Down Expand Up @@ -61,26 +58,22 @@ install:
- sh: "sudo apt install maven"
- sh: "mvn --version"

- sh: "sudo apt-get -y install python3.6"
- sh: "sudo apt-get -y install python3.7"
- sh: "sudo apt-get -y install python3.8"
- sh: "sudo apt-get -y install python3.9 python3.9-venv"

- sh: "which python3.8"
- sh: "which python3.7"
- sh: "which python3.6"
- sh: "which python3.9"

- sh: "PATH=$PATH:/usr/bin/python3.9:/usr/bin/python3.8:/usr/bin/python3.7"
- sh: "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
- sh: "curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip-36.py"

- sh: "sudo apt-get -y install python3-distutils"
- sh: "sudo apt-get -y install python3.9-distutils"
- ps: "If ($env:INSTALL_PY_39_PIP) {python3.9 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_38_PIP) {python3.8 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_37_PIP) {python3.7 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_36_PIP) {python3.6 get-pip-36.py --user}"

# get testing env vars
- sh: "sudo apt install -y jq"
Expand Down
8 changes: 0 additions & 8 deletions appveyor-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_38_PIP: 1
INSTALL_PY_39_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true
Expand All @@ -41,7 +40,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_39_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true
Expand All @@ -51,7 +49,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_38_PIP: 1
APPVEYOR_CONSOLE_DISABLE_PTY: true
Expand Down Expand Up @@ -85,17 +82,13 @@ install:
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "sudo apt-get -y install python3.6"
- sh: "sudo apt-get -y install python2.7"
- sh: "sudo apt-get -y install python3.7"
- sh: "sudo apt-get -y install python3.8"
- sh: "sudo apt-get -y install python3.9 python3.9-dev python3.9-venv"

- sh: "which python3.8"
- sh: "which python3.7"
- sh: "which python3.6"
- sh: "which python3.9"
- sh: "which python2.7"

- sh: "PATH=$PATH:/usr/bin/python3.9:/usr/bin/python3.8:/usr/bin/python3.7"
- sh: "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
Expand All @@ -106,7 +99,6 @@ install:
- ps: "If ($env:INSTALL_PY_39_PIP) {python3.9 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_38_PIP) {python3.8 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_37_PIP) {python3.7 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_36_PIP) {python3.6 get-pip-36.py --user}"

# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"
Expand Down
4 changes: 1 addition & 3 deletions appveyor-windows-build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install:
- "C:\\Python39\\python.exe -m pip freeze"
- "refreshenv"
- ps: "mkdir -Force C:\\tmp"
- "SET PATH=%PYTHON_HOME%;%PATH%;C:\\Python36-x64;C:\\Python27-x64;C:\\Python38;C:\\Python39"
- "SET PATH=%PYTHON_HOME%;%PATH%;C:\\Python38;C:\\Python39"
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
Expand All @@ -52,8 +52,6 @@ install:
- "python -m pip install --upgrade setuptools wheel virtualenv"

# Upgrade pip in each python
- "C:\\Python27\\python.exe -m pip install --upgrade pip"
- "C:\\Python36-x64\\python.exe -m pip install --upgrade pip"
# python is python3.7
- "python -m pip install --upgrade pip"
- "C:\\Python38\\python.exe -m pip install --upgrade pip"
Expand Down
9 changes: 0 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_38_PIP: 1
INSTALL_PY_39_PIP: 1
AWS_S3: 'AWS_S3_37'
Expand All @@ -27,7 +26,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_39_PIP: 1
AWS_S3: 'AWS_S3_38'
Expand All @@ -39,7 +37,6 @@ environment:
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_38_PIP: 1
AWS_S3: 'AWS_S3_39'
Expand Down Expand Up @@ -158,28 +155,22 @@ for:
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"

- sh: "sudo apt-get -y install python3.6"
- sh: "sudo apt-get -y install python2.7"
- sh: "sudo apt-get -y install python3.7"
- sh: "sudo apt-get -y install python3.8"
- sh: "sudo apt-get -y install python3.9"

- sh: "which python3.8"
- sh: "which python3.7"
- sh: "which python3.6"
- sh: "which python3.9"
- sh: "which python2.7"

- sh: "PATH=$PATH:/usr/bin/python3.9:/usr/bin/python3.8:/usr/bin/python3.7"
- sh: "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
- sh: "curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip-36.py"

- sh: "sudo apt-get -y install python3-distutils"
- sh: "sudo apt-get -y install python3.9-distutils"
- ps: "If ($env:INSTALL_PY_39_PIP) {python3.9 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_38_PIP) {python3.8 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_37_PIP) {python3.7 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_36_PIP) {python3.6 get-pip-36.py --user}"

# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker~=4.2.0
dateparser~=1.0
requests==2.25.1
serverlessrepo==0.1.10
aws_lambda_builders==1.25.0
aws_lambda_builders==1.26.0
tomlkit==0.7.2
watchdog==2.1.2
pyopenssl==23.0.0
Expand Down
20 changes: 11 additions & 9 deletions requirements/reproducible-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ attrs==20.3.0 \
# jschema-to-python
# jsonschema
# sarif-om
aws-lambda-builders==1.25.0 \
--hash=sha256:4bb736a74457f87883861d57c0f6a859bd4e047b78ee58e09d16703a0c5172f3 \
--hash=sha256:f9d2094f714434b3668377fee5729c883849aede8a64eafe689fff08a530783b
aws-lambda-builders==1.26.0 \
--hash=sha256:511a3be80511b3cedbc223504fef9366063c45f8fff94d2acb270de92e9efb02 \
--hash=sha256:d316837180d3ed5a04a40584e25c318fb97a7d0ab987c0f21bd07e421fd4d1d8
# via aws-sam-cli (setup.py)
aws-sam-translator==1.58.1 \
--hash=sha256:c4e261e450d574572d389edcafab04d1fe337615f867610410390c2435cb1f26 \
Expand Down Expand Up @@ -507,12 +507,6 @@ serverlessrepo==0.1.10 \
--hash=sha256:671f48038123f121437b717ed51f253a55775590f00fbab6fbc6a01f8d05c017 \
--hash=sha256:b99c69be8ce87ccc48103fbe371ba7b148c3374c57862e59118c402522e5ed52
# via aws-sam-cli (setup.py)
setuptools==65.5.1 \
--hash=sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31 \
--hash=sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f
# via
# aws-lambda-builders
# jsonschema
six==1.15.0 \
--hash=sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259 \
--hash=sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced
Expand Down Expand Up @@ -589,3 +583,11 @@ zipp==3.10.0 \
--hash=sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1 \
--hash=sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==65.5.1 \
--hash=sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31 \
--hash=sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f
# via
# aws-lambda-builders
# jsonschema
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
\b
Supported Runtimes
------------------
1. Python 3.6, 3.7, 3.8 3.9 using PIP\n
1. Python 3.7, 3.8, 3.9 using PIP\n
2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 2.7 using Bundler\n
4. Java 8, Java 11 using Gradle and Maven\n
Expand Down
1 change: 1 addition & 0 deletions samcli/lib/build/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dotnetcore2.0",
"dotnetcore2.1",
"python2.7",
"python3.6",
"ruby2.5",
}
BUILD_PROPERTIES = "BuildProperties"
2 changes: 0 additions & 2 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def get_selector(

def get_layer_subfolder(build_workflow: str) -> str:
subfolders_by_runtime = {
"python3.6": "python",
"python3.7": "python",
"python3.8": "python",
"python3.9": "python",
Expand Down Expand Up @@ -147,7 +146,6 @@ def get_workflow_config(
}

selectors_by_runtime = {
"python3.6": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.7": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.8": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
"python3.9": BasicWorkflowSelector(PYTHON_PIP_CONFIG),
Expand Down
10 changes: 0 additions & 10 deletions samcli/lib/init/local_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,6 @@
"useCaseName": "Hello World Example"
}
],
"python3.6": [
{
"directory": "template/cookiecutter-aws-sam-hello-python",
"displayName": "Hello World Example",
"dependencyManager": "pip",
"appTemplate": "hello-world",
"packageType": "Zip",
"useCaseName": "Hello World Example"
}
],
"ruby2.7": [
{
"directory": "template/cookiecutter-aws-sam-hello-ruby",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ A cookiecutter template to create a Python Hello world boilerplate using [Server
Generate a boilerplate template in your current project directory using the following syntax:

* **Python 3.7**: `sam init --runtime python3.7`
* **Python 3.6**: `sam init --runtime python3.6`
* **Python 3.8**: `sam init --runtime python3.8`
* **Python 3.9**: `sam init --runtime python3.9`

> **NOTE**: ``--name`` allows you to specify a different project folder name (`sam-app` is the default)

Expand Down
1 change: 0 additions & 1 deletion samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"nodejs14.x": [ARM64, X86_64],
"nodejs16.x": [ARM64, X86_64],
"nodejs18.x": [ARM64, X86_64],
"python3.6": [X86_64],
"python3.7": [X86_64],
"python3.8": [ARM64, X86_64],
"python3.9": [ARM64, X86_64],
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/sam_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def configure_null_logger(logger):
Configure a Logger with a NullHandler

Useful for libraries that do not follow:
https://docs.python.org/3.6/howto/logging.html#configuring-logging-for-a-library
https://docs.python.org/3.9/howto/logging.html#configuring-logging-for-a-library

Parameters
----------
Expand Down
5 changes: 1 addition & 4 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
RUNTIME_DEP_TEMPLATE_MAPPING = {
"python": [
{
"runtimes": ["python3.9", "python3.8", "python3.7", "python3.6"],
"runtimes": ["python3.9", "python3.8", "python3.7"],
"dependency_manager": "pip",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-python"),
"build": True,
Expand Down Expand Up @@ -117,7 +117,6 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.9",
"python3.8",
"python3.7",
"python3.6",
# ruby runtimes in descending order
"ruby2.7",
]
Expand All @@ -138,7 +137,6 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.9": "amazon/python3.9-base",
"python3.8": "amazon/python3.8-base",
"python3.7": "amazon/python3.7-base",
"python3.6": "amazon/python3.6-base",
"ruby2.7": "amazon/ruby2.7-base",
}

Expand All @@ -151,7 +149,6 @@ def get_local_lambda_images_location(mapping, runtime):
"java8.al2": "Java8",
"java11": "Java8",
"python3.7": "Python36",
"python3.6": "Python36",
"python3.8": "Python36",
"python3.9": "Python36",
"dotnet6": "dotnetcore3.1",
Expand Down
4 changes: 0 additions & 4 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
**_container_env_vars,
},
),
Runtime.python36.value: lambda: DebugSettings(
entry + ["/var/lang/bin/python3.6"] + debug_args_list + ["/var/runtime/bootstrap.py"],
container_env_vars=_container_env_vars,
),
Runtime.python37.value: lambda: DebugSettings(
entry + ["/var/lang/bin/python3.7"] + debug_args_list + ["/var/runtime/bootstrap"],
container_env_vars=_container_env_vars,
Expand Down
3 changes: 1 addition & 2 deletions samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Runtime(Enum):
nodejs14x = "nodejs14.x"
nodejs16x = "nodejs16.x"
nodejs18x = "nodejs18.x"
python36 = "python3.6"
python37 = "python3.7"
python38 = "python3.8"
python39 = "python3.9"
Expand Down Expand Up @@ -338,7 +337,7 @@ def set_item_permission(tar_info):
@staticmethod
def _generate_dockerfile(base_image, layers, architecture):
"""
FROM public.ecr.aws/lambda/python:3.6-x86_64
FROM public.ecr.aws/lambda/python:3.9-x86_64

ADD aws-lambda-rie /var/rapid

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ Resources:
ContentUri: s3://sam-demo-bucket/layer.zip
Description: Starter Lambda Layer
CompatibleRuntimes:
- python3.6
- python2.7
- python3.9
LicenseInfo: License information
RetentionPolicy: Retain

Expand Down
Loading