bioimage-io / core-bioimage-io-python

Python libraries for loading, running and packaging bioimage.io models
https://bioimage-io.github.io/core-bioimage-io-python/
MIT License
27 stars 21 forks source link

Is license checked in the validation? #186

Open esgomezm opened 2 years ago

esgomezm commented 2 years ago

We have a model with incorrect license name ("BSD-3") and rdf version 0.3.2. The validator says that the specs are correct but test-model complains about the licensing:

marshmallow.exceptions.ValidationError: {'license': ['Must be one of: bzip2-1.0.6, Glulxe, Parity-7.0.0, OML, UCL-1.0, UPL-1.0, BSD-Protection, OCLC-2.0, eCos-2.0, Multics, IPL-1.0, IPA, eGenix, Glide, Entessa, FSFUL, Nunit, MPL-2.0-no-copyleft-exception, libpng-2.0, OLDAP-2.2.1, curl, ANTLR-PD, CC-BY-SA-2.0, LiLiQ-P-1.1, TCP-wrappers, Unicode-DFS-2016, ODbL-1.0, LPPL-1.3a, CERN-OHL-1.2, ADSL, CDDL-1.0, Motosoto, BUSL-1.1, OGL-UK-1.0, xinetd, Imlib2, SNIA, OGTSL, TMate, OCCT-PL, GPL-1.0-or-later, YPL-1.1, CECILL-2.0, PHP-3.0, BlueOak-1.0.0, Zimbra-1.3, OGC-1.0, NASA-1.3, SPL-1.0, Intel-ACPI, SISSL-1.2, OGL-Canada-2.0, CC-BY-3.0-US, copyleft-next-0.3.1, GFDL-1.1-invariants-or-later, GL2PS, MS-PL, SCEA, CC-BY-ND-2.5, SSPL-1.0, Spencer-86, LPPL-1.0, GPL-3.0-only, GPL-2.0-with-autoconf-exception, Giftware, CC-BY-NC-ND-3.0, CNRI-Python, GFDL-1.2-no-invariants-or-later, Afmparse, BSD-3-Clause-LBNL, NCGL-UK-2.0, GPL-1.0+, PHP-3.01, Leptonica, bzip2-1.0.5, NIST-PD-fallback, OSL-1.0, OFL-1.1, JasPer-2.0, Naumen, AGPL-1.0-only, C-UDA-1.0, MIT, TCL, LGPL-3.0-only, ECL-1.0, MPL-2.0, CC-BY-NC-1.0, CC-BY-NC-ND-2.5, LPPL-1.3c, JSON, NBPL-1.0, CAL-1.0-Combined-Work-Exception, Unlicense, CNRI-Python-GPL-Compatible, TU-Berlin-2.0, NLPL, LGPL-3.0-or-later, Beerware, NGPL, ZPL-2.1, Saxpath, CC-BY-SA-2.0-UK, CECILL-2.1, XFree86-1.1, IBM-pibs, Zlib, StandardML-NJ, RPSL-1.0, CECILL-1.0, OGL-UK-3.0, BSD-4-Clause-Shortened, Watcom-1.0, Wsuipa, TU-Berlin-1.0, Latex2e, CECILL-B, EUPL-1.0, GFDL-1.2-or-later, CPL-1.0, CC-BY-ND-3.0, NTP, W3C-19980720, GFDL-1.3-only, CC-BY-SA-4.0, EUPL-1.1, GFDL-1.1-no-invariants-only, JPNIC, AMPAS, BSD-3-Clause, MIT-0, Intel, O-UDA-1.0, NPL-1.0, CC-BY-NC-2.5, Mup, Newsletr, PDDL-1.0, SMLNJ, BSD-1-Clause, SimPL-2.0, OLDAP-1.2, Xnet, BSD-2-Clause, AML, GFDL-1.2-only, Info-ZIP, DSDP, AGPL-1.0, BSD-4-Clause-UC, LGPL-2.1-only, OFL-1.0, CDL-1.0, LAL-1.3, Sendmail, OGDL-Taiwan-1.0, Zimbra-1.4, Borceux, OSL-3.0, AMDPLPA, CC-BY-NC-SA-3.0, OLDAP-2.1, BSD-2-Clause-FreeBSD, CPOL-1.02, MPL-1.0, blessing, Parity-6.0.0, AFL-3.0, SGI-B-1.0, BSD-2-Clause-Patent, Artistic-1.0-cl8, CC-BY-NC-ND-4.0, Apache-1.1, ErlPL-1.1, OFL-1.0-RFN, CC-BY-NC-3.0, CC-BY-NC-2.0, MakeIndex, Barr, CC-BY-SA-2.1-JP, GFDL-1.2-no-invariants-only, Hippocratic-2.1, Adobe-2006, OSL-2.0, CC-BY-NC-SA-4.0, LGPL-2.1-or-later, PolyForm-Noncommercial-1.0.0, OpenSSL, GPL-3.0-with-GCC-exception, OPL-1.0, BSD-3-Clause-Attribution, Rdisc, MS-RL, EUDatagrid, LGPLLR, AFL-2.0, MIT-Modern-Variant, GFDL-1.3-invariants-only, LiLiQ-R-1.1, CDLA-Permissive-1.0, DRL-1.0, BSD-Source-Code, CC-BY-NC-ND-1.0, GLWTPL, VSL-1.0, CPAL-1.0, HaskellReport, APSL-1.1, GPL-2.0-or-later, BSD-3-Clause-Modification, OLDAP-2.3, OFL-1.1-no-RFN, BitTorrent-1.0, NRL, GFDL-1.2, MirOS, Sleepycat, LPPL-1.1, WTFPL, PolyForm-Small-Business-1.0.0, Caldera, HTMLTIDY, SISSL, MITNFA, 0BSD, CC0-1.0, LGPL-3.0+, CDLA-Sharing-1.0, GPL-2.0-with-bison-exception, EFL-2.0, AFL-1.1, CC-BY-2.0, RPL-1.5, MulanPSL-1.0, GPL-3.0+, HPND-sell-variant, SSH-OpenSSH, OLDAP-1.1, BitTorrent-1.1, Artistic-1.0, SSH-short, CC-BY-3.0-AT, MIT-CMU, GFDL-1.3-no-invariants-or-later, TOSL, MIT-open-group, OLDAP-2.6, GFDL-1.1-only, FreeBSD-DOC, GPL-2.0, Fair, CECILL-1.1, QPL-1.0, DOC, LAL-1.2, LPL-1.02, CERN-OHL-P-2.0, etalab-2.0, FTL, Qhull, BSD-3-Clause-Clear, BSD-3-Clause-No-Military-License, FSFAP, APL-1.0, OLDAP-2.8, TORQUE-1.1, Sendmail-8.23, diffmark, Frameworx-1.0, zlib-acknowledgement, EFL-1.0, IJG, GFDL-1.3-no-invariants-only, Noweb, GFDL-1.3, LGPL-2.1, gSOAP-1.3b, OFL-1.1-RFN, GPL-3.0-with-autoconf-exception, CERN-OHL-1.1, AFL-2.1, MIT-enna, Adobe-Glyph, EPL-1.0, Xerox, OLDAP-2.0.1, MTLL, ImageMagick, psutils, ClArtistic, GFDL-1.3-invariants-or-later, APSL-1.2, Apache-2.0, NIST-PD, Libpng, TAPR-OHL-1.0, ICU, CC-BY-SA-2.5, CC-PDDC, AGPL-3.0-only, OSL-1.1, SugarCRM-1.1.3, FreeImage, W3C-20150513, D-FSL-1.0, RSA-MD, CC-BY-ND-2.0, GPL-2.0-with-GCC-exception, AGPL-3.0-or-later, AGPL-1.0-or-later, iMatix, Plexus, OFL-1.0-no-RFN, NAIST-2003, MIT-feh, ECL-2.0, CC-BY-2.5, XSkat, Linux-OpenIB, Spencer-99, BSD-3-Clause-No-Nuclear-License-2014, CC-BY-NC-ND-3.0-IGO, CC-BY-NC-SA-1.0, GPL-2.0-with-font-exception, Crossword, OLDAP-2.2.2, BSD-2-Clause-NetBSD, GPL-2.0+, CC-BY-4.0, OLDAP-2.0, NOSL, CDDL-1.1, APSL-1.0, EUPL-1.2, Nokia, RHeCos-1.1, GPL-2.0-only, OLDAP-2.7, Vim, SAX-PD, BSD-3-Clause-No-Nuclear-Warranty, NetCDF, dvipdfm, SHL-0.5, LGPL-2.0-only, AAL, Unicode-TOU, LPPL-1.2, xpp, SHL-0.51, NCSA, LGPL-2.0-or-later, CC-BY-3.0, GPL-1.0, W3C, Aladdin, BSD-3-Clause-No-Nuclear-License, GFDL-1.1-or-later, SMPPL, GFDL-1.1, OLDAP-1.4, Condor-1.1, GPL-1.0-only, GPL-3.0, PSF-2.0, Apache-1.0, EPL-2.0, Python-2.0, OLDAP-2.4, PostgreSQL, Net-SNMP, Ruby, OSET-PL-2.1, Dotseqn, CUA-OPL-1.0, Bahyph, LiLiQ-Rplus-1.1, LGPL-2.0+, wxWindows, AGPL-3.0, Abstyles, OLDAP-1.3, NTP-0, OLDAP-2.2, CC-BY-SA-3.0, SWL, BSD-3-Clause-Open-MPI, LGPL-2.1+, GFDL-1.2-invariants-only, Zend-2.0, GFDL-1.1-no-invariants-or-later, mpich2, NLOD-1.0, gnuplot, CERN-OHL-S-2.0, OGL-UK-2.0, NPL-1.1, Zed, VOSTROM, ZPL-2.0, CERN-OHL-W-2.0, CC-BY-NC-SA-2.0, APSL-2.0, LPL-1.0, ANTLR-PD-fallback, libtiff, HPND, GPL-3.0-or-later, Artistic-2.0, Unicode-DFS-2015, CC-BY-NC-4.0, RPL-1.1, CC-BY-SA-1.0, Cube, ODC-By-1.0, copyleft-next-0.3.0, CC-BY-ND-4.0, ZPL-1.1, GFDL-1.3-or-later, CATOSL-1.1, GPL-2.0-with-classpath-exception, LGPL-2.0, BSD-2-Clause-Views, BSL-1.0, CNRI-Jython, Eurosym, CC-BY-SA-3.0-AT, CECILL-C, EPICS, CC-BY-NC-ND-2.0, GD, X11, MPL-1.1, GFDL-1.1-invariants-only, psfrag, RSCPL, YPL-1.0, SGI-B-1.1, CC-BY-ND-1.0, SGI-B-2.0, APAFML, Spencer-94, ISC, MIT-advertising, GFDL-1.2-invariants-or-later, CC-BY-NC-SA-2.5, CC-BY-1.0, OSL-2.1, CrystalStacker, FSFULLR, libselinux-1.0, MulanPSL-2.0, LGPL-3.0, OLDAP-2.5, Artistic-1.0-Perl, AFL-1.2, CAL-1.0, BSD-4-Clause, Interbase-1.0, NPOSL-3.0.']}
oeway commented 2 years ago

I think that's expected, because 0.4.0 force it to be a SPDX license string. You need to change it to BSD-3-Clause or other variations of BSD-3.

oeway commented 2 years ago

Oh, I misunderstand the issue here, I think the issue is that if we provide a yaml file with 0.3.2 version with an invalid license, the validator will pass. However, if the same file used with test-model command, it fails because it try to treat it with a 0.4.0 or maybe because it doesn't know how to upgrade the license field.

@FynnBe @constantinpape

FynnBe commented 2 years ago

yes, in this case--running an older model--it would be required to use an older version of the bioimageio.core package as it always tries to convert a resource to the latest format.