views:

66

answers:

2

Hi Stack Overflow -

I am developing a pure-Python module as a drop-in replacement for a C extension module. This C extension module is GPL'd and has unit tests written in Python. If I am developing open-source software under the MIT, am I able to re-use these test cases in my project?

+3  A: 

You can mix GPL code with MIT code. The MIT is in fact GPL compatible. You can therefore reuse the GPL test cases in your MIT code. However, the whole package becomes GPL, as required by the GPL license.

If you really prefer to stick with the MIT license, I think that you would have to offer the GPL test cases as a separate download, so that your code remains MIT, and the tests are the original GPL tests.

This is an example of how restrictive the GPL is compared to licenses such as MIT or BSD: including GPL code forces your code to become GPL, which you might not want.

Since I am not a lawyer, take the above with a grain of salt. :)

EOL
+3  A: 

You can certainly use the tests during your own development, but you cannot distribute them under MIT without permission.

Your best bet would probably be to contact the author of the C module and ask for permission to redistribute the Python tests under an MIT license. Otherwise you are stuck with re-licensing your code as GPL or distributing it without the tests.

Or you could clean-room duplicate the tests: programmer A can produce a description of what each test achieves, and then programmer B without looking at the GPL code can write equivalent tests.

Duncan
+1 asking the original author for a relicensed copy might just work. Especially if it's "only" the tests.
Joachim Sauer
+1: good additional points!
EOL