Development Guide

This is a guide for developers who would like to contribute to this project.

Fork this project

Firstly, You need to fork this project and clone your fork into your computer.

$ git clone <url-for-your-fork>

Local setup

The installation instructions in the README file are intended for users of athenacli. If you’re developing athenacli, you’ll need to install it in a slightly different way so you can see the effects of your changes right away without having to go through the install cycle everytime you change the code.

It is highly recommended to use pipenv for development. If you don’t know what a pipenv is, this guide will help you get started.

Follow Installing Pipenv guide to install it.

Once pipenv is installed, cd into the local clone of athenacli folder and install athenacli using pipenv as follows:

$ # install necessary dependences for both production and development
$ pipenv install --dev
$ # active virtual environment
$ pipenv shell

This will install the necessary dependencies as well as install athenacli from the working folder into a virtualenv. Athenacli is installed in an editable way, so any changes made to the code is immediately available in the installed version of athenacli. This makes it easy to change something in the code, launch athenacli and check the effects of your change.

Running the tests

Currently we don’t have enough tests for athenacli, because we haven’t found an easy way to test AWS Athena locally, we have an issue track this problem. But we do have some unit tests for other parts, below are the steps to run them.

Make sure you have installed development dependences via pipenv install –dev and actived your virtual environment.

After that, tests can be run with:

$ pytest

Create a pull request

After making the changes and creating the commits in your local machine. Then push those changes to your fork. Then click on the pull request icon on github and create a new pull request. Add a description about the change and send it along. I promise to review the pull request in a reasonable window of time and get back to you.

In order to keep your fork up to date with any changes from mainline, add a new git remote to your local copy called ‘upstream’ and point it to the main athenacli repo.

$ git remote add upstream https://github.com/dbcli/athenacli.git

Once the ‘upstream’ end point is added you can then periodically do a git rebase to update your local copy.