Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pkg_resources from setuptools by Python standard lib #673

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading