I'm planning to open-source a server-side Python library from my pet project. It strictly depends on another Python library, which is distributed under the GNU GPL v2. Am I legally correct to put my library under some permissive, e.g. MIT license? Would the end user of my library need to obey GPLv2 regardless of the license I'll pick?
You are free to licence your code as you want. It might have to be GPLv2 if you include pieces of the other library, or use it's API extensively (that is the FSF's position with respect to binary libraries, at least; but that isn't exactly unanimous).
Licensing it under anything that isn't compatible with the other library (GPLv2) will clearly create unnecessary friction. MIT would be fine in this.
You are free to license your source code under any compatible license, however any using your source code must comply with the GPLv2.
I have not been able to form a convincing argument over what license applies to
.pyc files. However, since that practice is not common in the Python infrastructure, ineffective for obfuscation purposes, and incompatible across versions, just don't do that and you'll be fine.
However, even though your users must comply with the GPLv2, there are still valid reasons to ship your source as MIT:
- Some other (either later, or competing) compatible implementation of your dependency may become available under a different license.
- Someone might be interested in copying small pieces out of your source code that do not depend on the GPLv2 library.