First clone the git repo:
$ git clone git@github.com:aio-libs/aiopg.git
$ cd aiopgAfter that you need to create and activate a virtual environment. I recommend using :term:`virtualenvwrapper` but just :term:`virtualenv` or :term:`venv` will also work. For :term:`virtualenvwrapper`:
$ mkvirtualenv aiopg -p `which python3`For venv (for example; put the directory wherever you want):
$ python3 -m venv ../venv_directory
$ source ../venv_directory/bin/activateJust as when doing a normal install, you need the :term:`libpq` library:
$ sudo apt-get install libpq-devUPD
The latest aiopg test suite uses docker container for running
Postgres server. See
https://docs.docker.com/engine/installation/linux/ubuntulinux/ for
instructions for Docker installing.
No local Postgres server needed.
In the virtual environment you need to install aiopg itself and some additional development tools (the development tools are needed for running the test suite and other development tasks)
$ pip install -Ue .
$ pip install -Ur requirements.txtThat's all.
To run all of the aiopg tests do:
$ make testThis command runs :term:`pep8` and :term:`pyflakes` first and then executes the aiopg unit tests.
When you are working on solving an issue you will probably want to run some specific test, not the whole suite:
$ py.test -s -k test_initial_emptyFor debug sessions I prefer to use :term:`ipdb`, which is installed as part of the development tools. Insert the following line into your code in the place where you want to start interactively debugging the execution process:
import ipdb; ipdb.set_trace()The library is reasonably well covered by tests. There is a make target for generating the coverage report:
$ make covI like to get well-formed Pull Requests on github. The pull request should include both the code fix and tests for the bug.
If you cannot make a good test yourself or want to report a problem, please open an issue at https://github.com/aio-libs/aiopg/issues.