From 7c4eb7cf674fac714fc374ac3229f3298dec1a35 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 01:18:09 +0100 Subject: [PATCH 01/11] chore(dev): adding gitpod support --- .gitpod.Dockerfile | 10 ++++++++++ .gitpod.yml | 11 +++++++++++ Makefile | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000000..291f6a328c6 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,10 @@ +# See here all gitpod images available: https://hub.docker.com/r/gitpod/workspace-python-3.10/tags +# Current python version: 3.10.5 +FROM gitpod/workspace-python-3.10@sha256:8a7ad4f0bbaa281a36cf2a87b772354638a14d7383f0a755b9ea32596ee99632 + +WORKDIR /app +ADD . /app + +# Installing pre-commit as system package and not user package. Git needs this to execute pre-commit hooks. +RUN export PIP_USER=no +RUN python3 -m pip install pre-commit \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..ff7c9996b4d --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,11 @@ +image: + file: .gitpod.Dockerfile +tasks: + - init: make dev-gitpod +vscode: + extensions: + - ms-python.python + - littlefoxteam.vscode-python-test-adapter + - ms-azuretools.vscode-docker + - davidanson.vscode-markdownlint + - bungcip.better-toml \ No newline at end of file diff --git a/Makefile b/Makefile index e4f908614a6..94f9fc975b8 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,11 @@ dev: poetry install --extras "pydantic" pre-commit install +dev-gitpod: + pip install --upgrade pip poetry + poetry install --extras "pydantic" + pre-commit install + format: poetry run isort aws_lambda_powertools tests examples poetry run black aws_lambda_powertools tests examples From 9a4efca617368ac26e92c63b398f023d9c13335b Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 01:19:15 +0100 Subject: [PATCH 02/11] chore(docs): adding gitpod badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 81cd3f3ce7f..f40b4525406 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ![Build](https://github.com/awslabs/aws-lambda-powertools/workflows/Powertools%20Python/badge.svg?branch=master) [![codecov.io](https://codecov.io/github/awslabs/aws-lambda-powertools-python/branch/develop/graphs/badge.svg)](https://app.codecov.io/gh/awslabs/aws-lambda-powertools-python) ![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.6%20|%203.7|%203.8|%203.9&color=blue?style=flat-square&logo=python) ![PyPI version](https://badge.fury.io/py/aws-lambda-powertools.svg) ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-powertools) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) A suite of Python utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. (AWS Lambda Powertools [Java](https://github.com/awslabs/aws-lambda-powertools-java) and [Typescript](https://github.com/awslabs/aws-lambda-powertools-typescript) is also available). From 7959b1445cb3ad1437bead98fa9a054ab0987e4b Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 01:28:26 +0100 Subject: [PATCH 03/11] chore(docs): adding gitpod section to CONTRIBUTING.md --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 563372a53d7..a17372b4482 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,8 @@ To send us a pull request, please follow these steps: 5. Send us a pull request with a [conventional semantic title](https://github.com/awslabs/aws-lambda-powertools-python/pull/67), and answering any default questions in the pull request interface. 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. +Optionally you can use [Gitpod](https://gitpod.io/) to have a pre-configured dev environment. If you choose to use Gitpod, there is no need to install anything on your machine, as the environment will be pre-configured with all necessary dependencies. + GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). From c14944cf5f51094887b5ced4d8ba4b2416edfe4a Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 08:43:41 +0100 Subject: [PATCH 04/11] chore(dev): adding new lines at the end of the file --- .gitpod.Dockerfile | 2 +- .gitpod.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 291f6a328c6..d9f45e58e91 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -7,4 +7,4 @@ ADD . /app # Installing pre-commit as system package and not user package. Git needs this to execute pre-commit hooks. RUN export PIP_USER=no -RUN python3 -m pip install pre-commit \ No newline at end of file +RUN python3 -m pip install pre-commit diff --git a/.gitpod.yml b/.gitpod.yml index ff7c9996b4d..5ada492273c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -8,4 +8,4 @@ vscode: - littlefoxteam.vscode-python-test-adapter - ms-azuretools.vscode-docker - davidanson.vscode-markdownlint - - bungcip.better-toml \ No newline at end of file + - bungcip.better-toml From 102ba0fe96b5fa70501706ba208b2081d8508526 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 14:45:43 +0100 Subject: [PATCH 05/11] chore(dev): adding new lines at the end of the file --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index d9f45e58e91..1a7bca22dd2 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,6 +1,6 @@ # See here all gitpod images available: https://hub.docker.com/r/gitpod/workspace-python-3.10/tags # Current python version: 3.10.5 -FROM gitpod/workspace-python-3.10@sha256:8a7ad4f0bbaa281a36cf2a87b772354638a14d7383f0a755b9ea32596ee99632 +FROM gitpod/workspace-python-3.9@sha256:de87d4ebffe8daab2e8fef96ec20497ae4f39e8dcb9dec1483d0be61ea78e8cd WORKDIR /app ADD . /app From 065f35f84337f02747bde16f232da2f215558312 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 14:49:07 +0100 Subject: [PATCH 06/11] chore(dev): changed python version from 3.10.5 to 3.9.13 --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 1a7bca22dd2..6f285a6d47b 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,5 +1,5 @@ # See here all gitpod images available: https://hub.docker.com/r/gitpod/workspace-python-3.10/tags -# Current python version: 3.10.5 +# Current python version: 3.9.13 FROM gitpod/workspace-python-3.9@sha256:de87d4ebffe8daab2e8fef96ec20497ae4f39e8dcb9dec1483d0be61ea78e8cd WORKDIR /app From 57e5cb5f9b9529d9b3664bb4b66205c4e35227a0 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 14:52:14 +0100 Subject: [PATCH 07/11] chore(dev): added new vscode extensions to make the life easier --- .gitpod.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 5ada492273c..d831f067bdd 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,8 +4,16 @@ tasks: - init: make dev-gitpod vscode: extensions: - - ms-python.python - - littlefoxteam.vscode-python-test-adapter - - ms-azuretools.vscode-docker - - davidanson.vscode-markdownlint - - bungcip.better-toml + - ms-python.python # IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more. + - littlefoxteam.vscode-python-test-adapter # Run your Python tests in the Sidebar of Visual Studio Code + - ms-azuretools.vscode-docker # Makes it easy to create, manage, and debug containerized applications. + - davidanson.vscode-markdownlint # Markdown linting and style checking for Visual Studio Code + - bungcip.better-toml # Better TOML Language support + - oderwat.indent-rainbow # Makes indentation easier to read + - yzhang.markdown-all-in-one # Autoformat, better visualization, snippets, and markdown export to multiple fmts + - bierner.markdown-mermaid # Previews mermaid diagrams when previewing markdown + - matangover.mypy # Highlight mypy issues + - njpwerner.autodocstring # Auto-generate docsstrings in numpy format that we use + - netcorext.uuid-generator # For those helping create code snippets for docs + - streetsidesoftware.code-spell-checker # Spell checker that works with camel case too + - bungcip.better-toml # In case GitPod doesn't have support for TOML pyproject.toml From 8eeebdce2df3a65b764e4847ec53ad5e236097e9 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 14:52:51 +0100 Subject: [PATCH 08/11] chore(dev): fixed typo in python version --- .gitpod.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 6f285a6d47b..2b055dd9348 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,4 +1,4 @@ -# See here all gitpod images available: https://hub.docker.com/r/gitpod/workspace-python-3.10/tags +# See here all gitpod images available: https://hub.docker.com/r/gitpod/workspace-python-3.9/tags # Current python version: 3.9.13 FROM gitpod/workspace-python-3.9@sha256:de87d4ebffe8daab2e8fef96ec20497ae4f39e8dcb9dec1483d0be61ea78e8cd From dc5a258d8523b4ac1d85125273696a3aad2f1161 Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Tue, 2 Aug 2022 15:16:42 +0100 Subject: [PATCH 09/11] chore(docs): added gitpod badge in CONTRIBUTING and removed from README --- CONTRIBUTING.md | 2 ++ README.md | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a17372b4482..c39b4eafa2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,5 @@ +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) + # Contributing Guidelines Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional diff --git a/README.md b/README.md index f40b4525406..81cd3f3ce7f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ ![Build](https://github.com/awslabs/aws-lambda-powertools/workflows/Powertools%20Python/badge.svg?branch=master) [![codecov.io](https://codecov.io/github/awslabs/aws-lambda-powertools-python/branch/develop/graphs/badge.svg)](https://app.codecov.io/gh/awslabs/aws-lambda-powertools-python) ![PythonSupport](https://img.shields.io/static/v1?label=python&message=3.6%20|%203.7|%203.8|%203.9&color=blue?style=flat-square&logo=python) ![PyPI version](https://badge.fury.io/py/aws-lambda-powertools.svg) ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-powertools) -[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/from-referrer/) A suite of Python utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. (AWS Lambda Powertools [Java](https://github.com/awslabs/aws-lambda-powertools-java) and [Typescript](https://github.com/awslabs/aws-lambda-powertools-typescript) is also available). From 5ee89725ff2274ffff2af5dbca03cca5cc356eae Mon Sep 17 00:00:00 2001 From: Leandro Damascena Date: Wed, 3 Aug 2022 11:54:02 +0100 Subject: [PATCH 10/11] chore(docs): adding more details to CONTRIBUTING guide --- CONTRIBUTING.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c39b4eafa2b..83900a553ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,33 +17,33 @@ reported the issue. Please try to include as much information as you can. ## Contributing via Pull Requests -We are temporarily de-prioritizing and pausing external contributions until end of July 2022. You can read more here: https://github.com/awslabs/aws-lambda-powertools-python/issues/1076 - - +3. You open a [RFC issue](https://github.com/awslabs/aws-lambda-powertools-python/issues/new?assignees=&labels=RFC%2Ctriage&template=rfc.yml&title=RFC%3A+TITLE) to discuss any significant work - we would hate for your time to be wasted. ### Dev setup +Firstly, [fork the repository](https://github.com/awslabs/aws-lambda-powertools-python/fork). + +To setup your development environment, we recommend using our pre-configured Cloud environment: https://gitpod.io/#https://github.com/YOUR_USERNAME/aws-lambda-powertools-python. Replace YOUR_USERNAME with your GitHub username or organization so the Cloud environment can target your fork accordingly. + +Alternatively, you can use `make dev` within your local virtual environment. + To send us a pull request, please follow these steps: -1. Fork the repository. -2. Install dependencies in a virtual env with poetry, and pre-commit hooks: `make dev` -3. Create a new branch to focus on the specific change you are contributing e.g. `improv/logger-debug-sampling` -4. Run all tests, and code baseline checks: `make pr` +1. Create a new branch to focus on the specific change you are contributing e.g. `improv/logger-debug-sampling` +2. Run all tests, and code baseline checks: `make pr` - Git hooks will run linting and formatting while `make pr` run deep checks that also run in the CI process -4. Commit to your fork using clear commit messages. -5. Send us a pull request with a [conventional semantic title](https://github.com/awslabs/aws-lambda-powertools-python/pull/67), and answering any default questions in the pull request interface. -6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. - -Optionally you can use [Gitpod](https://gitpod.io/) to have a pre-configured dev environment. If you choose to use Gitpod, there is no need to install anything on your machine, as the environment will be pre-configured with all necessary dependencies. +3. Commit to your fork using clear commit messages. +4. Send us a pull request with a [conventional semantic title](https://github.com/awslabs/aws-lambda-powertools-python/pull/67), and answering any default questions in the pull request interface. +5. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). -#### Local documentation +### Local documentation You might find useful to run both the documentation website and the API reference locally while contributing: From e66f89a3b4563b8dfc7443cb3ada6d70d90d9a75 Mon Sep 17 00:00:00 2001 From: Heitor Lessa Date: Wed, 3 Aug 2022 12:58:55 +0200 Subject: [PATCH 11/11] chore: sync disclaimer wording for new contributions --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83900a553ac..bef5fa2052f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ Contributions via pull requests are much appreciated. Before sending us a pull r 1. You are working against the latest source on the **develop** branch. 2. You check existing open, and recently merged pull requests to make sure someone else hasn't addressed the problem already. -3. You open a [RFC issue](https://github.com/awslabs/aws-lambda-powertools-python/issues/new?assignees=&labels=RFC%2Ctriage&template=rfc.yml&title=RFC%3A+TITLE) to discuss any significant work - we would hate for your time to be wasted. +3. You open an [issue](https://github.com/awslabs/aws-lambda-powertools-python/issues/new/choose) before you begin any implementation. We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful. ### Dev setup