summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Caruso <carusot42@gmail.com>2020-07-29 02:08:19 -0400
committerGitHub <noreply@github.com>2020-07-28 23:08:19 -0700
commit8f7e31450835bca5d9a8bb4de252efba6f4b7b10 (patch)
tree3c9616e561732b81707b6d24ddf40d861dae7df6
parent80bf05a3b3be8eb86cbc90dd5e9214a61ba2edb3 (diff)
Move from humanize to pendulum library for displaying query durations (#1199)
-rw-r--r--AUTHORS1
-rw-r--r--changelog.rst1
-rw-r--r--pgcli/main.py6
-rw-r--r--setup.py2
4 files changed, 6 insertions, 4 deletions
diff --git a/AUTHORS b/AUTHORS
index 12298156..4be4126a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -111,6 +111,7 @@ Contributors:
* Igor Kim (igorkim)
* Anthony DeBarros (anthonydb)
* Seungyong Kwak (GUIEEN)
+ * Tom Caruso (tomplex)
Creator:
--------
diff --git a/changelog.rst b/changelog.rst
index b8d23474..e3c2bee9 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -15,6 +15,7 @@ Bug fixes:
* Minor typo fixes in `pgclirc`. (Thanks: `anthonydb`_)
* Fix for list index out of range when executing commands from a file (#1193). (Thanks: `Irina Truong`_)
+* Move from `humanize` to `pendulum` for displaying query durations (#1015)
3.0.0
=====
diff --git a/pgcli/main.py b/pgcli/main.py
index 080b2fd2..cb41b2b1 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -15,7 +15,7 @@ import logging
import threading
import shutil
import functools
-import humanize
+import pendulum
import datetime as dt
import itertools
import platform
@@ -692,9 +692,9 @@ class PGCli(object):
"Time: %0.03fs (%s), executed in: %0.03fs (%s)"
% (
query.total_time,
- humanize.time.naturaldelta(query.total_time),
+ pendulum.Duration(seconds=query.total_time).in_words(),
query.execution_time,
- humanize.time.naturaldelta(query.execution_time),
+ pendulum.Duration(seconds=query.execution_time).in_words(),
)
)
else:
diff --git a/setup.py b/setup.py
index 711253e7..a3079298 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ install_requirements = [
"psycopg2 >= 2.8",
"sqlparse >=0.3.0,<0.4",
"configobj >= 5.0.6",
- "humanize >= 0.5.1",
+ "pendulum>=2.1.0",
"cli_helpers[styles] >= 2.0.0",
]