From b1f29ac976d6c74259f75102b255cc17be8ae188 Mon Sep 17 00:00:00 2001 From: Lennart Regebro Date: Mon, 16 Oct 2023 10:24:28 +0200 Subject: [PATCH] We can use importlib.metadata now (#124) --- CHANGES.rst | 2 ++ README.rst | 2 ++ xmldiff/main.py | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 57ed36b..cdf4ec3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ Changes - Changed the comparison to make accurate and standard more accurate, although fast gets less accurate as a result. +- Changed usage of deprecated `pkg_resources` package to `importlib.metadata`. + 2.6.3 (2023-05-21) ------------------ diff --git a/README.rst b/README.rst index 200438b..077575e 100644 --- a/README.rst +++ b/README.rst @@ -88,5 +88,7 @@ Contributors * Filip Demski, glamhoth@protonmail.com + * Jacek ChaƂupka, krunchfrompoland@gmail.com + The diff algorithm is based on "`Change Detection in Hierarchically Structured Information `_", and the text diff is using Google's ``diff_match_patch`` algorithm. diff --git a/xmldiff/main.py b/xmldiff/main.py index 0288d86..7849705 100644 --- a/xmldiff/main.py +++ b/xmldiff/main.py @@ -1,11 +1,11 @@ """All major API points and command-line tools""" -import pkg_resources +from importlib import metadata from argparse import ArgumentParser, ArgumentTypeError from lxml import etree from xmldiff import diff, formatting, patch -__version__ = pkg_resources.require("xmldiff")[0].version +__version__ = metadata.version("xmldiff") FORMATTERS = { "diff": formatting.DiffFormatter,