Skip to content

Commit

Permalink
Add python version check to the scripts (#28)
Browse files Browse the repository at this point in the history
* add check to host-check/xr-compose

* disable=wrong-import-position

* ran isort
  • Loading branch information
yashagacisco authored Apr 5, 2023
1 parent ef617e9 commit 26a43fe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
19 changes: 18 additions & 1 deletion scripts/host-check
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
Check that the host is set up correctly for running XRd containers.
"""

import sys


if sys.version_info < (3, 7):
print(
"Your python version {} has reached end-of-life.\n"
"Please ensure you have 'python3' at version 3.7 or higher on your "
"PATH (check with 'python3 --version').".format(
".".join(str(x) for x in sys.version_info[:2]),
),
file=sys.stderr,
)
sys.exit(1)

# pylint: disable=wrong-import-position
import argparse
import enum
import functools
Expand All @@ -28,7 +43,6 @@ import os
import re
import shlex
import subprocess
import sys
import textwrap
from dataclasses import dataclass
from typing import (
Expand All @@ -46,6 +60,9 @@ from typing import (
)


# pylint: enable=wrong-import-position


# -----------------------------------------------------------------------------
# Globals
# -----------------------------------------------------------------------------
Expand Down
19 changes: 18 additions & 1 deletion scripts/xr-compose
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,37 @@ specification of PCI interfaces).
"""

import sys


if sys.version_info < (3, 7):
print(
"Your python version {} has reached end-of-life.\n"
"Please ensure you have 'python3' at version 3.7 or higher on your "
"PATH (check with 'python3 --version').".format(
".".join(str(x) for x in sys.version_info[:2]),
),
file=sys.stderr,
)
sys.exit(1)

# pylint: disable=wrong-import-position
import argparse
import enum
import logging
import os
import re
import subprocess
import sys
import typing
from collections import OrderedDict
from typing import Any, Dict, Iterable, List, Optional, Union

import yaml


# pylint: enable=wrong-import-position


# --------------
# Global variables
# --------------
Expand Down

0 comments on commit 26a43fe

Please sign in to comment.