diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2f86311..f245b7f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: - windows-latest - macOS-latest python-version: - - "3.7" + - "3.8" - "3.11" networkx-version: - "1.*" diff --git a/obonet/__init__.py b/obonet/__init__.py index 77cdfc2..201e919 100644 --- a/obonet/__init__.py +++ b/obonet/__init__.py @@ -8,12 +8,11 @@ def _get_version() -> str | None: - # https://github.com/pypa/setuptools_scm#retrieving-package-version-at-runtime - from pkg_resources import DistributionNotFound, get_distribution + from importlib.metadata import PackageNotFoundError, version try: - return str(get_distribution("obonet").version) - except DistributionNotFound: + return version("obonet") + except PackageNotFoundError: return None diff --git a/pyproject.toml b/pyproject.toml index 9d2fc6f..ce7cacc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ keywords = [ "parser", "network", ] -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = ["networkx"] dynamic = ["version"] @@ -54,7 +54,7 @@ include-package-data = true license-files = ["LICENSE.md"] [tool.ruff] -target-version = "py37" +target-version = "py38" ignore = [ "E501", # line-too-long (black should handle) ]