Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Added
* Add ``ST2_USE_DEBUGGER`` env var as alternative to the ``--use-debugger`` cli flag. #5675
Contributed by @cognifloyd

* Added purging of old tokens. #56791
* Added purging of old tokens. #5679
Contributed by Amanda McGuinness (@amanda11 intive)

Changed
Expand Down Expand Up @@ -87,6 +87,10 @@ Changed

Contributed by @cognifloyd

* Move from udatetime to ciso8601 for date functionality ahead of supporting python3.9 #5692
Contributed by Amanda McGuinness (@amanda11 intive)


Removed
~~~~~~~

Expand Down
1 change: 0 additions & 1 deletion fixed-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ psutil==5.8.0
python-dateutil==2.8.1
python-statsd==2.1.0
orjson==3.5.2
udatetime==0.0.16
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ argcomplete==1.12.2
bcrypt==3.2.0
cffi<1.15.0
chardet<3.1.0
ciso8601
cryptography==3.4.7
decorator==4.4.2
dnspython>=1.16.0,<2.0.0
Expand Down Expand Up @@ -73,7 +74,6 @@ stevedore==1.30.1
tenacity>=3.2.1,<7.0.0
tooz==2.8.0
typing-extensions<4.2
udatetime==0.0.16
unittest2
webob==1.8.7
webtest
Expand Down
2 changes: 1 addition & 1 deletion st2common/in-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ webob
jsonpath-rw
pyOpenSSL
python-statsd
udatetime
ciso8601
orjson
# Note: amqp is used by kombu, this needs to be added here to be picked up by
# requirements fixate script.
Expand Down
2 changes: 1 addition & 1 deletion st2common/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ amqp==5.0.6
apscheduler==3.7.0
cffi<1.15.0
chardet<3.1.0
ciso8601
cryptography==3.4.7
decorator==4.4.2
dnspython>=1.16.0,<2.0.0
Expand Down Expand Up @@ -43,7 +44,6 @@ six==1.13.0
st2-rbac-backend@ git+https://github.com/StackStorm/st2-rbac-backend.git@master
tenacity>=3.2.1,<7.0.0
tooz==2.8.0
udatetime==0.0.16
webob==1.8.7
zake==0.2.2
zstandard==0.15.2
9 changes: 3 additions & 6 deletions st2common/st2common/util/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import datetime

import udatetime
import ciso8601

import dateutil.tz
import dateutil.parser
Expand Down Expand Up @@ -83,16 +83,13 @@ def parse(value, preserve_original_tz=False):

:rtype: ``datetime.datetime``
"""
# We use udatetime since it's much faster than non-C alternatives
# We use ciso8601 since it's much faster than non-C alternatives
# For compatibility reasons we still fall back to datetutil, but this should rarely happen
# rfc3339 covers 90% of the iso8601 (it's a subset of it)
original_value = value

try:
if " " in value:
# udatetime doesn't support notation with whitespace so we replace it with T
value = value.replace(" ", "T")
dt = udatetime.from_string(str(value))
dt = ciso8601.parse_datetime(str(value))
except Exception:
dt = dateutil.parser.parse(str(original_value))

Expand Down