Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(governance): add pre-configured dev environment with GitPod.io to ease contributions #1403

Merged
merged 11 commits into from
Aug 3, 2022
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
10 changes: 10 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
image:
file: .gitpod.Dockerfile
tasks:
- init: make dev-gitpod
vscode:
extensions:
heitorlessa marked this conversation as resolved.
Show resolved Hide resolved
- 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
28 changes: 16 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

<!-- Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

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%2C+triage&template=rfc.md&title=RFC%3A+) 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

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:

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ dev:
poetry install --extras "pydantic"
pre-commit install

dev-gitpod:
pip install --upgrade pip poetry
heitorlessa marked this conversation as resolved.
Show resolved Hide resolved
poetry install --extras "pydantic"
pre-commit install

format:
poetry run isort aws_lambda_powertools tests examples
poetry run black aws_lambda_powertools tests examples
Expand Down