4dn-dcic / utils

various util modules shared amongst several projects in our organization
MIT License
4 stars 1 forks source link

Add a license_utils module to dcicutils (C4-1048) #265

Closed netsettler closed 1 year ago

netsettler commented 1 year ago

In service of Programmatic checking of license compatibility (C4-1048):

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.

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5736313253


Totals Coverage Status
Change from base Build 5590491337: 1.5%
Covered Lines: 8118
Relevant Lines: 10477

💛 - Coveralls