Contains a list that tells Buildout how to retrieve the source for an egg. Every egg from GroupServer and E-Democracy should have an entry in here indicating the address to that egg's repository, and version control tool used on that repository.

Contains a list that tells Buildout how to retrieve the source for an egg. Every egg from GroupServer and E-Democracy should have an entry in here indicating the address to that egg's repository, and version control tool used on that repository.

−

Technically, this isn't a Buildout file. It is a file used by [Mr. Developer https://pypi.python.org/pypi/mr.developer], a Buildout extension.

+

Technically, this isn't a Buildout file. It is a file used by [https://pypi.python.org/pypi/mr.developer Mr. Developer], a Buildout extension.

===versions.cfg===

===versions.cfg===

Revision as of 10:13, 28 June 2013

GroupServer is a mature open source project which uses a full set of tools for managing development.

To use Buildout you will need setuptools. On Ubuntu, install setuptools via

sudo apt-get install python-setuptools

Files

buildout.cfg

The main config file for Buildout. This is what Buildout looks to for directions. In GroupServer, buildout.cfg indicates what core eggs should be installed from GroupServer and from third parties. It also indicates which configuration sections should run, and defines a few.

custom.cfg

Refers to additional eggs developed for projects downstream from GroupServer. This which custom eggs should be installed, as well as which versions of those eggs. In general, anything written specifcally for E-Democracy will be referred to in this file.

develop.cfg

Contains a list that tells Buildout how to retrieve the source for an egg. Every egg from GroupServer and E-Democracy should have an entry in here indicating the address to that egg's repository, and version control tool used on that repository.

Technically, this isn't a Buildout file. It is a file used by Mr. Developer, a Buildout extension.

versions.cfg

This controls which version of a core egg Buildout will retrieve and build. Most core eggs will have an entry in this file that pins the egg to some version. Some 3rd party eggs will also have their versions pinned by this file.

Code Repositories

E-Democracy and GroupServer use a few repository locations and tools for storing code. The differences in location and tools roughly correspond to the division between E-Democracy specific code and GroupServer code.

Of the eggs which have repositories on source.iopen.net, the most important is gs.skin.ogn.edem (which is an E-Democracy egg despite starting with 'gs').

Registering for Repository Access

In order to commit code to either GroupServer's or E-Democracy's repositories on source.iopen.net, you will need to register an account on the site. Once you have registered, email techteam [at] e-democracy.org to confirm your registration (you will not be able to commit until confirming registration).

For E-Democracy's repositories on Github, you can either request permission to commit to the repository(ies) by emailing techteam [at] e-democracy.org, or you can fork the repository of interest and send us a pull request.

Setting up SSL for Mercurial Repositories

Because iopen.net's SSL certificate is not signed by a certificate authority, Mercurial will default to displaying an error when trying to send or receive code from the repositories on source.iopen.net. This can be prevented by adding the following to ~/.hgrc:

Issue Tracking

Because GroupServer and forums.e-democracy.org run on code that spans 100+ modules/repositories, both projects maintain project level Redmine instances for issue tracking/ticketing. The vast majority of tickets should be submitted to one of the Redmine instances below.

For non-GroupServer projects (e.x. edemsignups) it is much more likely that we will use an issue tracker associated directly with the project's repository.

Because iopen.net's SSL certificate is not signed by a certificate authority, you will probably see a warning from your browser about the site's certificate. This is entirely normal, and you should disregard this warning.

Checking Out Eggs

This will checkout an egg into the src directory. Once checked out, changes to the files in src/<egg> will be reflected in the instance running on your machine. Generally, template changes are reflected immediately, while python changes will require a restart of uwsgi.

Checked out eggs under src/ are part of a Mercurial project. If eggs have been checkout for a while, you will need to do am hg pull on them before further development or pushing changes. Also, eggs under src/ are not updated when ./bin/buildout is called.

Step 0: Add ‘develop.cfg’ to the extends line in the [buildout] section of buildout.cfg

Step 1: ./bin/develop checkout <EGG NAME>

Step 2: ./bin/buildout -N

Step 3: Restart uwsgi

Pushing and Pulling Checked Out Code

This is pushing and pulling from Rhode Code or Github, which is the development repo, not the repo from which eggs are pulled during a buildout.

This is simply interacting with Mercurial or Git. If you’ve ever used Mercurial or Git before, you already know this.

Creating a new egg

Copy the following files from an existing egg and edit as needed, or create these files while using the files in another egg as a reference

The docs directory

MANIFEST.in

README.txt

Edit to be blankish, with a brief description of what the egg does.

setup.cfg

setup.py

Four things need to change:
1. The name needs to be the same as your egg,
2. The description should be sane,
3. The namespace_packages need to reflect the hierarchy. For example, in the case of edem.group.messages.topics, namespace_packages should be set to "['edem', 'edem.group', 'edem.group.messages']". (The final directory is supposed to be missing; it is a normal package, not a namespace package.)
4. Set the install_requires to just 'setuptools' for now.

version.py

.hgignore

Next copy an __init__.py from a namespace-directory of the original egg.

In Python the ability to write "from package.package.package import SomeThing" is not built into the language. It is a hack. The hack is called a "namespace package". The hack is in two parts. First, there is a "namespace_packages" entry in the setup.py. Second there is a special __init__.py in all the namespace packages. Copy this special __init__.py from *any* other package to each of the directories in the namespace.