2012-03-06 06:13:17 -08:00
|
|
|
How to contribute?
|
2011-05-10 23:59:21 +01:00
|
|
|
###################
|
2012-03-06 06:13:17 -08:00
|
|
|
There are many ways to contribute to Pelican. You can enhance the
|
|
|
|
|
documentation, add missing features, and fix bugs (or just report them).
|
2011-05-10 23:41:27 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Don't hesitate to fork and make a pull request on GitHub.
|
2011-05-10 23:59:21 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting up the development environment
|
|
|
|
|
======================================
|
2011-05-10 23:59:21 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
You're free to set up your development environment any way you like. Here is a
|
|
|
|
|
way using virtualenv and virtualenvwrapper. If you don't have them, you can
|
|
|
|
|
install these packages via::
|
2011-05-10 23:59:21 +01:00
|
|
|
|
|
|
|
|
$ pip install virtualenvwrapper
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Virtual environments allow you to work on Python projects which are isolated
|
|
|
|
|
from one another so you can use different packages (and package versions) with
|
|
|
|
|
different projects.
|
2011-05-10 23:59:21 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
To create a virtual environment, use the following syntax::
|
2011-05-10 23:59:21 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
$ mkvirtualenv pelican
|
2011-05-10 23:59:21 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
To manually install the dependencies::
|
2011-05-10 23:59:21 +01:00
|
|
|
|
|
|
|
|
$ pip install -r dev_requirements.txt
|
2012-02-20 17:58:23 +01:00
|
|
|
$ python setup.py develop
|
2011-05-10 23:41:27 +01:00
|
|
|
|
|
|
|
|
Running the test suite
|
2011-05-10 23:59:21 +01:00
|
|
|
======================
|
|
|
|
|
|
|
|
|
|
Each time you add a feature, there are two things to do regarding tests:
|
2012-03-06 06:13:17 -08:00
|
|
|
checking that the existing tests pass, and adding tests for your new feature
|
|
|
|
|
or for the bug you're fixing.
|
2011-05-10 23:41:27 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
The tests live in "pelican/tests" and you can run them using the
|
2011-05-10 23:59:21 +01:00
|
|
|
"discover" feature of unittest2::
|
2011-05-10 23:41:27 +01:00
|
|
|
|
2011-05-11 10:48:39 +01:00
|
|
|
$ unit2 discover
|
2012-03-09 16:27:23 +01:00
|
|
|
|
2012-04-04 23:18:11 +02:00
|
|
|
If you have made changes that affect the output of a pelican generated weblog,
|
|
|
|
|
then you should update the output used by functional tests.
|
|
|
|
|
To do so, you can use the 2 following commands::
|
|
|
|
|
|
2012-07-05 00:04:32 +02:00
|
|
|
$ LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py \
|
2012-04-04 23:18:11 +02:00
|
|
|
samples/content/
|
2012-07-05 00:04:32 +02:00
|
|
|
$ LC_ALL="C" USER="Dummy Author" pelican -o tests/output/basic/ samples/content/
|
2012-04-04 23:18:11 +02:00
|
|
|
|
2012-03-09 16:27:23 +01:00
|
|
|
Coding standards
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
Try to respect what is described in the PEP8
|
|
|
|
|
(http://www.python.org/dev/peps/pep-0008/) when providing patches. This can be
|
|
|
|
|
eased by the pep8 tool (http://pypi.python.org/pypi/pep8) or by Flake8, which
|
|
|
|
|
will give you some other cool hints about what's good or wrong
|
|
|
|
|
(http://pypi.python.org/pypi/flake8/)
|