Remove Python 2.6 code that's now obsolete. Fixes #3935

This commit is contained in:
Cyril Jouve 2019-01-31 13:47:56 +01:00 committed by Dave Page
parent 38feacd04d
commit cbd8f8236a
10 changed files with 24 additions and 87 deletions

View File

@ -46,4 +46,5 @@ Bug fixes
| `Bug #3916 <https://redmine.postgresql.org/issues/3916>`_ - Correct schema should be displayed in Materialized View dialog.
| `Bug #3927 <https://redmine.postgresql.org/issues/3927>`_ - Fixed debugger issue for procedure inside package for EPAS servers.
| `Bug #3929 <https://redmine.postgresql.org/issues/3929>`_ - Fix alignment of help messages in properties panels.
| `Bug #3935 <https://redmine.postgresql.org/issues/3935>`_ - Ensure that grant wizard should list down functions for EPAS server running with no-redwood-compat mode.
| `Bug #3935 <https://redmine.postgresql.org/issues/3935>`_ - Ensure that grant wizard should list down functions for EPAS server running with no-redwood-compat mode.
| `Bug #3954 <https://redmine.postgresql.org/issues/3954>`_ - Remove Python 2.6 code that's now obsolete.

View File

@ -66,7 +66,6 @@ setup(
'Development Status :: 5 - Production/Stable',
# Supported programming languages
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
@ -85,28 +84,9 @@ setup(
install_requires=required,
extras_require={
# ...
":python_version<'2.7'": [
"psycopg2==2.7.3.2",
"Flask-Script==2.0.5",
"ordereddict",
"python-dateutil==2.5.0",
"SQLAlchemy==1.0.14",
"Flask-Security==1.7.5",
"Flask-BabelEx==0.9.3"
],
":python_version<='2.7'": [
"importlib==1.0.3"
],
":python_version>='2.7'": [
"psycopg2>=2.7.4",
"python-dateutil>=2.7.1",
"htmlmin==0.1.12",
"Flask-HTMLmin==1.3.2",
"SQLAlchemy>=1.2.5",
"Flask-Security>=3.0.0",
"sshtunnel>=0.1.3"
]
},
# Specify data files to be included.

View File

@ -29,30 +29,15 @@ sqlparse==0.2.4
WTForms==2.1
Flask-Paranoid==0.2.0
psutil==5.4.7
################################################################
# Modules specifically requires for Python2.7 or greater version
################################################################
psycopg2>=2.7.4; python_version >= '2.7'
python-dateutil>=2.7.1; python_version >= '2.7'
htmlmin==0.1.12; python_version >= '2.7'
Flask-HTMLmin==1.3.2; python_version >= '2.7'
SQLAlchemy>=1.2.5; python_version >= '2.7'
Flask-Security>=3.0.0; python_version >= '2.7'
sshtunnel>=0.1.3; python_version >= '2.7'
psycopg2>=2.7.4
python-dateutil>=2.7.1
htmlmin==0.1.12
Flask-HTMLmin==1.3.2
SQLAlchemy>=1.2.5
Flask-Security>=3.0.0
sshtunnel>=0.1.3
###############################################################
# Modules specifically required for Python2.7 or lesser version
# Modules specifically required for Python2.7
###############################################################
importlib==1.0.3; python_version <= '2.7'
###############################################################
# Modules required for Python2.6
###############################################################
psycopg2==2.7.3.2; python_version < '2.7'
Flask-Script==2.0.5; python_version < '2.7'
ordereddict; python_version < '2.7'
python-dateutil==2.5.0; python_version < '2.7'
SQLAlchemy==1.0.14; python_version < '2.7'
Flask-Security==1.7.5; python_version < '2.7'
Flask-BabelEx==0.9.3; python_version < '2.7'

View File

@ -119,10 +119,7 @@ class BatchProcessTest(BaseTestGenerator):
current_app_mock.PGADMIN_RUNTIME = False
def db_session_add_mock(j):
if sys.version_info < (2, 7):
cmd_obj = loads(str(j.desc))
else:
cmd_obj = loads(j.desc)
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.backup_type, self.class_params['type'])
self.assertEqual(cmd_obj.bfile, self.class_params['bfile'])

View File

@ -73,10 +73,7 @@ class BatchProcessTest(BaseTestGenerator):
self.port = port
def db_session_add_mock(j):
if sys.version_info < (2, 7):
cmd_obj = loads(str(j.desc))
else:
cmd_obj = loads(j.desc)
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.query, self.class_params['cmd'])
self.assertEqual(cmd_obj.message, self.expected_msg)

View File

@ -64,10 +64,7 @@ class BatchProcessTest(BaseTestGenerator):
current_app_mock.PGADMIN_RUNTIME = False
def db_session_add_mock(j):
if sys.version_info < (2, 7):
cmd_obj = loads(str(j.desc))
else:
cmd_obj = loads(j.desc)
cmd_obj = loads(j.desc)
self.assertTrue(isinstance(cmd_obj, IProcessDesc))
self.assertEqual(cmd_obj.bfile, self.class_params['bfile'])
self.assertEqual(cmd_obj.cmd,

View File

@ -16,10 +16,7 @@ import six
from werkzeug.utils import find_modules
from pgadmin.utils import server_utils
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import unittest
class TestsGeneratorRegistry(ABCMeta):

View File

@ -14,11 +14,7 @@ import operator
import sys
from itertools import count, repeat, chain
from .completion import Completion
from collections import namedtuple, defaultdict
if sys.version_info < (2, 7):
from ordereddict import OrderedDict
else:
from collections import OrderedDict
from collections import namedtuple, defaultdict, OrderedDict
from .sqlcompletion import (
FromClauseItem, suggest_type, Database, Schema, Table,

View File

@ -11,17 +11,7 @@ pyperclip~=1.6.0
testscenarios==0.5.0
testtools==2.3.0
traceback2==1.4.0
unittest2==1.1.0
################################################################
# Modules specifically requires for Python2.7 or greater version
################################################################
selenium==3.11.0; python_version >= '2.7'
###############################################################
# Modules required for Python2.6
###############################################################
selenium==3.3.3; python_version < '2.7'
selenium==3.11.0
###############################################################
# Modules specifically required for Python3.3 or lesser version

View File

@ -25,10 +25,7 @@ from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
if sys.version_info < (2, 7):
import unittest2 as unit_test
else:
import unittest as unit_test
import unittest
if sys.version_info[0] >= 3:
import builtins
@ -119,9 +116,9 @@ app.PGADMIN_RUNTIME = True
if config.SERVER_MODE is True:
app.PGADMIN_RUNTIME = False
setattr(unit_test.result.TestResult, "passed", [])
setattr(unittest.result.TestResult, "passed", [])
unit_test.runner.TextTestResult.addSuccess = test_utils.add_success
unittest.runner.TextTestResult.addSuccess = test_utils.add_success
# Override apply_scenario method as we need custom test description/name
scenarios.apply_scenario = test_utils.apply_scenario
@ -143,7 +140,7 @@ def get_suite(module_list, test_server, test_app_client, server_information,
:rtype: TestSuite
"""
modules = []
pgadmin_suite = unit_test.TestSuite()
pgadmin_suite = unittest.TestSuite()
# Get the each test module and add into list
for key, klass in module_list:
@ -423,9 +420,9 @@ if __name__ == '__main__':
server,
test_client,
server_information, test_db_name)
tests = unit_test.TextTestRunner(stream=sys.stderr,
descriptions=True,
verbosity=2).run(suite)
tests = unittest.TextTestRunner(stream=sys.stderr,
descriptions=True,
verbosity=2).run(suite)
ran_tests, failed_cases, skipped_cases, passed_cases = \
get_tests_result(tests)
@ -434,7 +431,7 @@ if __name__ == '__main__':
# Set empty list for 'passed' parameter for each testRun.
# So that it will not append same test case name
unit_test.result.TestResult.passed = []
unittest.result.TestResult.passed = []
if len(failed_cases) > 0:
failure = True