How to use the datapackage.util.parse_version function in datapackage

To help you get started, we’ve selected a few datapackage 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 frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version_invalid_minor():
    """Check that an error is raised when the minor version is invalid"""
    util.parse_version("1.0-alpha.0")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version_invalid_prerelease():
    """Check that an error is raised when the prerelease version is invalid"""
    util.parse_version("1.0.0-alpha~1")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")
github frictionlessdata / datapackage-py / tests / test_util.py View on Github external
def test_parse_version():
    """Try parsing a variety of different version strings"""
    assert util.parse_version("1.0.0") == (1, 0, 0, None, None)
    assert util.parse_version("1.0.0-alpha") == (1, 0, 0, "alpha", None)
    assert util.parse_version("1.0.0-alpha.1") == (1, 0, 0, "alpha.1", None)
    assert util.parse_version("1.0.0-0.3.7") == (1, 0, 0, "0.3.7", None)
    assert util.parse_version("1.0.0-x.7.z.92") == (1, 0, 0, "x.7.z.92", None)
    assert util.parse_version("1.0.0-alpha+001") == (1, 0, 0, "alpha", "001")
    assert util.parse_version("1.0.0+20130313144700") == (1, 0, 0, None, "20130313144700")
    assert util.parse_version("1.0.0-beta+exp.sha.5114f85") == (1, 0, 0, "beta", "exp.sha.5114f85")