[Twisted-Python] Adding code to twisted
![](https://secure.gravatar.com/avatar/1d7efa864527c4118a418f07c5d49887.jpg?s=120&d=mm&r=g)
Hi all, Recent list activity has reminded me that I have some code that I'd like to add to the twisted codebase. I've had a browse of the developer docs, which seem geared towards patching, so how should I approach adding chunks of new features? Specifically, I have 2 pieces of code to add: 1. libsnmp, twisted-ified. This is my pure Python SNMP library that has been successfully used with twisted for several years now, on both my own projects and other people's. Adding this into twisted has been briefly mentioned on the list before. 2. A ZAPI[1] protocol implementation. I built some ZAPI handling code for ModiPY[2] that uses twisted, and I figured other people might also find it useful if they have a need to talk to NetApp kit. Is there any interest in having these things added to twisted? If so, could the appropriate admins maybe email me off list about how to do this? [1] ZAPI is an XML over HTTP thing used by Network Appliance storage devices for command and control. [2] http://modipy.seafelt.com/browser/trunk/netapp.py -- Justin Warren <daedalus@eigenmagic.com>
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On Jan 29, 2008 10:04 AM, Justin Warren <daedalus@eigenmagic.com> wrote:
This would be a nice thing to have.
I don't really know what this is, which means that I'm biased towards not having it in Twisted.
You'll need commit access and you'll need to file a ticket for each of these. Chris Armstrong or Jean-Paul Calderone should be able to give you the former. You should be warned that your code needs to be reviewed before it hits the tree, and you'll need to have good unit tests. Also, if you are going to add such big features, it's probably a good idea to start tracking the mailing list. jml
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On 03:53 am, jml@mumak.net wrote:
You should be warned that your code needs to be reviewed before it hits the tree, and you'll need to have good unit tests.
I want to repeat and emphasize this warning, because if you haven't submitted any patches before, you may be in for a nasty surprise ;). It is, however, both good news and bad news. The bad news is that it is probably going to be a lot of work. You will need to live up to the current Twisted quality standards, which means: * Your tests will need to achieve at least 100% line-coverage * You will need to write docstrings for every public module, method, and class (including tests). * Docstrings will have to be formatted according to Twisted standard, including @param and @type markers where appropriate * The code will need to be cleaned up to meet the coding standard (trailing whitespace, unused imports, naming conventions, etc) This means, in practice, that it will have to be better than some of the code already in twisted that was "grandfathered in" before we adopted these standards :). The *really* bad news is that I can see that libsnmp is under the LGPL. Twisted is under the MIT license, and we are not going to add anything to it under a more restrictive license. Do you have the authority to relicense all of that code? i.e. have you received any contributions under the LGPL, and can you get in touch with everyone that you've received those contributions from and verify that they're OK with a license change? The good news is that the code will probably get vastly better in the process. I've written a few things which have been overhauled and radically improved as part of the process of getting them in to Twisted. However, the reason that the documentation is geared toward patching rather than addition of large features is that adding large features all at once can be daunting both for reviewers and authors of code. For example, you can see what a "large" review looks like here: http://twistedmatrix.com/trac/ticket/1608#comment:27 You might want to break up libsnmp into a series of smaller chunks so that you can deal with the feedback in smaller chunks and get your contributions reviewed and integrated faster.
![](https://secure.gravatar.com/avatar/1d7efa864527c4118a418f07c5d49887.jpg?s=120&d=mm&r=g)
On Tue, 2008-01-29 at 13:06 +0000, glyph@divmod.com wrote:
True.
Nothing worthwhile is easy.
This will indeed require work. On the plus side, this will make the code better.
libsnmp has already been relicensed under the MIT license. I'm guessing there's some doco or an artifact out there that still refers to the LGPL (which is was licensed under initially). If you could point it out, I'll fix it to clear up any confusion. And I wrote all the code myself. The only contributions I've received have been some bug notifications.
I might try my hand at a patch or two to get the hang of things, and work on getting my code up to scratch in the meantime. Thanks for the detailed response. :) -- Justin Warren <daedalus@eigenmagic.com>
![](https://secure.gravatar.com/avatar/1327ce755b24b956995d68accae3eab2.jpg?s=120&d=mm&r=g)
On Jan 29, 2008 10:04 AM, Justin Warren <daedalus@eigenmagic.com> wrote:
This would be a nice thing to have.
I don't really know what this is, which means that I'm biased towards not having it in Twisted.
You'll need commit access and you'll need to file a ticket for each of these. Chris Armstrong or Jean-Paul Calderone should be able to give you the former. You should be warned that your code needs to be reviewed before it hits the tree, and you'll need to have good unit tests. Also, if you are going to add such big features, it's probably a good idea to start tracking the mailing list. jml
![](https://secure.gravatar.com/avatar/d6328babd9f9a98ecc905e1ccac2495e.jpg?s=120&d=mm&r=g)
On 03:53 am, jml@mumak.net wrote:
You should be warned that your code needs to be reviewed before it hits the tree, and you'll need to have good unit tests.
I want to repeat and emphasize this warning, because if you haven't submitted any patches before, you may be in for a nasty surprise ;). It is, however, both good news and bad news. The bad news is that it is probably going to be a lot of work. You will need to live up to the current Twisted quality standards, which means: * Your tests will need to achieve at least 100% line-coverage * You will need to write docstrings for every public module, method, and class (including tests). * Docstrings will have to be formatted according to Twisted standard, including @param and @type markers where appropriate * The code will need to be cleaned up to meet the coding standard (trailing whitespace, unused imports, naming conventions, etc) This means, in practice, that it will have to be better than some of the code already in twisted that was "grandfathered in" before we adopted these standards :). The *really* bad news is that I can see that libsnmp is under the LGPL. Twisted is under the MIT license, and we are not going to add anything to it under a more restrictive license. Do you have the authority to relicense all of that code? i.e. have you received any contributions under the LGPL, and can you get in touch with everyone that you've received those contributions from and verify that they're OK with a license change? The good news is that the code will probably get vastly better in the process. I've written a few things which have been overhauled and radically improved as part of the process of getting them in to Twisted. However, the reason that the documentation is geared toward patching rather than addition of large features is that adding large features all at once can be daunting both for reviewers and authors of code. For example, you can see what a "large" review looks like here: http://twistedmatrix.com/trac/ticket/1608#comment:27 You might want to break up libsnmp into a series of smaller chunks so that you can deal with the feedback in smaller chunks and get your contributions reviewed and integrated faster.
![](https://secure.gravatar.com/avatar/1d7efa864527c4118a418f07c5d49887.jpg?s=120&d=mm&r=g)
On Tue, 2008-01-29 at 13:06 +0000, glyph@divmod.com wrote:
True.
Nothing worthwhile is easy.
This will indeed require work. On the plus side, this will make the code better.
libsnmp has already been relicensed under the MIT license. I'm guessing there's some doco or an artifact out there that still refers to the LGPL (which is was licensed under initially). If you could point it out, I'll fix it to clear up any confusion. And I wrote all the code myself. The only contributions I've received have been some bug notifications.
I might try my hand at a patch or two to get the hang of things, and work on getting my code up to scratch in the meantime. Thanks for the detailed response. :) -- Justin Warren <daedalus@eigenmagic.com>
participants (3)
-
glyph@divmod.com
-
Jonathan Lange
-
Justin Warren