How to use the setupmeta.license.determined_license function in setupmeta

To help you get started, we’ve selected a few setupmeta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / tests / test_license.py View on Github external
def test_license():
    assert license.determined_license(None) is None
    assert license.determined_license("") is None
    assert license.determined_license("blah blah version 5") is None
    assert license.determined_license("... Version 2.0 http://www.apache.org/licenses/ ...") == "Apache 2.0"
    assert license.determined_license(BSD_SAMPLE) == "BSD"
    assert license.determined_license("MIT License ...") == "MIT"
    assert license.determined_license("Mozilla Public License Version 2.0 ...") == "MPL"
    assert license.determined_license("GNU AFFERO GENERAL PUBLIC LICENSE Version 3 ...") == "AGPLv3"
    assert license.determined_license("GNU GENERAL PUBLIC LICENSE Version 3 ...") == "GPLv3"
    assert license.determined_license("GNU LESSER GENERAL PUBLIC LICENSE Version 3 ...") == "LGPLv3"
github zsimic / setupmeta / setupmeta / model.py View on Github external
def auto_fill_license(self, key="license"):
        """ Try to auto-determine the license """
        contents, _ = find_contents(["LICENSE*"], limit=20)
        short = determined_license(contents)
        if short:
            self.auto_fill("license", short)