2

I would like to publish my opensource project with an MIT license but was wondering if that is ok given that a dependency (not a direct dependency) seems to have LGPL.

These are my python packages that I depend on. Setuptools is only needed to package the software. I am not directly calling it.

setuptools
scikit-learn==0.23.2
numpy==1.19.1
requests==2.24.0
matplotlib==3.3.1
pandas==1.1.2
pytest-runner==5.2
python-dateutil==2.8.1

And here the license of all the packages it pulls when installing my package.

$ pip-licenses --format=markdown
| Name            | Version   | License      |
|-----------------|-----------|--------------|
| Pillow          | 7.2.0     | HPND         |
| certifi         | 2020.6.20 | MPL-2.0      |
| chardet         | 3.0.4     | LGPL         |
| cycler          | 0.10.0    | BSD          |
| idna            | 2.10      | BSD-like     |
| joblib          | 0.17.0    | BSD          |
| kiwisolver      | 1.2.0     | BSD          |
| matplotlib      | 3.3.1     | PSF          |
| numpy           | 1.19.1    | BSD          |
| pandas          | 1.1.2     | BSD          |
| pyparsing       | 2.4.7     | MIT License  |
| python-dateutil | 2.8.1     | Dual License |
| pytz            | 2020.1    | MIT          |
| requests        | 2.24.0    | Apache 2.0   |
| scikit-learn    | 0.23.2    | new BSD      |
| scipy           | 1.5.2     | BSD          |
| six             | 1.15.0    | MIT          |
| threadpoolctl   | 2.1.0     | UNKNOWN      |
| urllib3         | 1.25.10   | MIT          |
1

The question is not what your code depends on, but what the program includes. Assuming that your code doesn't include any snippets from these libraries, you can most likely license your source code under whatever license you want.

Things are different if you compile or bundle your code along with all dependencies into a program/executable. Now that program includes all dependencies – not just direct dependencies, but also transitive dependencies. You can only distribute that compiled program under a license that is compatible with all the dependencies. Sometimes, no such license exists, e.g. when trying to combine a GPLv2 dependency with an Apache 2 dependency.

Fortunately, the LGPL wouldn't cause such a problem: you're allowed to distribute programs that include LGPL components under any terms, as long as recipients can modify the LGPL component. That would e.g. involve providing the source code for the LGPL component, and scripts to re-bundle the program. If all the involved code is open-source anyway, this is fairly straightforward because you can just point to the repository which already contains the code and scripts.

Creating bundled Python programs is pretty rare, so I think only the first paragraph of this answer applies: You can license your code under whatever terms you want. The MIT license is fine.

| improve this answer | |
  • Thanks for the comprehensive answer – Chris Oct 19 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.