Module Expr Str ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr keyword NameLoad keyword NameLoad Assert CompareIs Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A Assertions related to Python packaging. hospital.utils.packaging python_runtime_version hospital.utils.packaging supports_python_version assert_supported_python_version N/A N/A distribution version msg N/A None None N/A N/A Assert that ``distribution`` claims support for Python ``version``.

    Typically used to check theorical compatibility between runtime Python
    version and installed Python software.

    distribution
      Distribution object, as returned by ``pkg_resources.get_distribution()``.

      >>> from hospital import assert_supported_python_version
      >>> import pkg_resources
      >>> hospital_dist = pkg_resources.get_distribution('hospital')
      >>> assert_supported_python_version(hospital_dist)

    version
      Python version, as a string. If omitted or `None` (the default), the
      current Python version is retrieved from ``sys.version_info``.

      As an example, `hospital` claims support for Python 2.7 and 3.3, but not
      for version 2.6.

      >>> assert_supported_python_version(hospital_dist, version='2.7')
      >>> assert_supported_python_version(hospital_dist, version='3.3')
      >>> try:
      ...     assert_supported_python_version(hospital_dist, version='2.6')
      ... except AssertionError:
      ...     pass

    See also :class:`~hospital.healthchecks.packaging.DistributionHealthCheck`.

     N/A N/A version None N/A N/A version N/A python_runtime_version N/A N/A msg None N/A N/A msg N/A N/A Python distribution of {distribution} does not claim support of Python version {version} format distribution distribution version version N/A N/A N/A supports_python_version distribution version True msg N/A