From 15f55343bc50bea9cb731211f9afd8ddb7e841dd Mon Sep 17 00:00:00 2001 From: Tucker Kern Date: Mon, 7 Aug 2023 22:04:05 +0000 Subject: [PATCH 1/2] Set minimum Python version to 3.8. Update actions to run on unittests on 3.8->3.11 --- .github/workflows/checks.yml | 9 +++++++-- msmart/__init__.py | 7 +------ pyproject.toml | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9bbe0ec3..73c97787 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - uses: actions/cache@v3 with: path: ~/.cache/pip @@ -24,13 +24,18 @@ jobs: run-unittest: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} cache: "pip" - run: | + python -c "import sys; print(sys.version)" python -m pip install --upgrade pip pip install --editable . - run: python -m unittest diff --git a/msmart/__init__.py b/msmart/__init__.py index b4210f76..4f46a573 100644 --- a/msmart/__init__.py +++ b/msmart/__init__.py @@ -1,8 +1,3 @@ -import sys - -if sys.version_info >= (3, 8): - from importlib import metadata -else: - import importlib_metadata as metadata +from importlib import metadata __version__ = metadata.version("msmart") diff --git a/pyproject.toml b/pyproject.toml index 83887fcc..6a0cec48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ {name = "mac_zhou"}, {email = "mac.zfl@gmail.com"}, ] -requires-python = ">=3.5" +requires-python = ">=3.8" license = {text = "MIT"} classifiers = [ "Programming Language :: Python :: 3", @@ -21,8 +21,7 @@ dependencies = [ "click", "pycryptodome", "requests", - "ifaddr", - "importlib-metadata; python_version<'3.8'", + "ifaddr" ] dynamic = ["version"] From bc36fa123e170291998dcc57e109e5d32f15e0c4 Mon Sep 17 00:00:00 2001 From: Tucker Kern Date: Mon, 7 Aug 2023 16:20:18 -0600 Subject: [PATCH 2/2] Tweak run line for printing Python version --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 73c97787..dbec9e6c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -34,8 +34,8 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: "pip" + - run: python -c "import sys; print(sys.version)" - run: | - python -c "import sys; print(sys.version)" python -m pip install --upgrade pip pip install --editable . - run: python -m unittest