Skip to content

Commit

Permalink
Merge pull request #178 from yilei/push_up_to_405511743
Browse files Browse the repository at this point in the history
Push up to 405511743
  • Loading branch information
yilei authored Oct 25, 2021
2 parents b188d90 + 72aed25 commit 6c18fdd
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 136 deletions.
11 changes: 0 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,3 @@ http_archive(
strip_prefix = "mock-1.0.1",
build_file = "@//third_party:mock.BUILD",
)

http_archive(
# NOTE: The name here is used in _enum_module.py to find the sys.path entry.
name = "enum34_archive",
urls = [
"https://mirror.bazel.build/pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz",
"https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
],
sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1",
build_file = "@//third_party:enum34.BUILD"
)
16 changes: 0 additions & 16 deletions absl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ config_setting(
visibility = [":__subpackages__"],
)

py_library(
name = "_enum_module",
srcs = ["_enum_module.py"],
visibility = [":__subpackages__"],
deps = [
"@six_archive//:six",
] + select({
# In some Python 3 environments, despite the _enum_module import path
# tricks, the enum backport still ends up on sys.path before the
# stdlib, which more-or-less breaks Python
":py3_mode": [],
"//conditions:default": ["@enum34_archive//:enum"],
}),
)

py_library(
name = "_collections_abc",
srcs = ["_collections_abc.py"],
Expand Down Expand Up @@ -91,7 +76,6 @@ py_test(
python_version = "PY3",
srcs_version = "PY3",
deps = [
":_enum_module",
":app",
":tests/app_test_helper",
"//absl/flags",
Expand Down
5 changes: 4 additions & 1 deletion absl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).

## Unreleased

Nothing notable unreleased.
### Changed

* `absl-py` no longer supports Python 2.7, 3.4, 3.5. All versions have reached
end-of-life for more than a year now.

## 0.15.0 (2021-10-19)

Expand Down
56 changes: 0 additions & 56 deletions absl/_enum_module.py

This file was deleted.

4 changes: 0 additions & 4 deletions absl/flags/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ py_test(
srcs_version = "PY3",
deps = [
":_argument_parser",
"//absl:_enum_module",
"//absl/testing:absltest",
"//absl/testing:parameterized",
"@six_archive//:six",
Expand All @@ -138,7 +137,6 @@ py_test(
":_argument_parser",
":_exceptions",
":_flag",
"//absl:_enum_module",
"//absl/testing:absltest",
"//absl/testing:parameterized",
],
Expand Down Expand Up @@ -249,7 +247,6 @@ py_test(
":_helpers",
":flags",
":tests/module_bar",
"//absl:_enum_module",
"//absl/testing:absltest",
"@six_archive//:six",
],
Expand Down Expand Up @@ -282,7 +279,6 @@ py_test(
":tests/module_bar",
":tests/module_baz",
":tests/module_foo",
"//absl:_enum_module",
"//absl/testing:absltest",
"@six_archive//:six",
],
Expand Down
2 changes: 1 addition & 1 deletion absl/flags/tests/_argument_parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from __future__ import division
from __future__ import print_function

from absl._enum_module import enum
import enum
from absl.flags import _argument_parser
from absl.testing import absltest
from absl.testing import parameterized
Expand Down
2 changes: 1 addition & 1 deletion absl/flags/tests/_flag_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from __future__ import print_function

import copy
import enum
import pickle

from absl._enum_module import enum
from absl.flags import _argument_parser
from absl.flags import _exceptions
from absl.flags import _flag
Expand Down
2 changes: 1 addition & 1 deletion absl/flags/tests/flags_helpxml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import division
from __future__ import print_function

import enum
import io
import os
import string
Expand All @@ -26,7 +27,6 @@
import xml.sax.saxutils

from absl import flags
from absl._enum_module import enum
from absl.flags import _helpers
from absl.flags.tests import module_bar
from absl.testing import absltest
Expand Down
2 changes: 1 addition & 1 deletion absl/flags/tests/flags_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import print_function

import contextlib
import enum
import io
import os
import shutil
Expand All @@ -26,7 +27,6 @@
import unittest

from absl import flags
from absl._enum_module import enum
from absl.flags import _exceptions
from absl.flags import _helpers
from absl.flags.tests import module_bar
Expand Down
1 change: 0 additions & 1 deletion absl/testing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ py_library(
":_pretty_print_reporter",
":xml_reporter",
"//absl:_collections_abc",
"//absl:_enum_module",
"//absl:app",
"//absl/flags",
"//absl/logging",
Expand Down
2 changes: 1 addition & 1 deletion absl/testing/absltest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import contextlib
import difflib
import enum
import errno
import getpass
import inspect
Expand Down Expand Up @@ -57,7 +58,6 @@
from absl import flags
from absl import logging
from absl._collections_abc import abc
from absl._enum_module import enum
from absl.testing import _pretty_print_reporter
from absl.testing import xml_reporter
from absl.third_party import unittest3_backport
Expand Down
2 changes: 1 addition & 1 deletion absl/tests/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import codecs
import contextlib
import copy
import enum
import os
import re
import subprocess
Expand All @@ -30,7 +31,6 @@

from absl import app
from absl import flags
from absl._enum_module import enum
from absl.testing import _bazelize_command
from absl.testing import absltest
from absl.testing import flagsaver
Expand Down
32 changes: 9 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
use_setuptools()
import setuptools

py_version = sys.version_info
if py_version < (2, 7) or py_version[0] == 3 and py_version < (3, 4):
raise RuntimeError('Python version 2.7 or 3.4+ is required.')
if sys.version_info < (3, 6):
raise RuntimeError('Python version 3.6+ is required.')

INSTALL_REQUIRES = [
'six',
Expand All @@ -39,22 +38,11 @@
setuptools_version = tuple(
int(x) for x in setuptools.__version__.split('.')[:2])

# A variety of environments have very, very old versions of setuptools that
# don't support the environment markers ("foo; python_version < X"). Since
# we're using sdist, this setup.py gets run directly when installing, so
# we can just manually do the dependency checking.
# See these for more info:
# https://github.com/abseil/abseil-py/issues/79
# https://hynek.me/articles/conditional-python-dependencies/
# Environment marker support was added in setuptools 36.2, see
# https://github.com/pypa/setuptools/blob/master/CHANGES.rst#v3620
if setuptools_version < (36, 2):
if sys.version_info[0:2] < (3, 4):
INSTALL_REQUIRES.append('enum34')
else:
# Environment markers are the preferred way: it allows correct non-source
# distributions (i.e., wheels) to be generated.
INSTALL_REQUIRES.append("enum34; python_version < '3.4'")
additional_kwargs = {}
if setuptools_version >= (24, 2):
# `python_requires` was added in 24.2, see
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
additional_kwargs['python_requires'] = '>=3.6'

_README_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'README.md')
Expand All @@ -79,18 +67,16 @@
license='Apache 2.0',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
],
**additional_kwargs,
)
5 changes: 0 additions & 5 deletions smoke_tests/smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ trap 'deactivate' EXIT
curl https://bootstrap.pypa.io/get-pip.py | python
pip --version
pip install six
# For some reason, the setup.py install command on Mac with Python 3.4 fails to
# install enum34 due to a TLS error. Installing it explicitly beforehand works.
# enum34 isn't needed for >= 3.5, but installing it in other versions won't
# cause problems.
pip install enum34

python --version
python setup.py install
Expand Down
13 changes: 0 additions & 13 deletions third_party/enum34.BUILD

This file was deleted.

0 comments on commit 6c18fdd

Please sign in to comment.