File: _helpers.py

package info (click to toggle)
python-asdf 2.14.3-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,280 kB
  • sloc: python: 16,612; makefile: 124
file content (17 lines) | stat: -rw-r--r-- 577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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:
        raise ValueError(
            "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),
            )
        )
    return version