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 6 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 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
14 changes: 5 additions & 9 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TestBuildCommand_PythonFunctions_Images(BuildIntegBase):

FUNCTION_LOGICAL_ID_IMAGE = "ImageFunction"

@parameterized.expand([("3.6", False), ("3.7", False), ("3.8", False), ("3.9", False)])
@parameterized.expand([("3.7", False), ("3.8", False), ("3.9", False)])
@pytest.mark.flaky(reruns=3)
def test_with_default_requirements(self, runtime, use_container):
_tag = f"{random.randint(1,100)}"
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_with_default_requirements(self, runtime, use_container):
self.built_template, self.FUNCTION_LOGICAL_ID_IMAGE, self._make_parameter_override_arg(overrides), expected
)

@parameterized.expand([("3.6", False), ("3.7", False), ("3.8", False), ("3.9", False)])
@parameterized.expand([("3.7", False), ("3.8", False), ("3.9", False)])
@pytest.mark.flaky(reruns=3)
def test_with_dockerfile_extension(self, runtime, use_container):
_tag = f"{random.randint(1,100)}"
Expand Down Expand Up @@ -164,8 +164,8 @@ class TestBuildCommand_PythonFunctions_ImagesWithSharedCode(BuildIntegBase):

@parameterized.expand(
[
*[(runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) for runtime in ["3.6", "3.7", "3.8", "3.9"]],
*[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.6", "3.7", "3.8", "3.9"]],
*[(runtime, "feature_phi/Dockerfile", {"phi": "1.62"}) for runtime in ["3.7", "3.8", "3.9"]],
*[(runtime, "feature_pi/Dockerfile", {"pi": "3.14"}) for runtime in ["3.7", "3.8", "3.9"]],
]
)
@pytest.mark.flaky(reruns=3)
Expand Down Expand Up @@ -251,7 +251,7 @@ class TestSkipBuildingFunctionsWithLocalImageUri(BuildIntegBase):

FUNCTION_LOGICAL_ID_IMAGE = "ImageFunction"

@parameterized.expand(["3.6", "3.7", "3.8", "3.9"])
@parameterized.expand(["3.7", "3.8", "3.9"])
@pytest.mark.flaky(reruns=3)
def test_with_default_requirements(self, runtime):
_tag = f"{random.randint(1,100)}"
Expand Down Expand Up @@ -399,13 +399,11 @@ def _validate_skipped_built_function(
"prop",
),
[
("template.yaml", "Function", True, "python3.6", "Python", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.7", "Python", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.8", "Python", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.9", "Python", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.7", "PythonPEP600", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.8", "PythonPEP600", False, False, "CodeUri"),
("template.yaml", "Function", True, "python3.6", "Python", "use_container", False, "CodeUri"),
("template.yaml", "Function", True, "python3.7", "Python", "use_container", False, "CodeUri"),
("template.yaml", "Function", True, "python3.8", "Python", "use_container", False, "CodeUri"),
("template.yaml", "Function", True, "python3.9", "Python", "use_container", False, "CodeUri"),
Expand Down Expand Up @@ -449,13 +447,11 @@ class TestBuildCommand_PythonFunctions_With_Specified_Architecture(BuildIntegPyt

@parameterized.expand(
[
("python3.6", "Python", False, "x86_64"),
("python3.7", "Python", False, "x86_64"),
("python3.8", "Python", False, "x86_64"),
# numpy 1.20.3 (in PythonPEP600/requirements.txt) only support python 3.7+
("python3.7", "PythonPEP600", False, "x86_64"),
("python3.8", "PythonPEP600", False, "x86_64"),
("python3.6", "Python", "use_container", "x86_64"),
("python3.7", "Python", "use_container", "x86_64"),
("python3.8", "Python", "use_container", "x86_64"),
("python3.8", "Python", False, "arm64"),
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/deploy/test_managed_stack_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# This is to restrict package tests to run outside of CI/CD, when the branch is not master or tests are not run by Canary
SKIP_MANAGED_STACK_TESTS = RUNNING_ON_CI and RUNNING_TEST_FOR_MASTER_ON_CI and not RUN_BY_CANARY
# Limits the managed stack tests to be run on a single python version to avoid CI race conditions
IS_TARGETTED_PYTHON_VERSION = PYTHON_VERSION.startswith("3.6")
IS_TARGETTED_PYTHON_VERSION = PYTHON_VERSION.startswith("3.7")

CFN_PYTHON_VERSION_SUFFIX = PYTHON_VERSION.replace(".", "-")
CFN_SLEEP = 3
Expand Down
Loading