diff options
author | Yilei Yang <yileiyang@google.com> | 2022-05-06 09:34:22 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-05-06 09:34:51 -0700 |
commit | 14886acdf41f63f44c6bd79cf2ce7ad7eaec7d44 (patch) | |
tree | d43e8689e73ab53aa7e095fbe881ceba1a136170 | |
parent | ae7fd0931cb663bad093633ca2a527bde146e899 (diff) | |
download | absl-py-14886acdf41f63f44c6bd79cf2ce7ad7eaec7d44.tar.gz |
Remove the py2/py3 compatibility module _collections_abc.
PiperOrigin-RevId: 447005334
Change-Id: Iea86a969093640a18663d3d135648329c45e9954
-rw-r--r-- | absl/BUILD | 7 | ||||
-rw-r--r-- | absl/_collections_abc.py | 28 | ||||
-rw-r--r-- | absl/flags/BUILD | 1 | ||||
-rw-r--r-- | absl/flags/_flag.py | 2 | ||||
-rw-r--r-- | absl/flags/_flag.pyi | 1 | ||||
-rw-r--r-- | absl/logging/BUILD | 1 | ||||
-rw-r--r-- | absl/logging/__init__.py | 2 | ||||
-rw-r--r-- | absl/testing/BUILD | 3 | ||||
-rw-r--r-- | absl/testing/absltest.py | 2 | ||||
-rw-r--r-- | absl/testing/parameterized.py | 6 | ||||
-rw-r--r-- | absl/testing/tests/parameterized_test.py | 2 |
11 files changed, 5 insertions, 50 deletions
@@ -22,13 +22,6 @@ py_library( ) py_library( - name = "_collections_abc", - srcs = ["_collections_abc.py"], - visibility = [":__subpackages__"], - deps = ["@six_archive//:six"], -) - -py_library( name = "tests/app_test_helper", testonly = 1, srcs = ["tests/app_test_helper.py"], diff --git a/absl/_collections_abc.py b/absl/_collections_abc.py deleted file mode 100644 index 1d06f05..0000000 --- a/absl/_collections_abc.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2019 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Python 2/3 compatibility module for collections.abc.""" - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - -import six - -# pylint: disable=g-importing-member -# pylint: disable=unused-import -if six.PY3: - from collections import abc -else: - import collections as abc diff --git a/absl/flags/BUILD b/absl/flags/BUILD index b6e5343..33a7b07 100644 --- a/absl/flags/BUILD +++ b/absl/flags/BUILD @@ -64,7 +64,6 @@ py_library( ":_argument_parser", ":_exceptions", ":_helpers", - "//absl:_collections_abc", ], ) diff --git a/absl/flags/_flag.py b/absl/flags/_flag.py index 2a1a0b1..d7ad944 100644 --- a/absl/flags/_flag.py +++ b/absl/flags/_flag.py @@ -18,10 +18,10 @@ Do NOT import this module directly. Import the flags package and use the aliases defined at the package level instead. """ +from collections import abc import copy import functools -from absl._collections_abc import abc from absl.flags import _argument_parser from absl.flags import _exceptions from absl.flags import _helpers diff --git a/absl/flags/_flag.pyi b/absl/flags/_flag.pyi index 3c8d44a..9b4a3d3 100644 --- a/absl/flags/_flag.pyi +++ b/absl/flags/_flag.pyi @@ -17,7 +17,6 @@ import copy import functools -from absl._collections_abc import abc from absl.flags import _argument_parser import enum diff --git a/absl/logging/BUILD b/absl/logging/BUILD index e666d7a..6c0d1bc 100644 --- a/absl/logging/BUILD +++ b/absl/logging/BUILD @@ -7,7 +7,6 @@ py_library( visibility = ["//visibility:public"], deps = [ ":converter", - "//absl:_collections_abc", "//absl/flags", ], ) diff --git a/absl/logging/__init__.py b/absl/logging/__init__.py index a475bd5..8804490 100644 --- a/absl/logging/__init__.py +++ b/absl/logging/__init__.py @@ -72,6 +72,7 @@ The differences in behavior are historical and unfortunate. """ import collections +from collections import abc import getpass import io import itertools @@ -88,7 +89,6 @@ import types import warnings from absl import flags -from absl._collections_abc import abc from absl.logging import converter try: diff --git a/absl/testing/BUILD b/absl/testing/BUILD index 6dbbaea..b608c8c 100644 --- a/absl/testing/BUILD +++ b/absl/testing/BUILD @@ -8,7 +8,6 @@ py_library( deps = [ ":_pretty_print_reporter", ":xml_reporter", - "//absl:_collections_abc", "//absl:app", "//absl/flags", "//absl/logging", @@ -34,7 +33,6 @@ py_library( visibility = ["//visibility:public"], deps = [ ":absltest", - "//absl:_collections_abc", ], ) @@ -225,7 +223,6 @@ py_test( deps = [ ":absltest", ":parameterized", - "//absl:_collections_abc", ], ) diff --git a/absl/testing/absltest.py b/absl/testing/absltest.py index 1303fd4..cebb1ca 100644 --- a/absl/testing/absltest.py +++ b/absl/testing/absltest.py @@ -18,6 +18,7 @@ This module contains base classes and high-level functions for Abseil-style tests. """ +from collections import abc import contextlib import difflib import enum @@ -55,7 +56,6 @@ except ImportError: from absl import app from absl import flags from absl import logging -from absl._collections_abc import abc from absl.testing import _pretty_print_reporter from absl.testing import xml_reporter diff --git a/absl/testing/parameterized.py b/absl/testing/parameterized.py index f318b98..ec6a529 100644 --- a/absl/testing/parameterized.py +++ b/absl/testing/parameterized.py @@ -204,10 +204,7 @@ as [asynctest](https://github.com/Martiusweb/asynctest): self.assertEqual(actual, expected) """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function - +from collections import abc import functools import inspect import itertools @@ -215,7 +212,6 @@ import re import types import unittest -from absl._collections_abc import abc from absl.testing import absltest diff --git a/absl/testing/tests/parameterized_test.py b/absl/testing/tests/parameterized_test.py index 7f63d01..8acbd93 100644 --- a/absl/testing/tests/parameterized_test.py +++ b/absl/testing/tests/parameterized_test.py @@ -14,10 +14,10 @@ """Tests for absl.testing.parameterized.""" +from collections import abc import sys import unittest -from absl._collections_abc import abc from absl.testing import absltest from absl.testing import parameterized |