Merge "Remove Python 3.8 support"
This commit is contained in:
commit
12d733a1cc
@ -33,16 +33,10 @@ import functools
|
||||
import itertools
|
||||
import uuid
|
||||
from xmlrpc import client as xmlrpclib
|
||||
import zoneinfo
|
||||
|
||||
import msgpack
|
||||
|
||||
try:
|
||||
import zoneinfo
|
||||
except ImportError:
|
||||
# zoneinfo is available in Python >= 3.9
|
||||
from pytz import timezone
|
||||
zoneinfo = None
|
||||
|
||||
from oslo_utils import importutils
|
||||
|
||||
netaddr = importutils.try_import("netaddr")
|
||||
@ -243,11 +237,7 @@ class DateTimeHandler(object):
|
||||
'microsecond': dt.microsecond,
|
||||
}
|
||||
if dt.tzinfo:
|
||||
if zoneinfo:
|
||||
tz = str(dt.tzinfo)
|
||||
else:
|
||||
tz = dt.tzinfo.tzname(None)
|
||||
dct['tz'] = tz
|
||||
dct['tz'] = str(dt.tzinfo)
|
||||
return dumps(dct, registry=self._registry)
|
||||
|
||||
def deserialize(self, blob):
|
||||
@ -274,12 +264,7 @@ class DateTimeHandler(object):
|
||||
second=dct['second'],
|
||||
microsecond=dct['microsecond'])
|
||||
if 'tz' in dct and dct['tz']:
|
||||
if zoneinfo:
|
||||
tzinfo = zoneinfo.ZoneInfo(dct['tz'])
|
||||
dt = dt.replace(tzinfo=tzinfo)
|
||||
else:
|
||||
tzinfo = timezone(dct['tz'])
|
||||
dt = tzinfo.localize(dt)
|
||||
dt = dt.replace(tzinfo=zoneinfo.ZoneInfo(dct['tz']))
|
||||
return dt
|
||||
|
||||
|
||||
|
5
releasenotes/notes/remove-py38-2c724027a885cf0b.yaml
Normal file
5
releasenotes/notes/remove-py38-2c724027a885cf0b.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
Support for Python 3.8 has been removed. Now the minimum python version
|
||||
supported is 3.9 .
|
@ -6,5 +6,4 @@
|
||||
pbr>=2.0.0 # Apache-2.0
|
||||
msgpack>=0.5.2 # Apache-2.0
|
||||
oslo.utils>=3.33.0 # Apache-2.0
|
||||
pytz>=2013.6;python_version<"3.9" # MIT
|
||||
tzdata>=2022.4;python_version>="3.9" # MIT
|
||||
tzdata>=2022.4 # MIT
|
||||
|
@ -6,7 +6,7 @@ description_file =
|
||||
author = OpenStack
|
||||
author_email = openstack-discuss@lists.openstack.org
|
||||
home_page = https://docs.openstack.org/oslo.serialization/latest/
|
||||
python_requires = >=3.8
|
||||
python_requires = >=3.9
|
||||
classifier =
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
@ -15,7 +15,6 @@ classifier =
|
||||
Operating System :: POSIX :: Linux
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
|
Loading…
Reference in New Issue
Block a user