File: _helpers.py

package info (click to toggle)
python-asdf 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,032 kB
  • sloc: python: 24,068; makefile: 123
file content (15 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from . import versioning
from ._version import version as asdf_package_version


def validate_version(version):
    # Account for the possibility of AsdfVersion
    version = str(version)
    if version not in versioning.supported_versions:
        msg = "ASDF Standard version {} is not supported by asdf=={}.  Available ASDF Standard versions: {}".format(
            version,
            asdf_package_version,
            ", ".join(str(v) for v in versioning.supported_versions),
        )
        raise ValueError(msg)
    return version