Skip to content

Instantly share code, notes, and snippets.

@tchen
Created September 1, 2015 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tchen/a1c7f681a4f06f788390 to your computer and use it in GitHub Desktop.
Save tchen/a1c7f681a4f06f788390 to your computer and use it in GitHub Desktop.
Good tips to follow on OSS code maintenance and patching
Tips for getting your patches accepted:
Don't needlessly break compatibility with older versions of PyCrypto. Patches that break compatibility with older version of PyCrypto, especially PyCrypto 2.0.1, will need an explanation about why it's worth breaking compatibility. Exception: Removing buggy code that nobody uses is fine.
Don't needlessly break compatibility with older versions of Python. Run the test suite using Python 2.1 and the latest version of Python 2.x.
Don't needlessly add complexity. The more complex the code is, the harder it is to maintain, and the more likely it is to have bugs.
Don't needlessly add features. Seriously. X.509 doesn't belong in PyCrypto. Or anywhere, really.
Don't create copyright headaches. It took me the better part of a year to sort out the licensing ambiguities in PyCrypto 2.0.1. If you're adding new files, include the standard PyCrypto public domain dedication at the top.
Whatever you do in _fastmath.c, also do in _slowmath.py. PyCrypto has two math libraries: one that depends on libgmp, and one that doesn't. They need to be kept synchronized with each other.
Make small, incremental, well-documented changes. Your commit messages should be clear and detailed. Include any applicable background information. Your patches should do one thing. Your code should have sensible comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment