summaryrefslogtreecommitdiff
path: root/docs/DeveloperGuidelines.txt
blob: f8388d4a0eaa9376882c8b122267ae650a010d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
++++++++++++++++++++++++++++
Python Paste Developer Guide
++++++++++++++++++++++++++++

Hi.  Welcome to Paste.  I hope you enjoy your stay here.

I hope to bring together multiple efforts here, for Paste to support
multiple frameworks and directions, while presenting a fairly
integrated frontend to users.  How to do that?  That's an open
question, and this code is in some ways an exploration.

There's some basic principles:

* Keep stuff decoupled.

* Must be testable.  Of course tested is even better than testable.

* Use WSGI standards for communication between decoupled libraries.

* When possible, use WSGI as a wrapper around web-neutral libraries.
  For instance, the configuration is a simple library, but the WSGI
  middleware that puts the configuration in place is really really
  simple.  If it could be used outside of a web context, then having
  both a library and middleware form is good.

* Entry into frameworks should be easy, but exit should also be easy.
  Heterogeneous frameworks and applications are the ambition.  But we
  have to get some messiness into Paste before we can try to resolve
  that messiness.

* When all is said and done, users should be able to ignore much of
  what we've done and focus on writing their applications, and Stuff
  Just Works.  Documentation is good; stuff that works without user
  intervention is better.

Developer Info
==============

Mostly, if there's a problem we can discuss it and work it out, no one
is going to bite your head off for committing something.

* Framework-like things should go in subpackages.  The top level is
  only for things that are lower-level than a framework.  

* Integrating external servers and frameworks is also interesting, but
  if someone else is maintaining the code elsewhere you shouldn't
  import their work into the repository -- it'll just cause
  confusion.  Create a script to pull in their work or something, and
  check that in.

* Tests are good.  We use py.test_, because it is simple.  I want to
  use doctests too, but the infrastructure isn't really there now --
  but please feel free to use those too.  ``unittest`` is kind of
  annoying, and py.test is both more powerful and easier to write for.
  Tests should go in a ``tests/`` subdirectory.
  ``paste.tests.fixture`` contains some convenience functions for
  testing WSGI applications and middleware.
  
.. _py.test: http://codespeak.net/py/current/doc/test.html

* If something is really experimental, put it in your home directory,
  or make a branch in your home directory.  You can make a home
  directory for yourself, in ``http://svn.w4py.org/home/username``.

* Not everything in the repository or even in the trunk will
  necessarily go into the release.  The release should contain stuff
  that is tested, documented, and useful.  Each module or feature also
  needs a champion -- someone who will stand by the code, answer
  questions, etc.  It doesn't have to be the original developer, but
  there has to be *someone*.  So when a release is cut, if some
  modules don't fulfill that they may be left out.

* Try to keep to the `Style Guidelines`_.  But if you are bringing in
  outside work, don't stress out too much about it.  Still, if you
  have a choice, follow that.  Those guidelines are meant to represent
  conventional Python style guides, there's nothing out of the normal
  there.

.. _Style Guidelines: StyleGuide.html