Stop to use the __future__ module.

The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
This commit is contained in:
Hervé Beraud 2020-06-02 20:06:38 +02:00
parent 59c5d493bb
commit f72403ad3c
7 changed files with 0 additions and 8 deletions

View File

@ -13,7 +13,6 @@
# limitations under the License.
"""Adapter classes and utilities for use with Reactive interfaces"""
from __future__ import absolute_import
import collections
import itertools

View File

@ -13,7 +13,6 @@
# limitations under the License.
# need/want absolute imports for the package imports to work properly
from __future__ import absolute_import
import netaddr
import charmhelpers.core.hookenv as hookenv

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from setuptools import setup, find_packages

View File

@ -19,8 +19,6 @@
# mock out some charmhelpers libraries as they have apt install side effects
# sys.modules['charmhelpers.contrib.openstack.utils'] = mock.MagicMock()
# sys.modules['charmhelpers.contrib.network.ip'] = mock.MagicMock()
from __future__ import absolute_import
import mock
import charms_openstack.devices.pci as pci

View File

@ -19,7 +19,6 @@
# mock out some charmhelpers libraries as they have apt install side effects
# sys.modules['charmhelpers.contrib.openstack.utils'] = mock.MagicMock()
# sys.modules['charmhelpers.contrib.network.ip'] = mock.MagicMock()
from __future__ import absolute_import
import unit_tests.utils as utils

View File

@ -19,7 +19,6 @@
# mock out some charmhelpers libraries as they have apt install side effects
# sys.modules['charmhelpers.contrib.openstack.utils'] = mock.MagicMock()
# sys.modules['charmhelpers.contrib.network.ip'] = mock.MagicMock()
from __future__ import absolute_import
import unit_tests.utils as utils

View File

@ -18,7 +18,6 @@
# mock out some charmhelpers libraries as they have apt install side effects
# sys.modules['charmhelpers.contrib.openstack.utils'] = mock.MagicMock()
# sys.modules['charmhelpers.contrib.network.ip'] = mock.MagicMock()
from __future__ import absolute_import
import unittest