Skip to content

Commit

Permalink
Merge pull request #182 from awslabs/develop
Browse files Browse the repository at this point in the history
release: 1.0.0
  • Loading branch information
jfuss authored Jul 20, 2020
2 parents 30818b9 + 4ff4077 commit a943b1a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 16 deletions.
2 changes: 1 addition & 1 deletion aws_lambda_builders/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
AWS Lambda Builder Library
"""
__version__ = "0.9.0"
__version__ = "1.0.0"
RPC_PROTOCOL_VERSION = "0.3"
4 changes: 2 additions & 2 deletions aws_lambda_builders/workflows/dotnet_clipackage/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def __init__(self, subprocess_dotnet):
def execute(self):
try:
LOG.debug("Installing Amazon.Lambda.Tools Global Tool")
self.subprocess_dotnet.run(["tool", "install", "-g", "Amazon.Lambda.Tools"])
self.subprocess_dotnet.run(["tool", "install", "-g", "Amazon.Lambda.Tools", "--ignore-failed-sources"])
except DotnetCLIExecutionError as ex:
LOG.debug("Error installing probably due to already installed. Attempt to update to latest version.")
try:
self.subprocess_dotnet.run(["tool", "update", "-g", "Amazon.Lambda.Tools"])
self.subprocess_dotnet.run(["tool", "update", "-g", "Amazon.Lambda.Tools", "--ignore-failed-sources"])
except DotnetCLIExecutionError as ex:
raise ActionFailedError("Error configuring the Amazon.Lambda.Tools .NET Core Global Tool: " + str(ex))

Expand Down
11 changes: 8 additions & 3 deletions aws_lambda_builders/workflows/python_pip/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ class DependencyBuilder(object):
packager.
"""

_MANYLINUX_COMPATIBLE_PLATFORM = {"any", "linux_x86_64", "manylinux1_x86_64"}
_MANYLINUX_COMPATIBLE_PLATFORM = {
"any",
"linux_x86_64",
"manylinux1_x86_64",
"manylinux2010_x86_64",
"manylinux2014_x86_64",
}
_COMPATIBLE_PACKAGE_WHITELIST = {"sqlalchemy"}

def __init__(self, osutils, runtime, pip_runner=None):
Expand Down Expand Up @@ -243,7 +249,6 @@ def _download_dependencies(self, directory, requirements_filename):
compatible_wheels.add(package)
else:
incompatible_wheels.add(package)

LOG.debug("initial compatible: %s", compatible_wheels)
LOG.debug("initial incompatible: %s", incompatible_wheels | sdists)

Expand Down Expand Up @@ -622,7 +627,7 @@ def download_manylinux_wheels(self, packages, directory, lambda_abi):
"--only-binary=:all:",
"--no-deps",
"--platform",
"manylinux1_x86_64",
"manylinux2014_x86_64",
"--implementation",
"cp",
"--abi",
Expand Down
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pytest-cov==2.4.0
astroid>=1.5.8,<2.1.0; python_version < '3.8'
pylint==1.7.2; python_version < '3.8'
pylint==2.4.4; python_version >= '3.8'
isort>=4.2.5,<5; python_version < '3.8'

# Test requirements
pytest==3.0.7
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/workflows/python_pip/test_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def test_can_replace_incompat_whl(self, tmpdir, osutils, pip_runner):
"--only-binary=:all:",
"--no-deps",
"--platform",
"manylinux1_x86_64",
"manylinux2014_x86_64",
"--implementation",
"cp",
"--abi",
Expand Down Expand Up @@ -589,7 +589,7 @@ def test_whitelist_sqlalchemy(self, tmpdir, osutils, pip_runner):
"--only-binary=:all:",
"--no-deps",
"--platform",
"manylinux1_x86_64",
"manylinux2014_x86_64",
"--implementation",
"cp",
"--abi",
Expand Down Expand Up @@ -721,7 +721,7 @@ def test_build_into_existing_dir_with_preinstalled_packages(self, tmpdir, osutil
"--only-binary=:all:",
"--no-deps",
"--platform",
"manylinux1_x86_64",
"manylinux2014_x86_64",
"--implementation",
"cp",
"--abi",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/workflows/custom_make/test_custom_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def test_must_build_python_project_through_makefile(self):
"idna",
"urllib3-1.25.9.dist-info",
"chardet-3.0.4.dist-info",
"certifi-2020.4.5.1.dist-info",
"certifi-2020.4.5.2.dist-info",
"certifi",
"idna-2.9.dist-info",
"idna-2.10.dist-info",
"requests",
"requests-2.23.0.dist-info",
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
requests==2.23.0
requests==2.23.0

# Pinning so the test can expect a given version
certifi==2020.4.5.2 # dep of requests
12 changes: 9 additions & 3 deletions tests/unit/workflows/dotnet_clipackage/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ def tearDown(self):
def test_global_tool_install(self):
action = GlobalToolInstallAction(self.subprocess_dotnet)
action.execute()
self.subprocess_dotnet.run.assert_called_once_with(["tool", "install", "-g", "Amazon.Lambda.Tools"])
self.subprocess_dotnet.run.assert_called_once_with(
["tool", "install", "-g", "Amazon.Lambda.Tools", "--ignore-failed-sources"]
)

def test_global_tool_update(self):
self.subprocess_dotnet.run.side_effect = [DotnetCLIExecutionError(message="Already Installed"), None]
action = GlobalToolInstallAction(self.subprocess_dotnet)
action.execute()
self.subprocess_dotnet.run.assert_any_call(["tool", "install", "-g", "Amazon.Lambda.Tools"])
self.subprocess_dotnet.run.assert_any_call(["tool", "update", "-g", "Amazon.Lambda.Tools"])
self.subprocess_dotnet.run.assert_any_call(
["tool", "install", "-g", "Amazon.Lambda.Tools", "--ignore-failed-sources"]
)
self.subprocess_dotnet.run.assert_any_call(
["tool", "update", "-g", "Amazon.Lambda.Tools", "--ignore-failed-sources"]
)

def test_global_tool_update_failed(self):
self.subprocess_dotnet.run.side_effect = [
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/workflows/python_pip/test_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_download_wheels(self, pip_factory):
"--only-binary=:all:",
"--no-deps",
"--platform",
"manylinux1_x86_64",
"manylinux2014_x86_64",
"--implementation",
"cp",
"--abi",
Expand Down

0 comments on commit a943b1a

Please sign in to comment.