diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 186ed90..70a0925 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: '3.11' - name: Install build dependencies run: python -m pip install build wheel - name: Build distributions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 558701c..7eb6694 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: os: - ubuntu-latest python-version: - - '3.7' - '3.8' - '3.9' - '3.10' @@ -109,7 +108,7 @@ jobs: with: # Match minimal supported Python version # to make sure we're not using unparseable syntax - python-version: '3.7' + python-version: '3.8' - name: Build run: | diff --git a/pyproject.toml b/pyproject.toml index a3bc25c..2271da3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,10 +19,9 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ "rich>=10.13.0", - "importlib-metadata;python_version < \"3.8\"", "stdlib-list>=0.8;python_version < \"3.10\"", ] @@ -53,7 +52,7 @@ exclude = [ namespaces = false [tool.ruff] -target-version = "py37" # https://github.com/charliermarsh/ruff/issues/2039 +target-version = "py38" # https://github.com/charliermarsh/ruff/issues/2039 exclude = ["*__init__.py"] ignore = ["E501"] select = [ @@ -100,7 +99,7 @@ omit = [ parallel = true [tool.mypy] -python_version = "3.7" +python_version = "3.8" show_error_codes = true pretty = true warn_return_any = true diff --git a/wxc/api.py b/wxc/api.py index b0dfcf1..a3e6876 100644 --- a/wxc/api.py +++ b/wxc/api.py @@ -142,10 +142,7 @@ def get_version(package_name: str) -> str: continue return retv - if sys.version_info >= (3, 8): - import importlib.metadata as md - else: - import importlib_metadata as md + import importlib.metadata as md try: return str(md.version(package_name)) diff --git a/wxc/cli.py b/wxc/cli.py index 2cc6fde..f00eecf 100644 --- a/wxc/cli.py +++ b/wxc/cli.py @@ -58,10 +58,8 @@ def main(argv: list[str] | None = None) -> int: # this is a simple module request # let's try to get the result without actually importing it first if args.version: - if sys.version_info >= (3, 8): - import importlib.metadata as md - else: - import importlib_metadata as md + import importlib.metadata as md + try: version = md.version(args.name) except md.PackageNotFoundError: