From 2346b76440026521cc7d7ca683274db3a4437428 Mon Sep 17 00:00:00 2001 From: CodyCBakerPhD Date: Sun, 14 Jul 2024 22:41:41 -0400 Subject: [PATCH] error debugs --- src/dandi_s3_log_parser/_ip_utils.py | 4 ++-- src/dandi_s3_log_parser/_s3_log_line_parser.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dandi_s3_log_parser/_ip_utils.py b/src/dandi_s3_log_parser/_ip_utils.py index e844d0d..0ae8500 100644 --- a/src/dandi_s3_log_parser/_ip_utils.py +++ b/src/dandi_s3_log_parser/_ip_utils.py @@ -3,9 +3,9 @@ import ipaddress import hashlib import traceback -import importlib import datetime from typing import List +from importlib.metadata import version as importlib_version import ipinfo import requests @@ -103,7 +103,7 @@ def _get_region_from_ip_address(ip_hash_to_region: dict[str, str], ip_address: s errors_folder_path = DANDI_S3_LOG_PARSER_BASE_FOLDER_PATH / "errors" errors_folder_path.mkdir(exist_ok=True) - dandi_s3_log_parser_version = importlib.metadata.version("dandi_s3_log_parser") + dandi_s3_log_parser_version = importlib_version(distribution_name="dandi_s3_log_parser") date = datetime.datetime.now().strftime("%y%m%d") lines_errors_file_path = errors_folder_path / f"v{dandi_s3_log_parser_version}_{date}_ipinfo_errors.txt" diff --git a/src/dandi_s3_log_parser/_s3_log_line_parser.py b/src/dandi_s3_log_parser/_s3_log_line_parser.py index 3b9d64b..3aa51f2 100644 --- a/src/dandi_s3_log_parser/_s3_log_line_parser.py +++ b/src/dandi_s3_log_parser/_s3_log_line_parser.py @@ -16,9 +16,9 @@ import collections import datetime -import importlib import pathlib import re +from importlib.metadata import version as importlib_version from ._config import DANDI_S3_LOG_PARSER_BASE_FOLDER_PATH from ._ip_utils import _get_region_from_ip_address @@ -104,7 +104,7 @@ def _get_full_log_line( errors_folder_path = DANDI_S3_LOG_PARSER_BASE_FOLDER_PATH / "errors" errors_folder_path.mkdir(exist_ok=True) - dandi_s3_log_parser_version = importlib.metadata.version("dandi_s3_log_parser") + dandi_s3_log_parser_version = importlib_version(distribution_name="dandi_s3_log_parser") date = datetime.datetime.now().strftime("%y%m%d") lines_errors_file_path = errors_folder_path / f"v{dandi_s3_log_parser_version}_{date}_lines_errors.txt"