diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78def1fc1..7366f727c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,12 @@ GitHub provides additional document on [forking a repository](https://help.githu Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/aws-lambda-builders/labels/help%20wanted) issues is a great place to start. +## Testing with SAM CLI + +1. [Activate Virtualenv](https://github.com/awslabs/aws-sam-cli/blob/develop/DEVELOPMENT_GUIDE.md) that is used for SAM CLI development. +2. Navigate to aws-lambda-builders project on your machine +3. `pip install -e .` (This will install the editable version of the aws-lambda-builers into SAM CLI's Virtualenv) + ## Code of Conduct This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact diff --git a/LICENSE b/LICENSE index d64569567..265968d37 100644 --- a/LICENSE +++ b/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index a99727c94..87ea496f5 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,17 @@ Lambda Builders is a Python library to compile, build and package AWS Lambda functions for several runtimes & frameworks. -We are in the process of implementing this project . If you are a developer and interested in contributing, -read the [DESIGN DOCUMENT](./DESIGN.md) to understand how this works. +Lambda Builders currently contains the following workflows + +* Java with Gradle +* Java with Maven +* Dotnet with amazon.lambda.tools +* Python with Pip +* Javascript with Npm +* Ruby with Bundler +* Go with Dep +* Go with Mod + +Lambda Builders is the brains behind the `sam build` command from [AWS SAM CLI](https://github.com/awslabs/aws-sam-cli) + +If you are a developer and interested in contributing, read the [DESIGN DOCUMENT](./DESIGN.md) to understand how this works. diff --git a/aws_lambda_builders/__init__.py b/aws_lambda_builders/__init__.py index f6d3af2b1..a0adf692b 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -1,5 +1,5 @@ """ AWS Lambda Builder Library """ -__version__ = '0.3.0' +__version__ = '0.4.0' RPC_PROTOCOL_VERSION = "0.3" diff --git a/aws_lambda_builders/utils.py b/aws_lambda_builders/utils.py index d5b2ec9aa..b8e6e3ea7 100644 --- a/aws_lambda_builders/utils.py +++ b/aws_lambda_builders/utils.py @@ -36,7 +36,7 @@ def copytree(source, destination, ignore=None): try: # Let's try to copy the directory metadata from source to destination shutil.copystat(source, destination) - except WindowsError as ex: # pylint: disable=undefined-variable + except OSError as ex: # Can't copy file access times in Windows LOG.debug("Unable to copy file access times from %s to %s", source, destination, exc_info=ex) diff --git a/aws_lambda_builders/workflows/python_pip/actions.py b/aws_lambda_builders/workflows/python_pip/actions.py index e2c0cb3fb..7886edc65 100644 --- a/aws_lambda_builders/workflows/python_pip/actions.py +++ b/aws_lambda_builders/workflows/python_pip/actions.py @@ -14,7 +14,7 @@ class PythonPipBuildAction(BaseAction): PURPOSE = Purpose.RESOLVE_DEPENDENCIES LANGUAGE = 'python' - def __init__(self, artifacts_dir, manifest_path, scratch_dir, runtime, binaries): + def __init__(self, artifacts_dir, scratch_dir, manifest_path, runtime, binaries): self.artifacts_dir = artifacts_dir self.manifest_path = manifest_path self.scratch_dir = scratch_dir @@ -34,9 +34,9 @@ def execute(self): dependency_builder=dependency_builder) try: package_builder.build_dependencies( - self.artifacts_dir, - self.manifest_path, - self.scratch_dir + artifacts_dir_path=self.artifacts_dir, + scratch_dir_path=self.scratch_dir, + requirements_path=self.manifest_path ) except PackagerError as ex: raise ActionFailedError(str(ex)) diff --git a/tests/unit/workflows/python_pip/test_actions.py b/tests/unit/workflows/python_pip/test_actions.py index c2ed21c2b..0f9be9484 100644 --- a/tests/unit/workflows/python_pip/test_actions.py +++ b/tests/unit/workflows/python_pip/test_actions.py @@ -24,9 +24,9 @@ def test_action_must_call_builder(self, PythonPipDependencyBuilderMock): }) action.execute() - builder_instance.build_dependencies.assert_called_with("artifacts", - "scratch_dir", - "manifest") + builder_instance.build_dependencies.assert_called_with(artifacts_dir_path="artifacts", + scratch_dir_path="scratch_dir", + requirements_path="manifest") @patch("aws_lambda_builders.workflows.python_pip.actions.PythonPipDependencyBuilder") def test_must_raise_exception_on_failure(self, PythonPipDependencyBuilderMock):