diff --git a/.appveyor.yml b/.appveyor.yml index b685a9e75..3646ca43b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -34,6 +34,13 @@ environment: LINE_COVERAGE: '72' NEW_FLAKE8: 1 JAVA_HOME: "C:\\Program Files\\Java\\jdk11" + - PYTHON: "C:\\Python39-x64" + PYTHON_VERSION: '3.9' + PYTHON_ARCH: '64' + LINE_COVERAGE: '72' + NEW_FLAKE8: 1 + JAVA_HOME: "C:\\Program Files\\Java\\jdk11" + build: off @@ -42,7 +49,7 @@ for: - matrix: only: - - image: Visual Studio 2017 + - image: Visual Studio 2019 environment: GOPATH: c:\gopath diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py index 8cebd15ee..68c2fc892 100644 --- a/aws_lambda_builders/workflows/python_pip/packager.py +++ b/aws_lambda_builders/workflows/python_pip/packager.py @@ -72,7 +72,13 @@ def __init__(self, version): def get_lambda_abi(runtime): - supported = {"python2.7": "cp27mu", "python3.6": "cp36m", "python3.7": "cp37m", "python3.8": "cp38"} + supported = { + "python2.7": "cp27mu", + "python3.6": "cp36m", + "python3.7": "cp37m", + "python3.8": "cp38", + "python3.9": "cp39", + } if runtime not in supported: raise UnsupportedPythonVersion(runtime) @@ -164,6 +170,7 @@ class DependencyBuilder(object): "cp36m": (2, 17), "cp37m": (2, 17), "cp38": (2, 26), + "cp39": (2, 26), } # Fallback version if we're on an unknown python version # not in _RUNTIME_GLIBC. diff --git a/aws_lambda_builders/workflows/python_pip/validator.py b/aws_lambda_builders/workflows/python_pip/validator.py index 0032181a1..d31a929bc 100644 --- a/aws_lambda_builders/workflows/python_pip/validator.py +++ b/aws_lambda_builders/workflows/python_pip/validator.py @@ -13,7 +13,7 @@ class PythonRuntimeValidator(object): - SUPPORTED_RUNTIMES = {"python2.7", "python3.6", "python3.7", "python3.8"} + SUPPORTED_RUNTIMES = {"python2.7", "python3.6", "python3.7", "python3.8", "python3.9"} def __init__(self, runtime): self.language = "python" diff --git a/tests/integration/workflows/python_pip/test_python_pip.py b/tests/integration/workflows/python_pip/test_python_pip.py index 19529779a..11ab098d3 100644 --- a/tests/integration/workflows/python_pip/test_python_pip.py +++ b/tests/integration/workflows/python_pip/test_python_pip.py @@ -1,8 +1,9 @@ import os import shutil import sys +import platform import tempfile -from unittest import TestCase +from unittest import TestCase, skipIf import mock from aws_lambda_builders.builder import LambdaBuilder @@ -10,6 +11,7 @@ import logging logger = logging.getLogger("aws_lambda_builders.workflows.python_pip.workflow") +IS_WINDOWS = platform.system().lower() == "windows" class TestPythonPipWorkflow(TestCase): @@ -44,6 +46,7 @@ def setUp(self): "python3.7": "python2.7", "python2.7": "python3.8", "python3.8": "python2.7", + "python3.9": "python2.7", } def tearDown(self): @@ -84,6 +87,7 @@ def test_runtime_validate_python_project_fail_open_unsupported_runtime(self): self.source_dir, self.artifacts_dir, self.scratch_dir, self.manifest_path_valid, runtime="python2.8" ) + @skipIf(IS_WINDOWS, "Skip in windows tests") def test_must_resolve_local_dependency(self): source_dir = os.path.join(self.source_dir, "local-dependencies") manifest = os.path.join(source_dir, "requirements.txt") diff --git a/tests/unit/workflows/python_pip/test_packager.py b/tests/unit/workflows/python_pip/test_packager.py index 236b4655f..6fa61a7de 100644 --- a/tests/unit/workflows/python_pip/test_packager.py +++ b/tests/unit/workflows/python_pip/test_packager.py @@ -101,6 +101,9 @@ def test_get_lambda_abi_python37(self): def test_get_lambda_abi_python38(self): assert "cp38" == get_lambda_abi("python3.8") + def test_get_lambda_abi_python39(self): + assert "cp39" == get_lambda_abi("python3.9") + class TestPythonPipDependencyBuilder(object): def test_can_call_dependency_builder(self, osutils): diff --git a/tests/unit/workflows/python_pip/test_validator.py b/tests/unit/workflows/python_pip/test_validator.py index 94682b0b8..d1db8a17a 100644 --- a/tests/unit/workflows/python_pip/test_validator.py +++ b/tests/unit/workflows/python_pip/test_validator.py @@ -19,7 +19,7 @@ class TestPythonRuntimeValidator(TestCase): def setUp(self): self.validator = PythonRuntimeValidator(runtime="python3.7") - @parameterized.expand(["python2.7", "python3.6", "python3.7", "python3.8"]) + @parameterized.expand(["python2.7", "python3.6", "python3.7", "python3.8", "python3.9"]) def test_supported_runtimes(self, runtime): validator = PythonRuntimeValidator(runtime=runtime) self.assertTrue(validator.has_runtime())