Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raphaelkieling/devpair

Tool to make the pair programming easier
https://github.com/raphaelkieling/devpair

hacktoberfest pair programmming python tool

Last synced: 2 days ago
JSON representation

Tool to make the pair programming easier

Awesome Lists containing this project

README

        



## Dev Pair

[![Python Test](https://github.com/raphaelkieling/pair/actions/workflows/push.yml/badge.svg)](https://github.com/raphaelkieling/pair/actions/workflows/push.yml)
![PyPI Version](https://img.shields.io/pypi/v/devpair)
![Python Version](https://img.shields.io/pypi/pyversions/devpair)
[![Coverage Status](https://coveralls.io/repos/github/raphaelkieling/pair/badge.svg?branch=main)](https://coveralls.io/github/raphaelkieling/pair?branch=main)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/dc88a7a853dc4b11be21ab789bb05463)](https://www.codacy.com/gh/raphaelkieling/devpair/dashboard?utm_source=github.com&utm_medium=referral&utm_content=raphaelkieling/devpair&utm_campaign=Badge_Grade)

It's a tool to facilitate the remote pair programming session. Instead of make a lot of `git add, git commit, git push, git pull`, you can make it more quickly only running `devpair start ` to start coding and `devpair next` to send the code to another person.

Very useful for teams that like to make pair sessions often. If you never was a driver or a navigator feel free to read [here](https://martinfowler.com/articles/on-pair-programming.html) to have a context.

## Install

```sh
# If you have pip 🐍
pip install devpair
```

## Commands

- `devpair start

> We recommend to create some alias if you want, like: `dvs` to run `devpair start`, `dvn` to run `devpair next` and `dvd` to run `devpair done`.

## Example of use

```bash
# Dev A
main $ devpair start 10 # Will start the new branch with a 10 minutes timer
pair/main $ echo "hello" > welcome.txt
pair/main $ devpair next

# Dev B
main $ devpair start
pair/main $ cat welcome.txt # shows "hello"
pair/main $ echo " world" >> welcome.txt
pair/main $ devpair next

# Dev A
pair/main $ devpair start
pair/main $ cat welcome.txt # shows "hello world"
pair/main $ echo "!" >> welcome.txt
pair/main $ devpair done

main $ git commit -m "feat: created hello world feature"
main $ git push

# Dev B
pair/main $ devpair done # just to come back to the original branch
main
```

## How it works internally?

You will work inside a temporary pair branch that in the end all the commits will be squashed to be added to the feature branch.

More details!

Ok ok! Under the hood the `devpair start` will take your current branch and create a copy with the same name but with the prefix `pair`

After make your code changes the `devpair next` will add, commit and push your code using an internal commit message. This step will be more easier to understand checking the [example step by step](#example-of-use)

In the end, we have the `devpair done` that will add, commit, push and delete the branch. Don't worry we will make a squash commit of everything that you did for the current branch.

[![](https://mermaid.ink/img/pako:eNqNkMEKwjAMhl9l5Dzx3rPgA3jtJbb_1uLajpgiMvbu1oOgDGE5fSTfn0AWcsWDDI1Rz8JzsLlr5UpKUbd8Fc4udBmPwwDWKtjlzxzluDv0wwHuVqpuTybIiH-bP6nEMX_rG5N6apOm-faD5d2zpAEJlkxDj4HrpJZsXpvKVcvlmR0ZlYqe6uxZcYo8CicyA093rC_K-3GZ?type=png)](https://mermaid.live/edit#pako:eNqNkMEKwjAMhl9l5Dzx3rPgA3jtJbb_1uLajpgiMvbu1oOgDGE5fSTfn0AWcsWDDI1Rz8JzsLlr5UpKUbd8Fc4udBmPwwDWKtjlzxzluDv0wwHuVqpuTybIiH-bP6nEMX_rG5N6apOm-faD5d2zpAEJlkxDj4HrpJZsXpvKVcvlmR0ZlYqe6uxZcYo8CicyA093rC_K-3GZ)

## Recommendations

- Before the pair programming
- Define the end of the session. How many time do you want pair?
- Define the break time.
- Use a `timer`, maybe `devpair` timer or any other one, the important thing is to keep the pair rotation:
- `devpair start

## Contributing

Fork, create a branch from `main` with the pattern `feat/my-feature` and make a pull request with your proposal.

## Local env

We are using [poetry](https://python-poetry.org/) and [pyenv](https://github.com/pyenv/pyenv) to manage all the python versions and dependencies.

```sh
# Install all the dependencies
make setup
# Run all the tests
make unit
# Testing the devpair locally
make local
```

## Publishing

```sh
sh ./scripts/tag-new-version.bash v0.0.0
```

Illustration by: [popsy](https://popsy.co/)