mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Remove Python 2.6 code that's now obsolete. Fixes #3935
This commit is contained in:
@@ -47,3 +47,4 @@ Bug fixes
|
|||||||
| `Bug #3927 <https://redmine.postgresql.org/issues/3927>`_ - Fixed debugger issue for procedure inside package for EPAS servers.
|
| `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 #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.
|
||||||
@@ -66,7 +66,6 @@ setup(
|
|||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
|
|
||||||
# Supported programming languages
|
# Supported programming languages
|
||||||
'Programming Language :: Python :: 2.6',
|
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
@@ -85,28 +84,9 @@ setup(
|
|||||||
install_requires=required,
|
install_requires=required,
|
||||||
|
|
||||||
extras_require={
|
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'": [
|
":python_version<='2.7'": [
|
||||||
"importlib==1.0.3"
|
"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.
|
# Specify data files to be included.
|
||||||
|
|||||||
@@ -29,30 +29,15 @@ sqlparse==0.2.4
|
|||||||
WTForms==2.1
|
WTForms==2.1
|
||||||
Flask-Paranoid==0.2.0
|
Flask-Paranoid==0.2.0
|
||||||
psutil==5.4.7
|
psutil==5.4.7
|
||||||
|
psycopg2>=2.7.4
|
||||||
################################################################
|
python-dateutil>=2.7.1
|
||||||
# Modules specifically requires for Python2.7 or greater version
|
htmlmin==0.1.12
|
||||||
################################################################
|
Flask-HTMLmin==1.3.2
|
||||||
psycopg2>=2.7.4; python_version >= '2.7'
|
SQLAlchemy>=1.2.5
|
||||||
python-dateutil>=2.7.1; python_version >= '2.7'
|
Flask-Security>=3.0.0
|
||||||
htmlmin==0.1.12; python_version >= '2.7'
|
sshtunnel>=0.1.3
|
||||||
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'
|
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
# Modules specifically required for Python2.7 or lesser version
|
# Modules specifically required for Python2.7
|
||||||
###############################################################
|
###############################################################
|
||||||
importlib==1.0.3; python_version <= '2.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'
|
|
||||||
|
|||||||
@@ -119,9 +119,6 @@ class BatchProcessTest(BaseTestGenerator):
|
|||||||
current_app_mock.PGADMIN_RUNTIME = False
|
current_app_mock.PGADMIN_RUNTIME = False
|
||||||
|
|
||||||
def db_session_add_mock(j):
|
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.assertTrue(isinstance(cmd_obj, IProcessDesc))
|
||||||
self.assertEqual(cmd_obj.backup_type, self.class_params['type'])
|
self.assertEqual(cmd_obj.backup_type, self.class_params['type'])
|
||||||
|
|||||||
@@ -73,9 +73,6 @@ class BatchProcessTest(BaseTestGenerator):
|
|||||||
self.port = port
|
self.port = port
|
||||||
|
|
||||||
def db_session_add_mock(j):
|
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.assertTrue(isinstance(cmd_obj, IProcessDesc))
|
||||||
self.assertEqual(cmd_obj.query, self.class_params['cmd'])
|
self.assertEqual(cmd_obj.query, self.class_params['cmd'])
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ class BatchProcessTest(BaseTestGenerator):
|
|||||||
current_app_mock.PGADMIN_RUNTIME = False
|
current_app_mock.PGADMIN_RUNTIME = False
|
||||||
|
|
||||||
def db_session_add_mock(j):
|
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.assertTrue(isinstance(cmd_obj, IProcessDesc))
|
||||||
self.assertEqual(cmd_obj.bfile, self.class_params['bfile'])
|
self.assertEqual(cmd_obj.bfile, self.class_params['bfile'])
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ import six
|
|||||||
from werkzeug.utils import find_modules
|
from werkzeug.utils import find_modules
|
||||||
from pgadmin.utils import server_utils
|
from pgadmin.utils import server_utils
|
||||||
|
|
||||||
if sys.version_info < (2, 7):
|
import unittest
|
||||||
import unittest2 as unittest
|
|
||||||
else:
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
|
|
||||||
class TestsGeneratorRegistry(ABCMeta):
|
class TestsGeneratorRegistry(ABCMeta):
|
||||||
|
|||||||
@@ -14,11 +14,7 @@ import operator
|
|||||||
import sys
|
import sys
|
||||||
from itertools import count, repeat, chain
|
from itertools import count, repeat, chain
|
||||||
from .completion import Completion
|
from .completion import Completion
|
||||||
from collections import namedtuple, defaultdict
|
from collections import namedtuple, defaultdict, OrderedDict
|
||||||
if sys.version_info < (2, 7):
|
|
||||||
from ordereddict import OrderedDict
|
|
||||||
else:
|
|
||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
from .sqlcompletion import (
|
from .sqlcompletion import (
|
||||||
FromClauseItem, suggest_type, Database, Schema, Table,
|
FromClauseItem, suggest_type, Database, Schema, Table,
|
||||||
|
|||||||
@@ -11,17 +11,7 @@ pyperclip~=1.6.0
|
|||||||
testscenarios==0.5.0
|
testscenarios==0.5.0
|
||||||
testtools==2.3.0
|
testtools==2.3.0
|
||||||
traceback2==1.4.0
|
traceback2==1.4.0
|
||||||
unittest2==1.1.0
|
selenium==3.11.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'
|
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
# Modules specifically required for Python3.3 or lesser version
|
# Modules specifically required for Python3.3 or lesser version
|
||||||
|
|||||||
@@ -25,10 +25,7 @@ from selenium import webdriver
|
|||||||
from selenium.webdriver.chrome.options import Options
|
from selenium.webdriver.chrome.options import Options
|
||||||
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
||||||
|
|
||||||
if sys.version_info < (2, 7):
|
import unittest
|
||||||
import unittest2 as unit_test
|
|
||||||
else:
|
|
||||||
import unittest as unit_test
|
|
||||||
|
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
import builtins
|
import builtins
|
||||||
@@ -119,9 +116,9 @@ app.PGADMIN_RUNTIME = True
|
|||||||
if config.SERVER_MODE is True:
|
if config.SERVER_MODE is True:
|
||||||
app.PGADMIN_RUNTIME = False
|
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
|
# Override apply_scenario method as we need custom test description/name
|
||||||
scenarios.apply_scenario = test_utils.apply_scenario
|
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
|
:rtype: TestSuite
|
||||||
"""
|
"""
|
||||||
modules = []
|
modules = []
|
||||||
pgadmin_suite = unit_test.TestSuite()
|
pgadmin_suite = unittest.TestSuite()
|
||||||
|
|
||||||
# Get the each test module and add into list
|
# Get the each test module and add into list
|
||||||
for key, klass in module_list:
|
for key, klass in module_list:
|
||||||
@@ -423,7 +420,7 @@ if __name__ == '__main__':
|
|||||||
server,
|
server,
|
||||||
test_client,
|
test_client,
|
||||||
server_information, test_db_name)
|
server_information, test_db_name)
|
||||||
tests = unit_test.TextTestRunner(stream=sys.stderr,
|
tests = unittest.TextTestRunner(stream=sys.stderr,
|
||||||
descriptions=True,
|
descriptions=True,
|
||||||
verbosity=2).run(suite)
|
verbosity=2).run(suite)
|
||||||
|
|
||||||
@@ -434,7 +431,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# Set empty list for 'passed' parameter for each testRun.
|
# Set empty list for 'passed' parameter for each testRun.
|
||||||
# So that it will not append same test case name
|
# So that it will not append same test case name
|
||||||
unit_test.result.TestResult.passed = []
|
unittest.result.TestResult.passed = []
|
||||||
|
|
||||||
if len(failed_cases) > 0:
|
if len(failed_cases) > 0:
|
||||||
failure = True
|
failure = True
|
||||||
|
|||||||
Reference in New Issue
Block a user