diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000000..2b055dd9348 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,10 @@ +# 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 + +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 diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..d831f067bdd --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,19 @@ +image: + file: .gitpod.Dockerfile +tasks: + - init: make dev-gitpod +vscode: + extensions: + - 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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 563372a53d7..bef5fa2052f 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 @@ -15,31 +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 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 +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. +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: 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