Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion chalice/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Control plane APIs for programatically building/deploying Chalice apps.
"""Control plane APIs for programmatically building/deploying Chalice apps.

The eventual goal is to expose this as a public API that other tools can use
in their own integrations with Chalice, but this will need time for the APIs
Expand Down
2 changes: 1 addition & 1 deletion chalice/cli/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def load_chalice_app(
validate_feature_flags: Optional[bool] = True,
) -> Chalice:
# validate_features indicates that we should validate that
# any expiremental features used have the appropriate feature flags.
# any experimental features used have the appropriate feature flags.
if self.project_dir not in sys.path:
sys.path.insert(0, self.project_dir)
# The vendor directory has its contents copied up to the top level of
Expand Down
4 changes: 2 additions & 2 deletions chalice/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def raise_compile_error(*args, **kwargs): # type: ignore
)

# On windows the C compiling story is much more complex than on posix as
# there are many different C compilers that setuptools and disutils will
# there are many different C compilers that setuptools and distutils will
# try and find using a combination of known filepaths, registry entries,
# and environment variables. Since there is no simple environment variable
# we can replace when starting the subprocess that builds the package;
Expand Down Expand Up @@ -108,7 +108,7 @@ def raise_compile_error(*args, **kwargs): # type: ignore
# inject _SETUPTOOLS_SHIM rather than the usual SETUPTOOLS_SHIM in pip.
# This lets us apply our patches in the same process that will compile
# the c extensions before the setup.py file has been executed.
# The actual patches used are decribed in the comment above
# The actual patches used are described in the comment above
# _SETUPTOOLS_SHIM.
pip_no_compile_c_shim = (
'import pip;'
Expand Down
10 changes: 5 additions & 5 deletions chalice/deploy/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def deployment_package_filename(
# based on a hash of the requirements file.
# This is done so that we only "pip install -r requirements.txt"
# when we know there's new dependencies we need to install.
# The python version these depedencies were downloaded for is appended
# The python version these dependencies were downloaded for is appended
# to the end of the filename since the the dependencies may not change
# but if the python version changes then the dependencies need to be
# re-downloaded since they will not be compatible.
Expand Down Expand Up @@ -617,8 +617,8 @@ def _has_at_least_one_package(self, filename: str) -> bool:
def _download_all_dependencies(
self, requirements_filename: str, directory: str
) -> Set[Package]:
# Download dependencies prefering wheel files but falling back to
# raw source dependences to get the transitive closure over
# Download dependencies preferring wheel files but falling back to
# raw source dependencies to get the transitive closure over
# the dependency graph. Return the set of all package objects
# which will serve as the master list of dependencies needed to deploy
# successfully.
Expand Down Expand Up @@ -714,7 +714,7 @@ def _download_dependencies(
# - lambda incompatible wheel files
# Pip will give us a wheel when it can, but some distributions do not
# ship with wheels at all in which case we will have an sdist for it.
# In some cases a platform specific wheel file may be availble so pip
# In some cases a platform specific wheel file may be available so pip
# will have downloaded that, if our platform does not match the
# platform lambda runs on (linux_x86_64/manylinux) then the downloaded
# wheel file may not be compatible with lambda. Pure python wheels
Expand Down Expand Up @@ -1131,7 +1131,7 @@ def download_all_dependencies(
# When downloading all dependencies we expect to get an rc of 0 back
# since we are casting a wide net here letting pip have options about
# what to download. If a package is not found it is likely because it
# does not exist and was mispelled. In this case we raise an error with
# does not exist and was misspelled. In this case we raise an error with
# the package name. Otherwise a nonzero rc results in a generic
# download error where we pass along the stderr.
if rc != 0:
Expand Down
2 changes: 1 addition & 1 deletion chalice/deploy/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def __eq__(self, other):


class PlanEncoder(json.JSONEncoder):
# pylint false positive overriden below
# pylint false positive overridden below
# https://github.com/PyCQA/pylint/issues/414
def default(self, o): # pylint: disable=E0202
# type: (Any) -> Any
Expand Down
2 changes: 1 addition & 1 deletion chalice/deploy/swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _generate_route_method(self, view):
if view.api_key_required:
# When this happens we also have to add the relevant portions
# to the security definitions. We have to someone indicate
# this because this neeeds to be added to the global config
# this because this needs to be added to the global config
# file.
current.setdefault('security', []).append({'api_key': []})
if view.authorizer:
Expand Down
10 changes: 5 additions & 5 deletions chalice/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ def __init__(self, target_arn: str) -> None:
self._arn = target_arn

def _resource_match(self, resource: str) -> bool:
# Arn matching supports two special case characetrs that are not
# Arn matching supports two special case characters that are not
# escapable. * represents a glob which translates to a non-greedy
# match of any number of characters. ? which is any single character.
# These are easy to translate to a regex using .*? and . respectivly.
# These are easy to translate to a regex using .*? and . respectively.
escaped_resource = re.escape(resource)
resource_regex = escaped_resource.replace(r'\?', '.').replace(
r'\*', '.*?')
Expand Down Expand Up @@ -279,7 +279,7 @@ def __init__(self, function_name: str, memory_size: int,
# documentation:
# Information about the client application and device when invoked
# through the AWS Mobile SDK, it can be null.
# Chalice local doens't need to set these since they are specifically
# Chalice local does't need to set these since they are specifically
# for the mobile SDK.
self.identity = None
self.client_context = None
Expand Down Expand Up @@ -330,7 +330,7 @@ def authorize(self,
# users to test their code local with a different cognito
# authorization flow.
warnings.warn(
'%s for machine-to-machine communicaiton is not '
'%s for machine-to-machine communication is not '
'supported in local mode. All requests made against '
'a route will be authorized to allow local testing.'
% authorizer.__class__.__name__
Expand Down Expand Up @@ -680,7 +680,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
for reuse. In the single threaded model this causes Chalice local to become
unresponsive to all clients other than that browser socket. Even sending a
header requesting that the client close the connection is not good enough,
the browswer will simply open another one and sit on it.
the browser will simply open another one and sit on it.
"""

daemon_threads = True
Expand Down
2 changes: 1 addition & 1 deletion chalice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def remove_stage_from_deployed_values(key: str, filename: str) -> None:
with open(filename, 'r') as f:
final_values = json.load(f)
except IOError:
# If there is no file to delete from, then this funciton is a noop.
# If there is no file to delete from, then this function is a noop.
return

try:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ Websockets

.. class:: WebsocketEvent()

Event object event that is passed as the sole arugment to any handler
Event object event that is passed as the sole argument to any handler
function decorated with one of the three websocket related handlers:
``on_ws_connect``, ``on_ws_disconnect``, ``on_ws_message``.

Expand Down Expand Up @@ -1812,7 +1812,7 @@ Testing

.. attribute:: headers

A dictionary of HTTP headers in the resopnse.
A dictionary of HTTP headers in the response.

.. attribute:: status_code

Expand Down
2 changes: 1 addition & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ APIs, and decorators to connect various AWS event sources to
Lambda functions. It then can integrate with AWS SAM by offloading
the deployment to AWS CloudFormation.

**Q: How does Chalice compare to other similiar frameworks?**
**Q: How does Chalice compare to other similar frameworks?**

The biggest difference between Chalice and other frameworks is that Chalice
is focused on using a familiar, decorator-based API to write serverless
Expand Down
2 changes: 1 addition & 1 deletion docs/source/topics/cd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Now we're ready to deploy our CloudFormation template using the AWS CLI. Be
sure to replace the ``GithubOwner`` and ``GithubRepoName`` with your own
values for your GitHub repository. You'll also need to specify the
``GithubRepoSecretId`` and ``GithubRepoSecretJSONKey`` if you used values
other than the default vaues of ``GithubRepoAccess`` and ``OAuthToken`` when
other than the default values of ``GithubRepoAccess`` and ``OAuthToken`` when
creating your secret in Secrets Manager.

::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/topics/packaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Environment Variables

As part of the packaging and deployment process, Chalice will import your
``app.py`` file. This will result in any top level module code being
executed. This can sometimes have undesireable behavior.
executed. This can sometimes have undesirable behavior.
When running any Chalice CLI commands, a ``AWS_CHALICE_CLI_MODE`` environment
variable is set. You can check if this env var is set in your ``app.py``
if you have code that you don't want to run whenever your app is packaged
Expand Down
2 changes: 1 addition & 1 deletion docs/source/topics/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ To test this, we'll combine the botocore stubber and the Chalice test client:
In the testcase above, we first tell the stubber what API call we're expecting,
along with the parameters we'll send and the response we expect back from the
Rekognition service. Next we use the ``with stub:`` line to activate our stubs.
This also ensures that when our test exits that we'll deactive the stubs for
This also ensures that when our test exits that we'll deactivate the stubs for
this client. Now we the ``client.lambda_.invoke`` method is called, our
stubbed client will return the preconfigured response data instead of making
an actual API call to the Rekognition service.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/upgrading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ transition to this new model, the following changes were made:
Previously it would look for a file named ``.chalice/policy.json``.
You can also explicitly set this value to
In order to ease transition, chalice will check for a
``.chalice/policy.json`` file when depoying to the ``dev`` stage.
``.chalice/policy.json`` file when deploying to the ``dev`` stage.
Support for ``.chalice/policy.json`` will be removed in future
versions of chalice and users are encouraged to switch to the
stage specific ``.chalice/policy-<stage-name>.json`` files.
Expand Down Expand Up @@ -369,7 +369,7 @@ Any of other deployed values that were needed (for example the
API Gateway rest API id) was dynamically queried by assuming the
resource names matches the app name. In this version of chalice,
a separate ``.chalice/deployed.json`` file is written on every
deployement which contains all the resources that have been created.
deployment which contains all the resources that have been created.
While this should be a transparent change, you may noticed
issues if you run commands such as ``chalice url`` and ``chalice logs``
without first deploying. To fix this issue, run ``chalice deploy``
Expand Down
2 changes: 1 addition & 1 deletion scripts/gh-page-docs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ rsync -av --delete --exclude '.git' build/html/ ${CHECKOUT_DIR}/
# paths.
touch ${CHECKOUT_DIR}/.nojekyll

echo "Commiting docs."
echo "Committing docs."
cd ${CHECKOUT_DIR}
git add -A .
git commit -am "Updating generated documentation"
Expand Down
6 changes: 3 additions & 3 deletions tests/aws/test_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ def find_skips_in_seq(numbers):


def test_websocket_redployment_does_not_lose_messages(smoke_test_app_ws):
# This test is to check if one persistant connection is affected by an app
# redeployment. A connetion is made to the app, and a sequence of numbers
# This test is to check if one persistent connection is affected by an app
# redeployment. A connection is made to the app, and a sequence of numbers
# is sent over the socket and written to a DynamoDB table. The app is
# redeployed in a seprate thread. After the redeployment we wait a
# redeployed in a separate thread. After the redeployment we wait a
# second to ensure more numbers have been sent. Finally we inspect the
# DynamoDB table to ensure there are no gaps in the numbers we saw on the
# server side, and that the first and last number we sent is also present.
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_awsclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ def test_create_function_propagates_unknown_error(self, stubbed_session):
stubbed_session.activate_stubs()
awsclient = TypedAWSClient(stubbed_session, mock.Mock(spec=time.sleep))
with pytest.raises(LambdaClientError) as excinfo:
awsclient.create_function('name', 'myarn', b'foo', 'pytohn2.7',
awsclient.create_function('name', 'myarn', b'foo', 'python2.7',
'app.app')
assert isinstance(
excinfo.value.original_error, botocore.exceptions.ClientError)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_can_accept_multiple_connections(config, sample_app,
local_server_factory):
# When a GET request is made to Chalice from a browser, it will send the
# connection keep-alive header in order to hold the connection open and
# reuse it for subsequent requests. If the conncetion close header is sent
# reuse it for subsequent requests. If the connection close header is sent
# back by the server the connection will be closed, but the browser will
# reopen a new connection just in order to have it ready when needed.
# In this case, since it does not send any content we do not have the
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def test_does_ignore_include(self, tmpdir, pip_runner):
assert 'bar' not in installed_packages

def test_does_ignore_scripts(self, tmpdir, pip_runner):
# Make sure the wheel isntaller does not copy the scripts directory
# Make sure the wheel installer does not copy the scripts directory
# up to the root.
reqs = ['foo']
pip, runner = pip_runner
Expand Down Expand Up @@ -990,7 +990,7 @@ def test_can_create_app_packager_with_no_autogen(tmpdir, stubbed_session):
assert 'sam.json' in contents


def test_can_create_app_packager_with_yaml_extention(tmpdir, stubbed_session):
def test_can_create_app_packager_with_yaml_extension(tmpdir, stubbed_session):
appdir = _create_app_structure(tmpdir)

outdir = tmpdir.mkdir('outdir')
Expand Down Expand Up @@ -1094,7 +1094,7 @@ def test_does_error_code_propagate(self):
rc, _, err = pip.main(['badcommand'])
assert rc != 0
# Don't want to depend on a particular error message from pip since it
# may change if we pin a differnet version to Chalice at some point.
# may change if we pin a different version to Chalice at some point.
# But there should be a non-empty error message of some kind.
assert err != b''

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/deploy/test_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_lambda_client_error_wording_for_update(self):

def test_gives_where_and_suggestion_for_too_large_deployment_error(self):
too_large_error = DeploymentPackageTooLargeError(
Exception('Too large of deployment pacakge'),
Exception('Too large of deployment package'),
context=LambdaErrorContext(
function_name='foo',
client_method_name='create_function',
Expand All @@ -156,15 +156,15 @@ def test_gives_where_and_suggestion_for_too_large_deployment_error(self):
'ERROR - While sending your chalice handler code to '
'Lambda to create function \n"foo"' in deploy_error_msg
)
assert 'Too large of deployment pacakge' in deploy_error_msg
assert 'Too large of deployment package' in deploy_error_msg
assert (
'To avoid this error, decrease the size of your chalice '
'application ' in deploy_error_msg
)

def test_include_size_context_for_too_large_deployment_error(self):
too_large_error = DeploymentPackageTooLargeError(
Exception('Too large of deployment pacakge'),
Exception('Too large of deployment package'),
context=LambdaErrorContext(
function_name='foo',
client_method_name='create_function',
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_can_compares_with_identity_not_equality(self):
deps = dep_builder.build_dependencies(app)
assert deps == [first_leaf, first_parent, second_leaf, second_parent]

def test_no_duplicate_depedencies(self):
def test_no_duplicate_dependencies(self):
leaf = LeafResource(name='leaf')
second_parent = FooResource(name='second', leaf=leaf)
first_parent = FooResource(name='first', leaf=[leaf, second_parent])
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/deploy/test_swagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def test_can_custom_resource_policy(sample_app, swagger_gen):
"Action": "execute-api:Invoke",
"Resource": [
"arn:aws:execute-api:*:*:*",
"arn:aws:exceute-api:*:*:*/*"
"arn:aws:execute-api:*:*:*/*"
],
"Condition": {
"StringEquals": {
Expand All @@ -861,7 +861,7 @@ def test_can_custom_resource_policy(sample_app, swagger_gen):
'Principal': '*',
'Resource': [
'arn:aws:execute-api:*:*:*',
"arn:aws:exceute-api:*:*:*/*"]
"arn:aws:execute-api:*:*:*/*"]
}]
}

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ def test_can_explicitly_set_debug_false_in_initializer():
assert test_app.log.getEffectiveLevel() == logging.ERROR


def test_can_set_debug_mode_in_initialzier():
def test_can_set_debug_mode_in_initializer():
test_app = app.Chalice('logger-test-3', debug=True)
assert test_app.debug is True
assert test_app.log.getEffectiveLevel() == logging.DEBUG
Expand Down Expand Up @@ -3177,7 +3177,7 @@ def disconnect_handler(event):

with pytest.raises(ValueError) as e:
@demo.on_ws_disconnect()
def disconncet_handler_2(event):
def disconnect_handler_2(event):
pass

assert str(e.value) == (
Expand Down Expand Up @@ -3658,7 +3658,7 @@ def handler(event):
{'name': 'bp_handler', 'bucket': 'mybucket'},
]

def test_blueprint_gets_middlware_added(self):
def test_blueprint_gets_middleware_added(self):
demo = app.Chalice('app-name')
bp = app.Blueprint('bpmiddleware')
called = []
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, times):
def time(self):
"""Get the next time.

This is for mimicing the Clock interface used in local.
This is for mimicking the Clock interface used in local.
"""
time = self._times.pop(0)
return time
Expand Down Expand Up @@ -1051,7 +1051,7 @@ def test_does_authorize_unsupported_cognito_token(self,
warning = recorded_warnings[0]
assert issubclass(warning.category, UserWarning)
assert ('CognitoUserPoolAuthorizer for machine-to-machine '
'communicaiton is not supported in local mode. All requests '
'communication is not supported in local mode. All requests '
'made against a route will be authorized to allow local '
'testing.') in str(warning.message)

Expand Down