Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Latest commit

 

History

History
101 lines (67 loc) · 2.53 KB

HACKING.rst

File metadata and controls

101 lines (67 loc) · 2.53 KB

Hacking Guidance

This document is intended for anyone who wants to contribute code to the project.

Fork The Repository

Follow the instructions provided by GitHub on how to fork a repository.

Clone Your Fork

Once you have forked the main repository. Go ahead and clone your fork to your local machine:

$ git clone [email protected]:username/manageiq-cli.git

Virtual Environment Setup

Now that we have our local copy cloned, lets create a python virtual environment.

$ cd manageiq-cli-clone
$ virtualenv venv
$ source venv/bin/activate

Great! The virtual environment is setup. Default it will be created with Python 2 interpreter. We are compatible with Python 3. You can define the interpreter that you wish to use when creating your virtual environment.

$ virtualenv venv -e /usr/bin/python3.6

Install Development Requirements

Install the required packages for development. They are defined in test-requirements.txt.

(venv) $ pip install -r test-requirements.txt

Install ManageIQ CLI

Install the CLI using the editable mode by pip. This will allow any code changes to be reflected right away. It eliminates the need to keep reinstalling the package each time a code change is made.

(venv) $ pip install -e .

Running Tox

We use tox to run our unit tests. Tox provides the ability to run unit tests with different python interpreters in isolated virtual environments. You will need to install tox in your python virtual environment.

(venv) $ pip install tox

Running tox will run all unit tests on the supported python interpreters, verify pep8 standards are met and build the documentation.

(venv) $ tox

You can also run a certain tox environment directly instead of running all environments.

(venv) $ tox -e py27
(venv) $ tox -e py36
(venv) $ tox -e pep8
(venv) $ tox -e docs

General Advise

  • "Simplicity is alway better than functionality." - P. Hintjens
  • "Beautiful is better than ugly." - PEP20
  • "Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live." - http://wiki.c2.com/?CodeForTheMaintainer