From c2f8afc82949840a9b684a0b1f1c70a2ea504717 Mon Sep 17 00:00:00 2001 From: Joren Retel Date: Tue, 22 Aug 2023 14:13:38 +0200 Subject: [PATCH 1/5] migrated to importlib_metadata to replace pkg_resources is deprecated --- ncls/__init__.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ncls/__init__.py b/ncls/__init__.py index 799590d..34de5f2 100644 --- a/ncls/__init__.py +++ b/ncls/__init__.py @@ -1,7 +1,7 @@ import numpy as np -import pkg_resources +import importlib_metadata -__version__ = pkg_resources.get_distribution("ncls").version +__version__ = importlib_metadata.get_distribution("ncls").version from ncls.src.ncls import NCLS64 # type: ignore from ncls.src.ncls32 import NCLS32 # type: ignore diff --git a/pyproject.toml b/pyproject.toml index 861442a..2b86253 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0.0", "wheel", "cython", "setuptools_scm[toml]>=6.2"] +requires = ["setuptools>=61.0.0", "wheel", "cython", "setuptools_scm[toml]>=6.2", "importlib_metadata"] build-backend = "setuptools.build_meta" [project] From 618f7c852c76158d0b114b0e0ffc1785686cbe22 Mon Sep 17 00:00:00 2001 From: Joren Retel Date: Tue, 22 Aug 2023 14:22:22 +0200 Subject: [PATCH 2/5] migrated to importlib_metadata to replace pkg_resources is deprecated --- ncls/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ncls/__init__.py b/ncls/__init__.py index 34de5f2..7f4a0d6 100644 --- a/ncls/__init__.py +++ b/ncls/__init__.py @@ -1,7 +1,7 @@ import numpy as np import importlib_metadata -__version__ = importlib_metadata.get_distribution("ncls").version +__version__ = importlib_metadata.version("ncls") from ncls.src.ncls import NCLS64 # type: ignore from ncls.src.ncls32 import NCLS32 # type: ignore From 08071ae67ea0fb35a62af44a8774bf56478dc52a Mon Sep 17 00:00:00 2001 From: Joren Retel Date: Tue, 22 Aug 2023 14:44:05 +0200 Subject: [PATCH 3/5] fixing isort --- ncls/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ncls/__init__.py b/ncls/__init__.py index 7f4a0d6..960ae50 100644 --- a/ncls/__init__.py +++ b/ncls/__init__.py @@ -1,5 +1,5 @@ -import numpy as np import importlib_metadata +import numpy as np __version__ = importlib_metadata.version("ncls") From dda07c917ba6519525c8f46a12fe1d96cb57946d Mon Sep 17 00:00:00 2001 From: Joren Retel Date: Tue, 22 Aug 2023 14:48:24 +0200 Subject: [PATCH 4/5] installing importlib_metadata on github actions to run mypy --- .github/workflows/install_doctest_lint_typecheck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/install_doctest_lint_typecheck.yml b/.github/workflows/install_doctest_lint_typecheck.yml index f9e4daa..f05dd64 100644 --- a/.github/workflows/install_doctest_lint_typecheck.yml +++ b/.github/workflows/install_doctest_lint_typecheck.yml @@ -76,5 +76,6 @@ jobs: - name: mypy run: | pip install numpy # for the typing stubs + pip install importlib_metadata # for the typing stubs python -m pip install pandas-stubs types-setuptools mypy ncls From 00bb2a4c1719a6a060e3da74de2f35fd2400be75 Mon Sep 17 00:00:00 2001 From: Joren Retel Date: Tue, 22 Aug 2023 15:01:43 +0200 Subject: [PATCH 5/5] put importlib_metadata in correct requirements --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b86253..504286c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0.0", "wheel", "cython", "setuptools_scm[toml]>=6.2", "importlib_metadata"] +requires = ["setuptools>=61.0.0", "wheel", "cython", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" [project] @@ -20,7 +20,7 @@ classifiers = [ "Topic :: Scientific/Engineering" ] keywords = ["ncls", "interval-tree", "genomics"] -dependencies = ["numpy"] +dependencies = ["numpy", "importlib_metadata"] [project.optional-dependencies] dev = ["black", "bumpver", "isort", "pip-tools", "pytest"]