1
0
Fork 0

Update README and add DEVELOP file.

This commit is contained in:
Amjith Ramanujam 2014-12-18 22:32:47 -08:00
parent 804803d82e
commit 1afc6eeec9
2 changed files with 79 additions and 12 deletions

58
DEVELOP.rst Normal file
View File

@ -0,0 +1,58 @@
Development Guide
-----------------
This is a guide for developers who would like to contribute to this project.
Git Workflow
------------
If you're interested in contributing to pgcli, first of all my heart felt
thanks. Please `fork the project <https://github.com/amjith/pgcli>`_ in github.
Then clone your fork into your computer (``git clone <url-for-your-fork>``).
Make the necessary changes and create 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 you 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 pgcli
repo.
.. ::
$ git remote add upstream git@github.com:amjith/pgcli.git
Once the 'upstream' end point is added you can then periodically do a ``git
pull upstream master`` to update your local copy and then do a ``git push
origin master`` to keep your own fork up to date.
Local Setup
-----------
The installation instructions in the README file are intended for users of
pgcli. If you're developing pgcli, 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 virtualenv for development. If you don't know
what a virtualenv is, this `guide <http://docs.python-guide.org/en/latest/dev/virtualenvs/#virtual-environments>`_
will help you get started.
Create a virtualenv (let's call it pgcli-dev). Once the virtualenv is activated
`cd` into the local clone of pgcli folder and install pgcli using pip as
follows:
.. ::
$ pip install --editable .
or
$ pip install -e .
This will install the necessary dependencies as well as install pgcli from the
working folder into the virtualenv. By installing it using `pip install -e`
we've linked the pgcli installation with the working copy. So any changes made
to the code is immediately available in the installed version of pgcli. This
makes it easy to change something in the code, launch pgcli and check the
effects of your change.

View File

@ -15,7 +15,8 @@ If you already know how to install python pacakges, then you can simply do:
$ pip install pgcli
If you don't know how to install python pacakges, please check the `detailed instructions`__.
If you don't know how to install python pacakges, please check the
`detailed instructions`__.
__ https://github.com/amjith/pgcli#detailed-installation-instructions
@ -46,7 +47,8 @@ The `pgcli` is written using prompt_toolkit_.
* Auto-completion as you type for SQL keywords as well as tables and
columns in the database.
* Syntax highlighting using Pygments.
* Smart-completion (enabled by default) will suggest context-sensitive completion.
* Smart-completion (enabled by default) will suggest context-sensitive
completion.
- `SELECT * FROM <tab>` will only show table names.
- `SELECT * FROM users WHERE <tab>` will only show column names.
@ -105,7 +107,8 @@ If it does then install pgcli using the pip command as follows:
$ sudo pip install pgcli
If it doesn't exist, use your linux package manager to install `pip`. This might look something like:
If it doesn't exist, use your linux package manager to install `pip`. This
might look something like:
::
@ -126,15 +129,21 @@ Thanks:
=======
A special thanks to `Jonathan Slenders <https://twitter.com/jonathan_s>`_ for
creating `Python Prompt Toolkit <http://github.com/jonathanslenders/python-prompt-toolkit>`_, which is quite
literally the backbone library, that made this app possible. Jonathan has also
provided valuable feedback and support during the development of this app.
creating `Python Prompt Toolkit <http://github.com/jonathanslenders/python-prompt-toolkit>`_,
which is quite literally the backbone library, that made this app possible.
Jonathan has also provided valuable feedback and support during the development
of this app.
This app includes the awesome `tabulate <https://pypi.python.org/pypi/tabulate>`_ library
for printing the output of tables. The reason for vendoring this library rather than
listing it as a dependency in setup.py, is because I had to make a change to the table
format which is merged back into the original repo, but not yet released inPyPI.
This app includes the awesome `tabulate <https://pypi.python.org/pypi/tabulate>`_
library for printing the output of tables. The reason for vendoring this
library rather than listing it as a dependency in setup.py, is because I had to
make a change to the table format which is merged back into the original repo,
but not yet released inPyPI.
`Click <http://click.pocoo.org/3/>`_ is used for command line option parsing and printing error messages.
`Click <http://click.pocoo.org/3/>`_ is used for command line option parsing
and printing error messages.
Thanks to `psycopg <http://initd.org/psycopg/>`_ for providing a rock solid interface to Postgres dataabase.
Thanks to `psycopg <http://initd.org/psycopg/>`_ for providing a rock solid
interface to Postgres dataabase.
Thanks to all the beta testers and contributors for your time and patience. :)