Skip to content

Commit

Permalink
add new templates & contribution guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatkj committed Feb 9, 2024
1 parent 9d79024 commit d6715ea
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 44 deletions.
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Bug Report
description: Report a bug or unexpected behavior in typed_configparser
labels: [bug, pending]

body:

- type: markdown
attributes:
value: Thank you for contributing to typed_configparser!

- type: textarea
id: description
attributes:
label: Description
description: |
Please explain what you're seeing and what you would expect to see.

Please provide as much detail as possible to make understanding and solving your problem as quick as possible.

validations:
required: true

- type: textarea
id: example
attributes:
label: Example Code
description: >
If applicable, please add a self-contained,
[minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example)
demonstrating the bug.

placeholder: |
from typed_configparser import ConfigParser

...

render: Python

- type: textarea
id: version
attributes:
label: Python, typed_configparser & OS Version
description: |
Which version of Python & typed_configparser are you using, and which Operating System?

Please run the following command for the version and copy the output below:

```bash
python -c "import typed_configparser; print(typed_configparser.__version__)"
```

render: Text
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ask a Question
url: "https://github.com/ajatkj/typed_configparser/discussions/new?category=q-a"
about: Ask a question about how to use typed_configparser using github discussions
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Feature Request
description: 'Suggest a new feature for typed_configparser'
labels: [feature request]

body:

- type: markdown
attributes:
value: Thank you for contributing to typed_configparser!

- type: checkboxes
id: searched
attributes:
label: Initial Checks
description: |
Just a few checks to make sure you need to create a feature request.
options:
- label: I have searched Google & GitHub for similar requests and couldn't find anything
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Please give as much detail as possible about the feature you would like to suggest.

You might like to add:
* A demo of how code might look when using the feature
* Your use case(s) for the feature

validations:
required: true
117 changes: 116 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,116 @@
Coming soon
# Contributing

I'd love you to contribute to typed_configparser!
zw

## Issues

Questions, feature requests and bug reports are all welcome as [discussions or issues](https://github.com/ajatkj/typed_configparser/issues/new/choose).

To make it as simple as possible for us to help you, please include the output of the following call in your issue:

```bash
python -c "import typed_configparser; print(typed_configparser.__version__)"
```

## Pull Requests

It should be extremely simple to get started and create a Pull Request.

Unless your change is trivial (typo, etc.), please create an issue to discuss the change before creating a pull request.

To make contributing as easy and fast as possible, you'll want to run tests and linting locally.

## Prerequisites

You'll need the following prerequisites:

Any Python version between Python 3.8 and 3.12

- a virtual environment tool
- git
- pyenv & nox (to optionally test your changes on all versions of python)

## Installation and setup

Fork the repository on GitHub and clone your fork locally.

```sh
# Clone your fork and cd into the repo directory
git clone [email protected]:<your username>/typed_configparser.git
cd typed_configparser
```

## Install typed-configparser locally

```sh
# Create the virtual environment using your favourite tool
python3 -m venv env

# Activate the virtual environment
source env/bin/activate

# Install typed-configparser in your virtual environment
# This will install all development dependencies to help you get start
python3 -m pip install -r requirements.txt
```

## Check out a new branch and make your changes

Create a new branch for your changes.

```sh
# Checkout a new branch and make your changes
git checkout -b my-new-feature-branch
# Make your changes...
```

## Run tests and linting

Run tests and linting locally to make sure everything is working as expected.

```sh
# Run automated code formatting and linting
poe lint
# typed_configparser uses ruff for linting and formatting
# https://github.com/astral-sh/ruff

# Run tests and linting
poe test
# There are few commands set-up using poethepoet task manager.
# You can check list of all commands using `poe`
# https://github.com/nat-n/poethepoet

# Check test coverage
# Make sure test coverage is 100% else PR will fail in CI pipeline.
poe coverage
poe converage_report
```

## Run automation test on all python versions

You can optionally run tests and linting on all python versions from 3.8 to 3.12 to make sure code is compliant across all supported python versions.
If you don't do this, any errors will be caught in the PR check phase.

```sh
# Install pyenv using https://github.com/pyenv/pyenv?tab=readme-ov-file#installation
# Install nox using https://nox.thea.codes/en/stable/
# You can either install it globally or using pipx (do not install it in project virtual environment)

# Install all supported python versions using pyenv
pyenv install 3.8 && pyenv install 3.9 && pyenv install 3.10 && pyenv install 3.11 && pyenv install 3.12

# Go to project root and set pyenv global environment (do not activate project virtual environment)
pyenv global 3.8 3.9 3.10 3.11 3.12

# Run nox
nox
```

## Commit and push your changes

Commit your changes, push your branch to GitHub, and create a pull request.

Please follow the pull request template and fill in as much information as possible. Link to any relevant issues and include a description of your changes.

When your pull request is ready for review, add a comment with the message "please review" and we'll take a look as soon as we can.

0 comments on commit d6715ea

Please sign in to comment.