forked from zappa/Zappa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from tackle-io/zappa-master
Pull changes from Zappa/Zappa into our fork
- Loading branch information
Showing
65 changed files
with
6,765 additions
and
4,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
branches: ["master"] | ||
push: | ||
branches: ["master"] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.7, 3.8, 3.9] | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip${{ matrix.python }}-${{ hashFiles('requirements.txt') }} | ||
restore-keys: ${{ runner.os }}-pip${{ matrix.python }}- | ||
- name: Setup Virtualenv | ||
run: python -m venv .venv | ||
- name: Install | ||
run: source .venv/bin/activate && make requirements && python setup.py install | ||
- name: Lint | ||
run: source .venv/bin/activate && make flake black-check isort-check | ||
- name: Test | ||
run: source .venv/bin/activate && make tests | ||
- name: Upload Coverage | ||
run: .venv/bin/coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: py${{ matrix.python }} | ||
COVERALLS_PARALLEL: true | ||
|
||
coverage: | ||
needs: test | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
- name: Finalise Coverage | ||
run: pip3 install --upgrade coveralls && coveralls --service=github --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Contributing to Zappa | ||
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: | ||
|
||
- Reporting a bug | ||
- Discussing the current state of the code | ||
- Submitting a fix | ||
- Proposing new features | ||
- Becoming a maintainer | ||
|
||
## We Develop with Github | ||
We use github to host code, to track issues and feature requests, as well as accept pull requests. | ||
We actively welcome your pull requests: | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've added code that should be tested, add tests. | ||
3. If you've changed APIs, update the documentation. | ||
4. Ensure the test suite passes. | ||
5. Issue that pull request! | ||
|
||
## Any contributions you make will be under the MIT Software License | ||
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. | ||
|
||
## Report bugs using Github's [issues](https://github.com/zappa/Zappa/issues) | ||
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/zappa/Zappa/issues/new); it's that easy! | ||
|
||
## Write bug reports with detail, background, and sample code | ||
Here are two great examples: | ||
- [http://stackoverflow.com/q/12488905/180626](http://stackoverflow.com/q/12488905/180626) | ||
- [http://www.openradar.me/11905408](http://www.openradar.me/11905408) | ||
|
||
**Great Bug Reports** tend to have: | ||
|
||
- A quick summary and/or background | ||
- Steps to reproduce | ||
- Be specific! | ||
- Give sample code if you can | ||
- What you expected would happen | ||
- What actually happens | ||
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) | ||
|
||
People *love* thorough bug reports, not even kidding. | ||
|
||
## License | ||
By contributing, you agree that your contributions will be licensed under its MIT License. | ||
|
||
## References | ||
This document was adapted from the basic template for contributing guideliens by @briandk | ||
[Contributing to Transcriptase](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62). The template itself is based on the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
help: | ||
@echo 'Zappa Make Targets' | ||
@echo '-----------------------' | ||
@echo 'These targets are aimed at making development, testing, and building easier' | ||
@echo '' | ||
@echo 'Setup' | ||
@echo 'make clean: Remove the built files, local caches, mypy and coverage information' | ||
@echo 'make requirements: Generate requirements from requirements.in and install them to the current environment' | ||
@echo 'make build: Build the source and wheel' | ||
@echo '' | ||
@echo 'Linting' | ||
@echo 'make flake: Flake8 checking' | ||
@echo 'make mypy: Run static type checking for zappa and tests directories' | ||
@echo 'make isort: Sort imports' | ||
@echo 'make black: Format project code according to Black convention' | ||
@echo '' | ||
@echo 'Testing' | ||
@echo 'make tests: Run all project tests. Additional make targets exist for subsets of the tests. Inspect the Makefile for details' | ||
|
||
.PHONY: clean requirements build flake mypy isort black tests | ||
|
||
clean: | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
rm -rf .mypy_cache dist build *.egg-info | ||
rm -f .coverage | ||
|
||
requirements: | ||
pip install pipenv==2021.11.09 | ||
pipenv lock | ||
pipenv sync --dev | ||
|
||
build: clean requirements-install | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
|
||
mypy: | ||
mypy --show-error-codes --pretty --ignore-missing-imports --strict zappa tests | ||
|
||
black: | ||
black . | ||
|
||
black-check: | ||
black . --check | ||
@echo "If this fails, simply run: make black" | ||
|
||
isort: | ||
isort . --profile=black | ||
|
||
isort-check: | ||
isort --check . --profile=black | ||
|
||
flake: | ||
flake8 zappa --count --select=E9,F63,F7,F82 --show-source --statistics | ||
flake8 zappa --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
|
||
test-docs: | ||
nosetests tests/tests_docs.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
test-handler: | ||
nosetests tests/test_handler.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
test-middleware: | ||
nosetests tests/tests_middleware.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
test-placebo: | ||
nosetests tests/tests_placebo.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
test-async: | ||
nosetests tests/tests_async.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
test-general: | ||
nosetests tests/tests.py --with-coverage --cover-package=zappa --with-timer | ||
|
||
tests: clean test-docs test-handler test-middleware test-placebo test-async test-general |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
black = "*" | ||
boto3-stubs = "*" | ||
coveralls = "*" | ||
Django = "<4" | ||
django-stubs = "*" | ||
flake8 = "*" | ||
Flask = "*" | ||
isort = "*" | ||
mock = "*" | ||
mypy = "*" | ||
nose = "*" | ||
nose-timer = "*" | ||
pipenv = "==2021.11.09" | ||
|
||
[packages] | ||
argcomplete = "*" | ||
boto3 = ">=1.17.28" | ||
durationpy = "*" | ||
future = "*" | ||
hjson = "*" | ||
jmespath = "*" | ||
kappa = "==0.6.0" | ||
pip = ">=9.0.1" | ||
# Workaround until tests are updated to work with 'placebo' 0.10 | ||
# Move to 'dev-packages' when unpinned | ||
placebo = "<0.10" | ||
python-dateutil = "*" | ||
python-slugify = "*" | ||
PyYAML = "*" | ||
# previous versions don't work with urllib3 1.24 | ||
requests = ">=2.20.0" | ||
six = "*" | ||
toml = "*" | ||
tqdm = "*" | ||
troposphere = ">=3.0" | ||
Werkzeug = "*" | ||
wheel = "*" | ||
wsgi-request-logger = "*" | ||
|
||
[pipenv] | ||
# Required for 'black' since all of its release tags contain 'b' | ||
allow_prereleases = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import logging | ||
|
||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
logging.basicConfig() | ||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
|
||
@app.route('/', methods=['GET', 'POST']) | ||
|
||
@app.route("/", methods=["GET", "POST"]) | ||
def lambda_handler(event=None, context=None): | ||
logger.info('Lambda function invoked index()') | ||
logger.info("Lambda function invoked index()") | ||
|
||
return "Flask says Hello!!" | ||
|
||
return 'Flask says Hello!!' | ||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
app.run(debug=True) |
Oops, something went wrong.