Drop support for py27
Officially removes support for py27, which was already broken for 3+ months (unmaintained test tools). Change-Id: I38c966d4e1680592f5cd94695051710695d41f71 Related: https://github.com/testing-cabal/subunit/pull/32
This commit is contained in:
parent
f4e0e70bb0
commit
3757503895
@ -17,24 +17,22 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import configparser
|
||||||
import datetime
|
import datetime
|
||||||
import getpass
|
import getpass
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import six
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
|
from urllib.parse import urlencode
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import requests
|
import requests
|
||||||
from six.moves import configparser
|
|
||||||
from six.moves import input as do_input
|
|
||||||
from six.moves.urllib.parse import urlencode
|
|
||||||
from six.moves.urllib.parse import urljoin
|
|
||||||
from six.moves.urllib.parse import urlparse
|
|
||||||
|
|
||||||
|
|
||||||
VERBOSE = False
|
VERBOSE = False
|
||||||
@ -138,10 +136,6 @@ def run_command_status(*argv, **kwargs):
|
|||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print(datetime.datetime.now(), "Running:", " ".join(argv))
|
print(datetime.datetime.now(), "Running:", " ".join(argv))
|
||||||
if len(argv) == 1:
|
if len(argv) == 1:
|
||||||
# for python2 compatibility with shlex
|
|
||||||
if sys.version_info < (3,) and isinstance(argv[0], six.text_type):
|
|
||||||
argv = shlex.split(argv[0].encode('utf-8'))
|
|
||||||
else:
|
|
||||||
argv = shlex.split(str(argv[0]))
|
argv = shlex.split(str(argv[0]))
|
||||||
stdin = kwargs.pop('stdin', None)
|
stdin = kwargs.pop('stdin', None)
|
||||||
newenv = os.environ.copy()
|
newenv = os.environ.copy()
|
||||||
@ -416,7 +410,7 @@ def add_remote(scheme, hostname, port, project, remote, usepushurl):
|
|||||||
print("No remote set, testing %s" % remote_url)
|
print("No remote set, testing %s" % remote_url)
|
||||||
if not test_remote_url(remote_url):
|
if not test_remote_url(remote_url):
|
||||||
print("Could not connect to gerrit.")
|
print("Could not connect to gerrit.")
|
||||||
username = do_input("Enter your gerrit username: ")
|
username = input("Enter your gerrit username: ")
|
||||||
remote_url = make_remote_url(scheme, username, hostname, port, project)
|
remote_url = make_remote_url(scheme, username, hostname, port, project)
|
||||||
print("Trying again with %s" % remote_url)
|
print("Trying again with %s" % remote_url)
|
||||||
if not test_remote_url(remote_url):
|
if not test_remote_url(remote_url):
|
||||||
@ -954,7 +948,7 @@ def assert_one_change(remote, branch, yes, have_hook):
|
|||||||
"branches (for independent changes).")
|
"branches (for independent changes).")
|
||||||
print("\nThe outstanding commits are:\n\n%s\n\n"
|
print("\nThe outstanding commits are:\n\n%s\n\n"
|
||||||
"Do you really want to submit the above commits?" % output)
|
"Do you really want to submit the above commits?" % output)
|
||||||
yes_no = do_input("Type 'yes' to confirm, other to cancel: ")
|
yes_no = input("Type 'yes' to confirm, other to cancel: ")
|
||||||
if yes_no.lower().strip() != "yes":
|
if yes_no.lower().strip() != "yes":
|
||||||
print("Aborting.")
|
print("Aborting.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -1729,15 +1723,6 @@ review.
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# workaround for avoiding UnicodeEncodeError on print() with older python
|
|
||||||
if sys.version_info[0] < 3:
|
|
||||||
# without reload print would fail even if sys.stdin.encoding
|
|
||||||
# would report utf-8
|
|
||||||
# see: https://stackoverflow.com/a/23847316/99834
|
|
||||||
stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr
|
|
||||||
reload(sys) # noqa
|
|
||||||
sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr
|
|
||||||
sys.setdefaultencoding(os.environ.get('PYTHONIOENCODING', 'utf-8'))
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_main()
|
_main()
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import functools
|
import functools
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import textwrap
|
import textwrap
|
||||||
@ -29,13 +30,6 @@ from git_review import cmd
|
|||||||
from git_review.tests import IsoEnvDir
|
from git_review.tests import IsoEnvDir
|
||||||
from git_review.tests import utils
|
from git_review.tests import utils
|
||||||
|
|
||||||
# Use of io.StringIO in python =< 2.7 requires all strings handled to be
|
|
||||||
# unicode. See if StringIO.StringIO is available first
|
|
||||||
try:
|
|
||||||
import StringIO as io
|
|
||||||
except ImportError:
|
|
||||||
import io
|
|
||||||
|
|
||||||
|
|
||||||
class ConfigTestCase(testtools.TestCase):
|
class ConfigTestCase(testtools.TestCase):
|
||||||
"""Class testing config behavior."""
|
"""Class testing config behavior."""
|
||||||
|
@ -1,2 +1 @@
|
|||||||
requests>=1.1
|
requests>=1.1
|
||||||
six
|
|
||||||
|
@ -4,8 +4,9 @@ summary = Tool to submit code to Gerrit
|
|||||||
description-file = README.rst
|
description-file = README.rst
|
||||||
license = Apache License (2.0)
|
license = Apache License (2.0)
|
||||||
classifiers =
|
classifiers =
|
||||||
Programming Language :: Python :: 2
|
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
|
Programming Language :: Python :: 3.5
|
||||||
|
Programming Language :: Python :: 3.6
|
||||||
Programming Language :: Python
|
Programming Language :: Python
|
||||||
Development Status :: 5 - Production/Stable
|
Development Status :: 5 - Production/Stable
|
||||||
Environment :: Console
|
Environment :: Console
|
||||||
@ -19,6 +20,7 @@ author = OpenStack
|
|||||||
author-email = openstack-infra@lists.openstack.org
|
author-email = openstack-infra@lists.openstack.org
|
||||||
home-page = http://docs.openstack.org/infra/git-review/
|
home-page = http://docs.openstack.org/infra/git-review/
|
||||||
project-url = http://docs.openstack.org/infra/
|
project-url = http://docs.openstack.org/infra/
|
||||||
|
python-requires = >= 3.5
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
|
2
setup.py
2
setup.py
@ -17,4 +17,4 @@
|
|||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
|
|
||||||
setuptools.setup(setup_requires=['pbr'], pbr=True)
|
setuptools.setup(setup_requires=['pbr>=4.1.0'], pbr=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user