From 92a068331a7e3bbf4557da5a9cd071c167e3ff0d Mon Sep 17 00:00:00 2001 From: why-not-try-calmer Date: Wed, 15 Feb 2023 10:10:26 +0100 Subject: [PATCH] Added runtime check+exception, explicit Python setup in CI, now requires 3.10 for type hints --- .github/workflows/test_pytx.yml | 4 ++++ pytransifex/__init__.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/test_pytx.yml b/.github/workflows/test_pytx.yml index 2814d27..f76e586 100644 --- a/.github/workflows/test_pytx.yml +++ b/.github/workflows/test_pytx.yml @@ -15,6 +15,10 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Run CI tests env: organization: ${{ secrets.ORGANIZATION }} diff --git a/pytransifex/__init__.py b/pytransifex/__init__.py index ca0e42e..5a36257 100755 --- a/pytransifex/__init__.py +++ b/pytransifex/__init__.py @@ -1,3 +1,9 @@ import logging +from sys import version_info + +if version_info.major != 3 or version_info.minor < 10: + raise RuntimeError( + f"This program requires Python 3.8 at least, but found {version_info.major}.{version_info.minor}" + ) logging.basicConfig(level=logging.INFO)