reichlab / zoltpy

A python module that interfaces with Zoltar https://github.com/reichlab/forecast-repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not hardcode a list of allowed licenses

Bisaloo opened this issue · comments

We currently have an issue in the European COVID-19 Forecast Hub where upload to zoltar (via zoltpy) fails with the following error:

"invalid license: 'cc-by-nc-nd-4.0'. must be one of: ['afl-3.0', 'apache-2.0', 'artistic-2.0', 'bsl-1.0', 'bsd-2-clause', 'bsd-3-clause', 'bsd-3-clause-clear', 'cc', 'cc0-1.0', 'cc-by-nc-4.0', 'cc-by-4.0', 'cc-by-sa-4.0', 'wtfpl', 'ecl-2.0', 'epl-1.0', 'eupl-1.1', 'agpl-3.0', 'gpl', 'gpl-2.0', 'gpl-3.0', 'lgpl', 'lgpl-2.1', 'lgpl-3.0', 'isc', 'lppl-1.3c', 'ms-pl', 'mit', 'mpl-2.0', 'osl-3.0', 'postgresql', 'ofl-1.1', 'ncsa', 'unlicense', 'zlib', 'other']"

I believe cc-by-nc-nd-4.0 is a valid choice of license and it should not cause a failure.

More generally, I don't agree with this list of licenses, which is arbitrary (some valid licenses are missing) and includes items that are not actually valid licenses (cc, gpl).

I think the validation of licenses is better left to the hub and should not be part of zoltpy. Each project/hub should be allowed to use whichever license they want.

We have tried to keep this list up-to-date with the complete list of "allowed licenses". We decided early on that we would validate based on these licenses, and we are happy to add to the list! Note that a valid option is "other". We use this at the US hub where teams can specify "other" if the desired license is not listed and then add a license file of their choice to their model's subdirectory.

I agree that the "license family" rows should not be included in the license file.

For the short-term we have

  • added cc-by-nc-nd-4.0 to the list of accepted licenses on Zoltar server and in this file
  • removed the "family" license rows from the accepted-licenses.csv file

Thanks for your quick answer!

I wanted to add this to my first message but forgot; the list is hardcoded in zoltpy itself:

LICENSE_CHOICES = (('afl-3.0', 'Academic Free License v3.0'),
('apache-2.0', 'Apache license 2.0'),
('artistic-2.0', 'Artistic license 2.0'),
('bsl-1.0', 'Boost Software License 1.0'),
('bsd-2-clause', 'BSD 2-clause "Simplified" license'),
('bsd-3-clause', 'BSD 3-clause "New" or "Revised" license'),
('bsd-3-clause-clear', 'BSD 3-clause Clear license'),
('cc', 'Creative Commons license family'),
('cc0-1.0', 'Creative Commons Zero v1.0 Universal'),
('cc-by-nc-4.0', 'Creative Commons Attribution Non-Commercial 4.0'),
('cc-by-4.0', 'Creative Commons Attribution 4.0'),
('cc-by-sa-4.0', 'Creative Commons Attribution Share Alike 4.0'),
('wtfpl', 'Do What The F*ck You Want To Public License'),
('ecl-2.0', 'Educational Community License v2.0'),
('epl-1.0', 'Eclipse Public License 1.0'),
('eupl-1.1', 'European Union Public License 1.1'),
('agpl-3.0', 'GNU Affero General Public License v3.0'),
('gpl', 'GNU General Public License family'),
('gpl-2.0', 'GNU General Public License v2.0'),
('gpl-3.0', 'GNU General Public License v3.0'),
('lgpl', 'GNU Lesser General Public License family'),
('lgpl-2.1', 'GNU Lesser General Public License v2.1'),
('lgpl-3.0', 'GNU Lesser General Public License v3.0'),
('isc', 'ISC'),
('lppl-1.3c', 'LaTeX Project Public License v1.3c'),
('ms-pl', 'Microsoft Public License'),
('mit', 'MIT'),
('mpl-2.0', 'Mozilla Public License 2.0'),
('osl-3.0', 'Open Software License 3.0'),
('postgresql', 'PostgreSQL License'),
('ofl-1.1', 'SIL Open Font License 1.1'),
('ncsa', 'University of Illinois/NCSA Open Source License'),
('unlicense', 'The Unlicense'),
('zlib', 'zLib License'),
('other', 'Other License'))

It probably needs to be updated as well.

Thanks, that's a copy that's not used by zoltpy. I appreciate catching that.

Ok, great. So, we now only need to wait until the changes in Zoltar server get in production. Is this correct?

Yes, I'm working on it now.

Please try it again. That license should be accepted now.

Yes, it works fine now. Thanks!