This adds a license_utils module to dcicutils that in particular will allow us to do tests like this in other repos:
from dcicutils.license_utils import C4InfrastructureLicenseChecker
def test_license_compatibility():
C4InfrastructureLicenseChecker.validate()
NOTE WELL: This relies on the pip-licenses being a dev dependency of any repo wanting to do that. I don't know how to export a dev dependency, and am not sure you can, so there is a little dance at the top of the license_utils.py file that checks to see if the repo managed to be there at all, since we don't require it in the regular dependencies. The error message explains what needs to be done.
We now have a spreadsheet tracking the utility of this because it got complex.
I have extended this to have a contribution_utils as well, tracking contributors so that we can review them to make sure we know who's been involved.
In service of Programmatic checking of license compatibility (C4-1048):
This adds a
license_utils
module todcicutils
that in particular will allow us to do tests like this in other repos:NOTE WELL: This relies on the
pip-licenses
being a dev dependency of any repo wanting to do that. I don't know how to export a dev dependency, and am not sure you can, so there is a little dance at the top of thelicense_utils.py
file that checks to see if the repo managed to be there at all, since we don't require it in the regular dependencies. The error message explains what needs to be done.We now have a spreadsheet tracking the utility of this because it got complex.
I have extended this to have a
contribution_utils
as well, tracking contributors so that we can review them to make sure we know who's been involved.