diff --git a/docs/conf.py b/docs/conf.py --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from __future__ import print_function import datetime import sys import os diff --git a/examples/functions.py b/examples/functions.py --- a/examples/functions.py +++ b/examples/functions.py @@ -3,7 +3,6 @@ Simple example of a test generator which just produces data on some mathematical functions, keyed off of the current time. """ -from __future__ import print_function from lnt.testing import Machine, Run, TestSamples, Report import math import random diff --git a/examples/run_to_csv.py b/examples/run_to_csv.py --- a/examples/run_to_csv.py +++ b/examples/run_to_csv.py @@ -1,7 +1,5 @@ """Convert the JSON run file passed on stdin to a csv""" -from __future__ import print_function import json - import sys diff --git a/lnt/external/stats/pstat.py b/lnt/external/stats/pstat.py --- a/lnt/external/stats/pstat.py +++ b/lnt/external/stats/pstat.py @@ -105,8 +105,6 @@ ## ## 11/08/98 ... fixed aput to output large arrays correctly -from __future__ import absolute_import -from __future__ import print_function import string, copy from types import * diff --git a/lnt/external/stats/stats.py b/lnt/external/stats/stats.py --- a/lnt/external/stats/stats.py +++ b/lnt/external/stats/stats.py @@ -222,9 +222,6 @@ ## changed name of skewness and askewness to skew and askew ## fixed (a)histogram (which sometimes counted points = 3 static PyModuleDef cPerfModuleDef = {PyModuleDef_HEAD_INIT, "cPerf", nullptr, @@ -1077,17 +1076,10 @@ nullptr, nullptr, nullptr}; -#endif -#if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit_cPerf(void) { return PyModule_Create(&cPerfModuleDef); } -#else -PyMODINIT_FUNC initcPerf(void) { - (void)Py_InitModule("cPerf", cPerfMethods); -} -#endif #else // STANDALONE diff --git a/lnt/testing/profile/perf.py b/lnt/testing/profile/perf.py --- a/lnt/testing/profile/perf.py +++ b/lnt/testing/profile/perf.py @@ -1,4 +1,3 @@ -from __future__ import absolute_import from lnt.util import logger from .profile import ProfileImpl from .profilev1impl import ProfileV1 diff --git a/lnt/testing/profile/profilev1impl.py b/lnt/testing/profile/profilev1impl.py --- a/lnt/testing/profile/profilev1impl.py +++ b/lnt/testing/profile/profilev1impl.py @@ -1,5 +1,3 @@ -from future import standard_library -standard_library.install_aliases() from lnt.testing.profile.profile import ProfileImpl import pickle import zlib diff --git a/lnt/testing/profile/profilev2impl.py b/lnt/testing/profile/profilev2impl.py --- a/lnt/testing/profile/profilev2impl.py +++ b/lnt/testing/profile/profilev2impl.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import -from builtins import range -from future import standard_library -standard_library.install_aliases() from .profile import ProfileImpl import bz2 import copy diff --git a/lnt/testing/util/rcs.py b/lnt/testing/util/rcs.py --- a/lnt/testing/util/rcs.py +++ b/lnt/testing/util/rcs.py @@ -1,5 +1,3 @@ -from future import standard_library -standard_library.install_aliases() import re import os from lnt.util import logger diff --git a/lnt/tests/builtintest.py b/lnt/tests/builtintest.py --- a/lnt/tests/builtintest.py +++ b/lnt/tests/builtintest.py @@ -2,7 +2,6 @@ Base class for builtin-in tests. """ -from __future__ import print_function import sys import os diff --git a/lnt/tests/compile.py b/lnt/tests/compile.py --- a/lnt/tests/compile.py +++ b/lnt/tests/compile.py @@ -1,7 +1,4 @@ """Single file compile-time performance testing""" -from __future__ import print_function -from future import standard_library -standard_library.install_aliases() import errno import hashlib import json diff --git a/lnt/tests/nt.py b/lnt/tests/nt.py --- a/lnt/tests/nt.py +++ b/lnt/tests/nt.py @@ -1,8 +1,4 @@ """LLVM test-suite compile and execution tests""" -from __future__ import absolute_import -from __future__ import print_function -from future import standard_library -standard_library.install_aliases() import csv import os import platform diff --git a/lnt/tests/test_suite.py b/lnt/tests/test_suite.py --- a/lnt/tests/test_suite.py +++ b/lnt/tests/test_suite.py @@ -1,5 +1,4 @@ """LLVM test-suite""" -from __future__ import print_function import subprocess import tempfile import json diff --git a/lnt/util/ImportData.py b/lnt/util/ImportData.py --- a/lnt/util/ImportData.py +++ b/lnt/util/ImportData.py @@ -1,4 +1,3 @@ -from __future__ import print_function from lnt.util import NTEmailReport from contextlib import closing from lnt.util import logger diff --git a/lnt/util/ServerUtil.py b/lnt/util/ServerUtil.py --- a/lnt/util/ServerUtil.py +++ b/lnt/util/ServerUtil.py @@ -1,9 +1,6 @@ """ Utility for submitting files to a web server over HTTP. """ -from __future__ import print_function -from future import standard_library -standard_library.install_aliases() import sys import urllib.request import urllib.parse diff --git a/lnt/util/stats.py b/lnt/util/stats.py --- a/lnt/util/stats.py +++ b/lnt/util/stats.py @@ -1,4 +1,3 @@ -from __future__ import division import math from lnt.external.stats.stats import mannwhitneyu as mannwhitneyu_large from functools import reduce diff --git a/lnt/util/wsgi_restart.py b/lnt/util/wsgi_restart.py --- a/lnt/util/wsgi_restart.py +++ b/lnt/util/wsgi_restart.py @@ -1,7 +1,4 @@ # This code lifted from the mod_wsgi docs. -from __future__ import print_function -from future import standard_library -standard_library.install_aliases() import os from pathlib import Path from typing import Sequence diff --git a/runtime.txt b/runtime.txt deleted file mode 100644 --- a/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-2.7.10 diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -1,12 +1,11 @@ -from __future__ import print_function import lnt import os from sys import platform as _platform import sys from setuptools import setup, find_packages, Extension -if sys.version_info < (3, 6) and sys.version_info[:2] != (2, 7): - raise RuntimeError("Python 2.7 or Python 3.6 or higher required.") +if sys.version_info < (3, 6): + raise RuntimeError("Python 3.6 or higher required.") cflags = [] @@ -81,7 +80,7 @@ 'License :: OSI Approved :: Apache-2.0 with LLVM exception', 'Natural Language :: English', 'Operating System :: OS Independent', - 'Programming Language :: Python', + 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Quality Assurance', 'Topic :: Software Development :: Testing', ], @@ -133,12 +132,11 @@ "click==6.7", "pyyaml==5.1.2", "requests", - "future", "lit==0.11.1", "certifi" ], ext_modules=[cPerf], - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*', + python_requires='>=3.6.*', ) diff --git a/tests/SharedInputs/FakeCompilers/fakecompiler.py b/tests/SharedInputs/FakeCompilers/fakecompiler.py --- a/tests/SharedInputs/FakeCompilers/fakecompiler.py +++ b/tests/SharedInputs/FakeCompilers/fakecompiler.py @@ -3,8 +3,6 @@ """ Utilities for "faking" a compiler response. """ -from __future__ import print_function - import inspect import os import sys diff --git a/tests/SharedInputs/create_temp_instance.py b/tests/SharedInputs/create_temp_instance.py --- a/tests/SharedInputs/create_temp_instance.py +++ b/tests/SharedInputs/create_temp_instance.py @@ -1,4 +1,3 @@ -from __future__ import print_function import sys import shutil import os.path diff --git a/tests/server/db/ImportV4TestSuiteInstance.py b/tests/server/db/ImportV4TestSuiteInstance.py --- a/tests/server/db/ImportV4TestSuiteInstance.py +++ b/tests/server/db/ImportV4TestSuiteInstance.py @@ -1,4 +1,3 @@ -from __future__ import print_function # Check the import process into a v4 test suite DB. # # We first construct a temporary LNT instance. diff --git a/tests/server/db/Migrations.py b/tests/server/db/Migrations.py --- a/tests/server/db/Migrations.py +++ b/tests/server/db/Migrations.py @@ -2,7 +2,6 @@ # # RUN: python %s %t -from __future__ import print_function import logging import os import re diff --git a/tests/server/ui/V4Pages.py b/tests/server/ui/V4Pages.py --- a/tests/server/ui/V4Pages.py +++ b/tests/server/ui/V4Pages.py @@ -1,4 +1,3 @@ -from __future__ import print_function # Perform basic sanity checking of the V4 UI pages. # # create temporary instance @@ -22,8 +21,6 @@ # # RUN: python %s %t.instance %{tidylib} -from future import standard_library -standard_library.install_aliases() import logging import re import sys diff --git a/tests/testing/CalltreeDataLoading.py b/tests/testing/CalltreeDataLoading.py --- a/tests/testing/CalltreeDataLoading.py +++ b/tests/testing/CalltreeDataLoading.py @@ -1,4 +1,3 @@ -from __future__ import print_function # Check the model bindings for test suite instances. # # RUN: rm -f %t.db diff --git a/tests/utils/blast.py b/tests/utils/blast.py --- a/tests/utils/blast.py +++ b/tests/utils/blast.py @@ -4,11 +4,9 @@ This should only be used for (load) testing. It will add a bunch of bad data to your instance, so don't use it on a production instance. """ -from __future__ import print_function ## Just to make sure there are no syntax errors in this. This does not ## actually run a blast. # RUN: python %{src_root}/tests/utils/blast.py -from builtins import range import time import subprocess import os diff --git a/tox.ini b/tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [tox] -envlist = py27 - py3 +envlist = py3 mypy flake8 docs @@ -19,14 +18,12 @@ deps = mypy >= 0.910 sqlalchemy-stubs - future commands = # Nowhere close to passing yet, but nice to have. The option # --no-incremental is currently needed to suppress warnings about # UpdatedBase when running tests several times. Future versions of # mypy should be checked to see if it can be removed and not get # warnings after running tox several times. - - mypy --no-incremental --junit-xml=junit-{envname}.xml --py2 --ignore-missing-imports lnt - mypy --no-incremental --junit-xml=junit-{envname}.xml --ignore-missing-imports lnt [testenv:flake8] @@ -43,7 +40,6 @@ deps = sphinx<2.0.0 sphinx_bootstrap_theme - future commands = make -C {toxinidir}/docs/ html