From b6cb9f8b531771a0b95f58545f94be849e7207da Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Fri, 17 Nov 2023 09:56:07 -0500 Subject: [PATCH 1/2] Replace pkg_resources dep with importlib --- stactask/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stactask/__init__.py b/stactask/__init__.py index d50ef90..bed045c 100644 --- a/stactask/__init__.py +++ b/stactask/__init__.py @@ -1,8 +1,12 @@ # flake8: noqa -import pkg_resources +from importlib.metadata import PackageNotFoundError, version -__version__ = pkg_resources.get_distribution(__package__).version +try: + __version__ = version("stactask") +except PackageNotFoundError: + # package is not installed + pass from .task import Task From e53f4ea2af15defd6ae16dbc19fc4b082eaccb89 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Fri, 17 Nov 2023 09:58:25 -0500 Subject: [PATCH 2/2] Remove flake8 references --- .flake8 | 18 ------------------ stactask/__init__.py | 2 -- 2 files changed, 20 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index c33acaf..0000000 --- a/.flake8 +++ /dev/null @@ -1,18 +0,0 @@ -[flake8] -max-line-length = 125 - -## IGNORES - -# E126: yapf conflicts with "continuation line over-indented for hanging indent" - -# E127: flake8 reporting incorrect continuation line indent errors -# on multi-line and multi-level indents - -# W503: flake8 reports this as incorrect, and scripts/format_code -# changes code to it, so let format_code win. - -ignore = E126,E127,W503 - -exclude = - docs/build - .tox diff --git a/stactask/__init__.py b/stactask/__init__.py index bed045c..d68fab3 100644 --- a/stactask/__init__.py +++ b/stactask/__init__.py @@ -1,5 +1,3 @@ -# flake8: noqa - from importlib.metadata import PackageNotFoundError, version try: