From 43ba4dc89d138e1509411cd3f99abec26fa49169 Mon Sep 17 00:00:00 2001 From: fbernhart <70264417+fbernhart@users.noreply.github.com> Date: Sat, 6 Mar 2021 02:22:44 +0100 Subject: [PATCH] Remove dateutil as dependency --- libyear/pypi.py | 6 +++--- setup.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libyear/pypi.py b/libyear/pypi.py index 11e8a4d..f7217ae 100644 --- a/libyear/pypi.py +++ b/libyear/pypi.py @@ -1,6 +1,6 @@ from distutils.version import LooseVersion -import dateutil.parser +from datetime import datetime import requests @@ -73,7 +73,7 @@ def get_version_release_dates(name, version, version_lt): print(f'Latest version of {name!r} has no upload time.') return None, None, None, None - latest_version_date = dateutil.parser.parse(latest_version_date) + latest_version_date = datetime.strptime(latest_version_date, "%Y-%m-%dT%H:%M:%S.%fZ") if version not in releases: return None, latest_version_date, latest_version, latest_version_date @@ -83,7 +83,7 @@ def get_version_release_dates(name, version, version_lt): print(f'Used release of {name}=={version} has no upload time.') return None, None, None, None - version_date = dateutil.parser.parse(version_date) + version_date = datetime.strptime(version_date, "%Y-%m-%dT%H:%M:%S.%fZ") return version, version_date, latest_version, latest_version_date diff --git a/setup.py b/setup.py index 1f80311..5e8fa52 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,6 @@ install_requires=[ "requests>=2.0.0", "prettytable>=0.7.2", - "python-dateutil>=2.7.0", ], setup_requires=["pytest-runner"], )