From ff650bc872bcd14b99a3d284bff2754e3a439f26 Mon Sep 17 00:00:00 2001 From: Andrew DeOrio Date: Fri, 29 Mar 2024 09:48:45 -0400 Subject: [PATCH] Get version with importlib.metadata --- madoop/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/madoop/__main__.py b/madoop/__main__.py index 0b2c53d..cf33ecd 100644 --- a/madoop/__main__.py +++ b/madoop/__main__.py @@ -4,12 +4,12 @@ """ import argparse +import importlib.metadata import logging import pathlib import shutil import sys import textwrap -import pkg_resources from .mapreduce import mapreduce from .exceptions import MadoopError @@ -21,10 +21,10 @@ def main(): ) optional_args = parser.add_argument_group('optional arguments') - version = pkg_resources.get_distribution("madoop").version + optional_args.add_argument( '--version', action='version', - version=f'Madoop {version}' + version=f'Madoop {importlib.metadata.version("madoop")}' ) optional_args.add_argument( '--example', action=ExampleAction, nargs=0,