Skip to content

Commit

Permalink
Merge pull request #673 from prospector-dev/import-lib
Browse files Browse the repository at this point in the history
Replace pkg_resources from setuptools by Python standard lib
  • Loading branch information
sbrunner authored Oct 7, 2024
2 parents 56e16cc + f9adde9 commit 46e11c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# import os
# import sys

import pkg_resources
import importlib.metadata

version = pkg_resources.get_distribution("prospector").version
version = importlib.metadata.version("prospector")

release = ".".join(version.split(".")[:2])

Expand Down
4 changes: 2 additions & 2 deletions prospector/blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# the same line. For example, both pyflakes and pylint will generate an
# "Unused Import" warning on the same line. This is obviously redundant, so we
# remove duplicates.
import pkgutil
from collections import defaultdict

import pkg_resources
import yaml

__all__ = (
Expand Down Expand Up @@ -98,7 +98,7 @@ def blend(messages, blend_combos=None):


def get_default_blend_combinations():
combos = yaml.safe_load(pkg_resources.resource_string(__name__, "blender_combinations.yaml"))
combos = yaml.safe_load(pkgutil.get_data(__name__, "blender_combinations.yaml"))
combos = combos.get("combinations", [])

defaults = []
Expand Down
5 changes: 3 additions & 2 deletions prospector/config/configuration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# flake8: noqa
import pkg_resources
import importlib.metadata

import setoptconf as soc

from prospector.config.datatype import OutputChoice
Expand All @@ -8,7 +9,7 @@

__all__ = ("build_manager",)

_VERSION = pkg_resources.get_distribution("prospector").version
_VERSION = importlib.metadata.version("prospector")


def build_manager():
Expand Down

0 comments on commit 46e11c8

Please sign in to comment.