Skip to content

Commit

Permalink
Merge branch 'zappa:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentGeode authored Apr 14, 2024
2 parents ca46adc + a38058b commit daddb5b
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 46 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/cd.yaml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
generateReleaseNotes: true
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
File renamed without changes.
18 changes: 14 additions & 4 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ name: Perform automated repository maintenance

on:
workflow_dispatch:
inputs:
dry-run:
description: "Dry-run"
type: boolean
operations:
description: "Max number of operations per run"
type: number
schedule:
- cron: "0 */2 * * *"
- cron: "*/30 * * * *"

jobs:
cleanup-inactive:
runs-on: ubuntu-latest
permissions:
actions: write
issues: write
pull-requests: write
env:
Expand All @@ -17,6 +25,7 @@ jobs:
total_days: 100
inactive_label: "no-activity"
closed_label: "auto-closed"
default_operations: ${{ inputs.dry-run && 1000 || 200 }}
steps:
- name: Cleanup inactive issues/PRs
uses: actions/stale@v9
Expand All @@ -25,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)."
Expand All @@ -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 }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
maintainer="Alex DelVecchio",
maintainer_email="[email protected]",
entry_points={
"console_scripts": [
"zappa=zappa.cli:handle",
Expand Down
2 changes: 1 addition & 1 deletion zappa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def running_in_docker() -> bool:
)
raise RuntimeError(err_msg)

__version__ = "0.58.0"
__version__ = "0.59.0"
8 changes: 0 additions & 8 deletions zappa/async.py

This file was deleted.

4 changes: 2 additions & 2 deletions zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,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
Expand Down Expand Up @@ -2857,7 +2857,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
Expand Down

0 comments on commit daddb5b

Please sign in to comment.