From 4a24cb60f2156672d91fe75f7f371d776ab0f629 Mon Sep 17 00:00:00 2001 From: Bertram Truong Date: Sun, 17 Mar 2024 01:09:30 +1100 Subject: [PATCH 01/10] Update README.md (#1226) Co-authored-by: monkut Co-authored-by: javulticat Co-authored-by: hellno --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cd5c79b87..e4127f606 100644 --- a/README.md +++ b/README.md @@ -448,6 +448,7 @@ You can also invoke interpretable Python 3.8/3.9/3.10/3.11/3.12 strings directly $ zappa invoke production "print(1 + 2 + 3)" --raw For instance, it can come in handy if you want to create your first `superuser` on a RDS database running in a VPC (like Serverless Aurora): + $ zappa invoke staging "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('username', 'email', 'password')" --raw ### Django Management Commands From 047c9a8c1d76080cf99540b2ea7d5d3ac7edf172 Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 3 Apr 2024 13:44:08 +0000 Subject: [PATCH 02/10] Enable live runs of repo maintenence job via manual trigger (#1300) * Enable live runs of repo maintenence job via manual trigger * Allow config options to be set on manual runs of job --- .github/workflows/maintenance.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 7786ecb16..d36df2096 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -2,8 +2,17 @@ name: Perform automated repository maintenance on: workflow_dispatch: - schedule: - - cron: "0 */2 * * *" + inputs: + dry-run: + description: "Dry-run" + type: boolean + operations: + description: "Max number of operations per run" + type: number +# Out of an abundance of caution, disabling automatic execution for now +# TODO: Reschedule job once expected behavior is consistently observed +# schedule: +# - cron: "0 */2 * * *" jobs: cleanup-inactive: @@ -17,6 +26,7 @@ jobs: total_days: 100 inactive_label: "no-activity" closed_label: "auto-closed" + default_operations: ${{ inputs.dry-run && 1000 || 30 }} steps: - name: Cleanup inactive issues/PRs uses: actions/stale@v9 @@ -36,6 +46,6 @@ jobs: labels-to-add-when-unstale: "needs-review" ascending: true enable-statistics: true - # DEBUG OPTIONS - debug-only: true - operations-per-run: 1000 + # CONFIG OPTIONS + debug-only: ${{ inputs.dry-run }} + operations-per-run: ${{ inputs.operations || env.default_operations }} From eb7d376819877f451f0a662b69678985caad794d Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 3 Apr 2024 14:53:58 +0000 Subject: [PATCH 03/10] Add permission needed for actions/stale statefulness (#1321) --- .github/workflows/maintenance.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index d36df2096..9f9a3da90 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -18,6 +18,7 @@ jobs: cleanup-inactive: runs-on: ubuntu-latest permissions: + actions: write issues: write pull-requests: write env: From c74a861693254db44f6811e6a598006bbb19504f Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 3 Apr 2024 19:29:07 +0000 Subject: [PATCH 04/10] Schedule automated repo maintenance to run autonomously (#1322) --- .github/workflows/maintenance.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 9f9a3da90..097a3092c 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -9,10 +9,8 @@ on: operations: description: "Max number of operations per run" type: number -# Out of an abundance of caution, disabling automatic execution for now -# TODO: Reschedule job once expected behavior is consistently observed -# schedule: -# - cron: "0 */2 * * *" + schedule: + - cron: "0 */2 * * *" jobs: cleanup-inactive: @@ -27,7 +25,7 @@ jobs: total_days: 100 inactive_label: "no-activity" closed_label: "auto-closed" - default_operations: ${{ inputs.dry-run && 1000 || 30 }} + default_operations: ${{ inputs.dry-run && 1000 || 200 }} steps: - name: Cleanup inactive issues/PRs uses: actions/stale@v9 @@ -36,6 +34,7 @@ jobs: days-before-close: ${{ env.closing_days }} stale-issue-label: ${{ env.inactive_label }} close-issue-label: ${{ env.closed_label }} + exempt-all-milestones: true exempt-issue-labels: "needs-review,planned,in-progress" stale-issue-message: "Hi there! Unfortunately, this Issue has not seen any activity for at least ${{ env.inactive_days }} days. If the Issue is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please comment within the next ${{ env.closing_days }} days if you wish to keep it open. Otherwise, it will be automatically closed." close-issue-message: "Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least ${{ env.total_days }} days. If the Issue is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please [open a new Issue](https://github.com/zappa/Zappa/issues/new)." From 2efe244d631cad84d24d6429628144d0bc5b263d Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 3 Apr 2024 20:17:55 +0000 Subject: [PATCH 05/10] Run repo maintenance every 30 mins instead of every 2 hrs to increase throughput (#1323) --- .github/workflows/maintenance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 097a3092c..cd2abbd60 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -10,7 +10,7 @@ on: description: "Max number of operations per run" type: number schedule: - - cron: "0 */2 * * *" + - cron: "*/30 * * * *" jobs: cleanup-inactive: From 4b4ba4c370ec62303f78b57e7a54e10afc52b4e0 Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 10 Apr 2024 17:05:02 +0000 Subject: [PATCH 06/10] New fully automated process to build/tag/release (GitHub) & publish (PyPi) versions (#1324) --- .github/workflows/cd.yaml | 29 --------- .github/workflows/cd.yml | 87 +++++++++++++++++++++++++++ .github/workflows/{ci.yaml => ci.yml} | 0 3 files changed, 87 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/cd.yaml create mode 100644 .github/workflows/cd.yml rename .github/workflows/{ci.yaml => ci.yml} (100%) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml deleted file mode 100644 index 99875adde..000000000 --- a/.github/workflows/cd.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: CD - -on: # yamllint disable-line rule:truthy - # From documentation: - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore - # on.push.tags: If you define only tags/tags-ignore or only branches/branches-ignore, the workflow won't run for events affecting the undefined Git ref. - # - # This workflow will only run when a tag matching the criteria is pushed - push: - tags: ["v?[0-9]+.[0-9]+.[0-9]+"] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Checkout Code Repository - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Install `pypa/build` - run: python -m pip install build - - name: Build sdist and wheel - run: python -m build --sdist --wheel --outdir ./dist/ - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 000000000..3b03159fc --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,87 @@ +name: CD + +on: + workflow_dispatch: + inputs: + dry-run: + type: boolean + description: "Dry-run" + required: true + default: true + version: + description: "SemVer string for new version" + required: true + + +jobs: + build: + runs-on: ubuntu-latest + environment: + name: protected + steps: + - name: Checkout code repository + uses: actions/checkout@v4 + - name: Build Python packages + uses: hynek/build-and-inspect-python-package@v2 + + tag: + runs-on: ubuntu-latest + environment: + name: protected + permissions: + contents: write + outputs: + new_tag: ${{ steps.tag_version.outputs.new_tag }} + changelog: ${{ steps.tag_version.outputs.changelog }} + steps: + - name: Checkout code repository + uses: actions/checkout@v4 + - name: Tag new version + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ github.token }} + default_bump: "false" + custom_tag: ${{ inputs.version }} + tag_prefix: "" + dry_run: ${{ inputs.dry-run }} + + release: + needs: + - build + - tag + runs-on: ubuntu-latest + environment: + name: protected + permissions: + contents: write + steps: + - name: Download built Python packages + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - name: Create GitHub Release with Python packages + uses: ncipollo/release-action@v1 + with: + artifacts: dist/* + tag: ${{ needs.tag.outputs.new_tag }} + body: ${{ needs.tag.outputs.changelog }} + draft: ${{ inputs.dry-run }} + + publish: + needs: release + runs-on: ubuntu-latest + if: ${{ ! inputs.dry-run }} + environment: + name: publish + permissions: + id-token: write + steps: + - name: Download built Python package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml From b2723612a951e1a07f0e46ea9199e2612525039b Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 10 Apr 2024 17:37:50 +0000 Subject: [PATCH 07/10] 'find_module' removed in Py3.12; use 'find_spec' instead (#1320) --- zappa/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zappa/cli.py b/zappa/cli.py index a89f9816a..b8f2abf4b 100755 --- a/zappa/cli.py +++ b/zappa/cli.py @@ -2141,7 +2141,7 @@ def callback(self, position): working_dir = os.getcwd() working_dir_importer = pkgutil.get_importer(working_dir) - module_ = working_dir_importer.find_module(mod_name).load_module(mod_name) + module_ = working_dir_importer.find_spec(mod_name).loader.load_module(mod_name) except (ImportError, AttributeError): try: # Callback func might be in virtualenv @@ -2844,7 +2844,7 @@ def execute_prebuild_script(self): working_dir = os.getcwd() working_dir_importer = pkgutil.get_importer(working_dir) - module_ = working_dir_importer.find_module(mod_name).load_module(mod_name) + module_ = working_dir_importer.find_spec(mod_name).loader.load_module(mod_name) except (ImportError, AttributeError): try: # Prebuild func might be in virtualenv From 3b823d944ba7bfe4ac24a5ad918e46f018339484 Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 10 Apr 2024 19:01:53 +0000 Subject: [PATCH 08/10] Remove deprecated zappa.async module (#1326) --- zappa/async.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 zappa/async.py diff --git a/zappa/async.py b/zappa/async.py deleted file mode 100644 index ff48d6a2d..000000000 --- a/zappa/async.py +++ /dev/null @@ -1,8 +0,0 @@ -import warnings - -from .asynchronous import * # noqa: F401 - -warnings.warn( - 'Module "zappa.async" is deprecated; please use "zappa.asynchronous" instead.', - category=DeprecationWarning, -) From 0de680cecbad750544bc0f142ea7248d5e7de412 Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 10 Apr 2024 19:38:59 +0000 Subject: [PATCH 09/10] Improve quality of auto-generated release notes (#1327) --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3b03159fc..3b550c9f1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -66,7 +66,7 @@ jobs: with: artifacts: dist/* tag: ${{ needs.tag.outputs.new_tag }} - body: ${{ needs.tag.outputs.changelog }} + generateReleaseNotes: true draft: ${{ inputs.dry-run }} publish: From a38058b1bc48407d4515d77db5c2cd60ea73e25a Mon Sep 17 00:00:00 2001 From: javulticat Date: Wed, 10 Apr 2024 20:02:07 +0000 Subject: [PATCH 10/10] Prepare for version 0.59.0 release (#1328) --- CHANGELOG.md | 4 ++++ README.md | 2 +- setup.py | 4 +++- zappa/__init__.py | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c46376c3..7e661da5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Zappa Changelog +## 0.59.0 + +See [release notes](https://github.com/zappa/Zappa/releases/tag/0.59.0) + ## 0.58.0 * Add Python 3.11 support (#1262) diff --git a/README.md b/README.md index e4127f606..de52ee815 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Zappa - Serverless Python -[![CI](https://github.com/zappa/Zappa/actions/workflows/ci.yaml/badge.svg?branch=master&event=push)](https://github.com/zappa/Zappa/actions/workflows/ci.yaml) +[![CI](https://github.com/zappa/Zappa/actions/workflows/ci.yml/badge.svg?branch=master&event=push)](https://github.com/zappa/Zappa/actions/workflows/ci.yml) [![Coverage](https://img.shields.io/coveralls/zappa/Zappa.svg)](https://coveralls.io/github/zappa/Zappa) [![PyPI](https://img.shields.io/pypi/v/Zappa.svg)](https://pypi.python.org/pypi/zappa) [![Slack](https://img.shields.io/badge/chat-slack-ff69b4.svg)](https://zappateam.slack.com/) diff --git a/setup.py b/setup.py index ec43577a6..5379cddac 100755 --- a/setup.py +++ b/setup.py @@ -30,9 +30,11 @@ description="Server-less Python Web Services for AWS Lambda and API Gateway", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/zappa/Zappa", + url="https://zappa.ws/zappa", author="Rich Jones", author_email="rich@openwatch.net", + maintainer="Alex DelVecchio", + maintainer_email="alex@zappa.ws", entry_points={ "console_scripts": [ "zappa=zappa.cli:handle", diff --git a/zappa/__init__.py b/zappa/__init__.py index c0c2676b8..0ad30b31d 100644 --- a/zappa/__init__.py +++ b/zappa/__init__.py @@ -30,4 +30,4 @@ def running_in_docker() -> bool: ) raise RuntimeError(err_msg) -__version__ = "0.58.0" +__version__ = "0.59.0"