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..0bcd5b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,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..721c164 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ 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\"", @@ -53,7 +53,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 +100,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: