-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(build): Build a single function #1146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
function_logical_id) | ||
|
||
all_artifacts = set(os.listdir(str(resource_artifact_dir))) | ||
print(all_artifacts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove prints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"jinja2", | ||
'requirements.txt'} | ||
|
||
def test_fucntion_not_found(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
EXPECTED_FILES_GLOBAL_MANIFEST = set() | ||
EXPECTED_FILES_PROJECT_MANIFEST = {'__init__.py', 'main.py', 'numpy', | ||
# 'cryptography', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is cryptography commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied from the above python tests.
This is the specific reason: https://github.com/awslabs/aws-sam-cli/blob/develop/tests/integration/testdata/buildcmd/Python/requirements.txt#L4
Issue #, if available:
N/A
Description of changes:
This enables a customer to build a single function similar to how they would invoke a single function. To build a single function, you can pass the LogicalID to the command
sam build <MyLogicalId>
. If the LogicalID is omitted, the command will behave exactly how it does not and build the whole template.Concerns on approach:
This change enables a customer (or IDE) to quickly build a single function for faster test cycles. This could result in a deployment to of source code instead of built code, if the customer only builds one of the n number of functions in the template and then does a package and deploy. With this change, customers will need to still use
sam build
without the logicalId before package and deploying. This could create more customer confusion in the short term.Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.