Skip to content
Merged
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
44 changes: 20 additions & 24 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "dev",
"image": "mcr.microsoft.com/devcontainers/python:3",
"features": {
"ghcr.io/devcontainers-extra/features/mise:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"hverlin.mise-vscode",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
"charliermarsh.ruff",
"ms-python.python"
]
}
},
"mounts": [
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind"
],
"postCreateCommand": "echo 'eval \"$(mise activate bash)\"' >> ~/.bashrc",
"forwardPorts": [
"8000:8000"
]
"name": "dev",
"image": "mcr.microsoft.com/devcontainers/python:3",
"features": {
"ghcr.io/devcontainers-extra/features/mise:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"hverlin.mise-vscode",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
"charliermarsh.ruff",
"ms-python.python"
]
}
},
"mounts": ["source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind"],
"postCreateCommand": "echo 'eval \"$(mise activate bash)\"' >> ~/.bashrc",
"forwardPorts": ["8000:8000"]
}
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github: amrabed
patreon:
custom: "https://paypal.me/amrabed"
patreon:
custom: "https://paypal.me/amrabed"
17 changes: 9 additions & 8 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
---
name: Bug report
about: Report a bug
title: ''
labels: 'bug'
assignees: ''

title: ""
labels: "bug"
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Run '...`

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
- OS: [e.g., MacOS 14]
- Template version:
- Python version:
- uv version:

- OS: [e.g., MacOS 14]
- Template version:
- Python version:
- uv version:

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Question
about: Ask a question about the project
title: ''
labels: 'question'
assignees: ''

title: ""
labels: "question"
assignees: ""
---

**Have you searched if your question has already been answered before? If not, please do that first**
Expand Down
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-->

## Pull Request Type

- [ ] Bug Fix
- [ ] Feature
- [ ] Optimization
Expand All @@ -15,6 +16,7 @@
- [ ] Dependency Update

## Summary

_Please replace this line with a brief description of the changes you've made_

## Related Issues
Expand All @@ -36,9 +38,11 @@ automatically close the issue.
_Please replace this line with instructions on how to test your changes_

## Submission Checklist

Before submitting a Pull Request, please ensure you've done the following:
<!-- - [ ] Read the [contributing guide](.github/CONTRIBUTING.md)
- [ ] Read the [code of conduct](.github/CODE_OF_CONDUCT.md) -->

- [ ] Created a small PR
- [ ] Tested your changes
- [ ] Used descriptive commit messages
Expand Down
52 changes: 26 additions & 26 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@

version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: weekly
day: friday
versioning-strategy: increase-if-necessary
groups:
dependencies:
applies-to: version-updates
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
day: friday
groups:
github-actions:
applies-to: version-updates
patterns:
- "*"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
day: friday
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: weekly
day: friday
versioning-strategy: increase-if-necessary
groups:
dependencies:
applies-to: version-updates
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
day: friday
groups:
github-actions:
applies-to: version-updates
patterns:
- "*"
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
day: friday
2 changes: 1 addition & 1 deletion .github/template.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
author: amrabed
author: amrabed
3 changes: 2 additions & 1 deletion .template/docs/reference.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# ${title_name}
::: templates.${name}.handler

::: templates.${name}.handler
1 change: 1 addition & 0 deletions .template/docs/template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ${title_name}

Template description for ${title_name}.

## Architecture
Expand Down
82 changes: 39 additions & 43 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"--tb=short"
],
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/cdk.out": true,
"**/.venv": true
},
"search.exclude": {
"**/__pycache__": true,
"**/.venv": true,
"**/cdk.out": true,
"**/node_modules": true,
"uv.lock": true
},
"editor.rulers": [
120
],
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": ["--tb=short"],
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true,
"**/cdk.out": true,
"**/.venv": true
},
"search.exclude": {
"**/__pycache__": true,
"**/.venv": true,
"**/cdk.out": true,
"**/node_modules": true,
"uv.lock": true
},
"editor.rulers": [120],
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
}
6 changes: 5 additions & 1 deletion AGENTS.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ mise run init --name="my-project" --description="My description" --author="Name"
- Deploy locally using LocalStack: copy `.env.local.example` to `.env.local` and set token from [app.localstack.cloud](https://app.localstack.cloud), then `mise run local:deploy <stack>` (alias `local <stack>`, `dl <stack>`).
- Destroy locally from LocalStack: `mise run local:destroy <stack>` (alias `Dl <stack>`).


## Testing Guidelines

- Use pytest, not unittest
Expand Down Expand Up @@ -185,20 +184,25 @@ if __name__ == "__main__":
```

### Data Models

- Always move all data models to a separate `models.py` file within the template directory.

### Event Types

- Always use AWS Lambda Powertools event types for parsing and type hinting incoming events.

### SQS Interactions

- Use a separate `queue.py` module with a `Queue` class to encapsulate all SQS interactions (initialization, publishing, etc.).

### Handler Structure

- Create a `Handler` class with a `handle_record` (or similar) method.
- Pass the `Handler` instance to the main Lambda entry point.
- Decorate handler methods with `@tracer.capture_method`.
- For batch events (SQS, DynamoDB Streams), use the Lambda Powertools `BatchProcessor`.
- For S3 events, manually iterate over records and raise an exception if any record fails to ensure the entire batch is retried by the S3 event source.

### Lambda Entry Point

- The main Lambda entry point should be named `main`.
Loading