1) Remove Python's 'Six' package completely. #5357

2) Replace deprecated @abstractproperty with @property, @abstractmethod.
This commit is contained in:
Akshay Joshi
2022-09-26 12:47:31 +05:30
parent fc8d6d6e90
commit 0b6b2e733a
15 changed files with 37 additions and 70 deletions

View File

@@ -12,9 +12,9 @@ Name Version
---- ------- ------- --- ---- ------- ------- ---
Python 3.6+ PSF https://www.python.org/ Python 3.6+ PSF https://www.python.org/
nw 0.50.2 MIT git://github.com/nwjs/npm-installer.git nw 0.50.2 MIT git://github.com/nwjs/npm-installer.git
axios 0.21.0 MIT https://github.com/axios/axios.git axios 0.21.2 MIT https://github.com/axios/axios.git
bootstrap 4.5.3 MIT git+https://github.com/twbs/bootstrap.git bootstrap 4.5.3 MIT git+https://github.com/twbs/bootstrap.git
follow-redirects 1.13.1 MIT git@github.com:follow-redirects/follow-redirects.git follow-redirects 1.15.2 MIT git@github.com:follow-redirects/follow-redirects.git
5 dependencies listed. 5 dependencies listed.
@@ -39,7 +39,6 @@ WTForms 3.0.1
passlib 1.7.4 BSD https://passlib.readthedocs.io passlib 1.7.4 BSD https://passlib.readthedocs.io
pytz 2021.3 MIT http://pythonhosted.org/pytz pytz 2021.3 MIT http://pythonhosted.org/pytz
simplejson 3.17.6 MIT License https://github.com/simplejson/simplejson simplejson 3.17.6 MIT License https://github.com/simplejson/simplejson
six 1.16.0 MIT https://github.com/benjaminp/six
speaklater3 1.4 UNKNOWN https://github.com/ThomasWaldmann/speaklater speaklater3 1.4 UNKNOWN https://github.com/ThomasWaldmann/speaklater
sqlparse 0.4.2 BSD-3-Clause https://github.com/andialbrecht/sqlparse sqlparse 0.4.2 BSD-3-Clause https://github.com/andialbrecht/sqlparse
psutil 5.9.1 BSD https://github.com/giampaolo/psutil psutil 5.9.1 BSD https://github.com/giampaolo/psutil
@@ -62,7 +61,7 @@ qrcode 7.3.1
Pillow 9.2.0 HPND https://python-pillow.org Pillow 9.2.0 HPND https://python-pillow.org
boto3 1.20.54 Apache License 2.0 https://github.com/boto/boto3 boto3 1.20.54 Apache License 2.0 https://github.com/boto/boto3
botocore 1.23.54 Apache License 2.0 https://github.com/boto/botocore botocore 1.23.54 Apache License 2.0 https://github.com/boto/botocore
urllib3 1.26.11 MIT https://urllib3.readthedocs.io/ urllib3 1.26.12 MIT https://urllib3.readthedocs.io/
Werkzeug 2.1.2 BSD-3-Clause https://palletsprojects.com/p/werkzeug/ Werkzeug 2.1.2 BSD-3-Clause https://palletsprojects.com/p/werkzeug/
azure-mgmt-rdbms 10.1.0 MIT License https://github.com/Azure/azure-sdk-for-python azure-mgmt-rdbms 10.1.0 MIT License https://github.com/Azure/azure-sdk-for-python
azure-mgmt-resource 21.0.0 MIT License https://github.com/Azure/azure-sdk-for-python azure-mgmt-resource 21.0.0 MIT License https://github.com/Azure/azure-sdk-for-python
@@ -72,7 +71,7 @@ azure-identity 1.9.0
NOTE: This report was generated using Python 3.10. Full information may not be NOTE: This report was generated using Python 3.10. Full information may not be
shown for Python modules that are not required with this version. shown for Python modules that are not required with this version.
45 dependencies listed. 44 dependencies listed.
Javascript Dependencies Javascript Dependencies
======================= =======================
@@ -157,7 +156,6 @@ Name Version
@nodelib/fs.scandir 2.1.5 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir @nodelib/fs.scandir 2.1.5 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir
@nodelib/fs.stat 2.0.5 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat @nodelib/fs.stat 2.0.5 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat
@nodelib/fs.walk 1.2.8 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk @nodelib/fs.walk 1.2.8 MIT https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk
@popperjs/core 2.10.2 MIT https://github.com/popperjs/popper-core.git
@projectstorm/geometry 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git @projectstorm/geometry 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git
@projectstorm/react-canvas-core 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git @projectstorm/react-canvas-core 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git
@projectstorm/react-diagrams 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git @projectstorm/react-diagrams 6.6.1 MIT https://github.com/projectstorm/react-diagrams.git
@@ -169,7 +167,6 @@ Name Version
@socket.io/base64-arraybuffer 1.0.2 MIT https://github.com/socketio/base64-arraybuffer @socket.io/base64-arraybuffer 1.0.2 MIT https://github.com/socketio/base64-arraybuffer
@socket.io/component-emitter 3.0.0 MIT https://github.com/socketio/emitter.git @socket.io/component-emitter 3.0.0 MIT https://github.com/socketio/emitter.git
@szhsin/react-menu 2.3.3 MIT https://github.com/szhsin/react-menu.git @szhsin/react-menu 2.3.3 MIT https://github.com/szhsin/react-menu.git
@tippyjs/react 4.2.6 MIT git+https://github.com/atomiks/tippyjs-react.git
@types/classnames 2.3.1 MIT Unknown @types/classnames 2.3.1 MIT Unknown
@types/json-schema 7.0.9 MIT https://github.com/DefinitelyTyped/DefinitelyTyped.git @types/json-schema 7.0.9 MIT https://github.com/DefinitelyTyped/DefinitelyTyped.git
@types/minimist 1.2.2 MIT https://github.com/DefinitelyTyped/DefinitelyTyped.git @types/minimist 1.2.2 MIT https://github.com/DefinitelyTyped/DefinitelyTyped.git
@@ -186,7 +183,6 @@ ajv 8.9.0
ajv 6.12.6 MIT https://github.com/ajv-validator/ajv.git ajv 6.12.6 MIT https://github.com/ajv-validator/ajv.git
ajv-errors 1.0.1 MIT git+https://github.com/epoberezkin/ajv-errors.git ajv-errors 1.0.1 MIT git+https://github.com/epoberezkin/ajv-errors.git
ajv-keywords 3.5.2 MIT git+https://github.com/epoberezkin/ajv-keywords.git ajv-keywords 3.5.2 MIT git+https://github.com/epoberezkin/ajv-keywords.git
alertifyjs 1.7.1 MIT git@github.com:MohammadYounes/AlertifyJS.git
alphanum-sort 1.0.2 MIT https://github.com/TrySound/alphanum-sort.git alphanum-sort 1.0.2 MIT https://github.com/TrySound/alphanum-sort.git
ansi-styles 3.2.1 MIT https://github.com/chalk/ansi-styles.git ansi-styles 3.2.1 MIT https://github.com/chalk/ansi-styles.git
array-union 3.0.1 MIT https://github.com/sindresorhus/array-union.git array-union 3.0.1 MIT https://github.com/sindresorhus/array-union.git
@@ -201,12 +197,6 @@ babel-plugin-styled-components 1.13.3
babel-plugin-syntax-jsx 6.18.0 MIT https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx babel-plugin-syntax-jsx 6.18.0 MIT https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx
babelify 10.0.0 MIT https://github.com/babel/babelify.git babelify 10.0.0 MIT https://github.com/babel/babelify.git
backbone 1.4.0 MIT https://github.com/jashkenas/backbone.git backbone 1.4.0 MIT https://github.com/jashkenas/backbone.git
backbone 1.2.3 MIT https://github.com/jashkenas/backbone.git
backbone 1.3.3 MIT https://github.com/jashkenas/backbone.git
backform 0.2.0 MIT https://github.com/AmiliaApp/backform
backgrid 0.3.8 MIT http://github.com/cloudflare/backgrid
backgrid-filter 0.3.7 MIT git://github.com/wyuenho/backgrid-text-cell.git
backgrid-select-all 0.3.5 MIT git://github.com/wyuenho/backgrid-select-all.git
backo2 1.0.2 MIT https://github.com/mokesmokes/backo.git backo2 1.0.2 MIT https://github.com/mokesmokes/backo.git
balanced-match 1.0.2 MIT git://github.com/juliangruber/balanced-match.git balanced-match 1.0.2 MIT git://github.com/juliangruber/balanced-match.git
base64-arraybuffer 0.2.0 MIT https://github.com/niklasvh/base64-arraybuffer base64-arraybuffer 0.2.0 MIT https://github.com/niklasvh/base64-arraybuffer
@@ -366,7 +356,6 @@ lodash.noop 2.3.0
lodash.support 2.3.0 MIT https://github.com/lodash/lodash-cli.git lodash.support 2.3.0 MIT https://github.com/lodash/lodash-cli.git
lodash.uniq 4.5.0 MIT https://github.com/lodash/lodash.git lodash.uniq 4.5.0 MIT https://github.com/lodash/lodash.git
loose-envify 1.4.0 MIT git://github.com/zertosh/loose-envify.git loose-envify 1.4.0 MIT git://github.com/zertosh/loose-envify.git
lunr 0.7.2 MIT https://github.com/olivernn/lunr.js.git
make-dir 3.1.0 MIT https://github.com/sindresorhus/make-dir.git make-dir 3.1.0 MIT https://github.com/sindresorhus/make-dir.git
map-obj 4.3.0 MIT https://github.com/sindresorhus/map-obj.git map-obj 4.3.0 MIT https://github.com/sindresorhus/map-obj.git
map-obj 1.0.1 MIT https://github.com/sindresorhus/map-obj.git map-obj 1.0.1 MIT https://github.com/sindresorhus/map-obj.git
@@ -385,7 +374,7 @@ ml-array-rescale 1.3.6
ml-matrix 6.8.0 MIT https://github.com/mljs/matrix.git ml-matrix 6.8.0 MIT https://github.com/mljs/matrix.git
mobius1-selectr 2.4.13 MIT git+https://github.com/Mobius1/Selectr.git mobius1-selectr 2.4.13 MIT git+https://github.com/Mobius1/Selectr.git
moment 2.29.4 MIT https://github.com/moment/moment.git moment 2.29.4 MIT https://github.com/moment/moment.git
moment-timezone 0.5.34 MIT https://github.com/moment/moment-timezone.git moment-timezone 0.5.37 MIT https://github.com/moment/moment-timezone.git
ms 2.1.2 MIT https://github.com/zeit/ms.git ms 2.1.2 MIT https://github.com/zeit/ms.git
nanoid 3.3.2 MIT https://github.com/ai/nanoid.git nanoid 3.3.2 MIT https://github.com/ai/nanoid.git
nanoid 3.2.0 MIT https://github.com/ai/nanoid.git nanoid 3.2.0 MIT https://github.com/ai/nanoid.git
@@ -464,7 +453,7 @@ react 17.0.2
react-aspen 1.2.0 MIT https://github.com/neeksandhu/react-aspen.git react-aspen 1.2.0 MIT https://github.com/neeksandhu/react-aspen.git
react-aspen 1.1.1 MIT https://github.com/neeksandhu/react-aspen.git react-aspen 1.1.1 MIT https://github.com/neeksandhu/react-aspen.git
react-checkbox-tree 1.7.2 MIT https://github.com/jakezatecky/react-checkbox-tree react-checkbox-tree 1.7.2 MIT https://github.com/jakezatecky/react-checkbox-tree
react-data-grid 7.0.0-beta.12 MIT https://github.com/adazzle/react-data-grid.git react-data-grid 7.0.0-beta.14 MIT https://github.com/adazzle/react-data-grid.git
react-dom 16.14.0 MIT git+https://github.com/facebook/react.git react-dom 16.14.0 MIT git+https://github.com/facebook/react.git
react-dom 17.0.2 MIT https://github.com/facebook/react.git react-dom 17.0.2 MIT https://github.com/facebook/react.git
react-draggable 4.4.4 MIT https://github.com/react-grid-layout/react-draggable.git react-draggable 4.4.4 MIT https://github.com/react-grid-layout/react-draggable.git
@@ -499,7 +488,6 @@ select2 4.0.13
shallowequal 1.1.0 MIT https://github.com/dashed/shallowequal.git shallowequal 1.1.0 MIT https://github.com/dashed/shallowequal.git
shim-loader 1.0.1 MIT https://github.com/zinserjan/shim-loader shim-loader 1.0.1 MIT https://github.com/zinserjan/shim-loader
slash 4.0.0 MIT https://github.com/sindresorhus/slash.git slash 4.0.0 MIT https://github.com/sindresorhus/slash.git
slickgrid 2.3.16 MIT git+https://github.com/6pac/SlickGrid.git
snapsvg-cjs 0.0.6 MIT git+https://github.com/geelen/Snap.svg-cjs.git snapsvg-cjs 0.0.6 MIT git+https://github.com/geelen/Snap.svg-cjs.git
socket.io-client 4.3.2 MIT https://github.com/socketio/socket.io-client.git socket.io-client 4.3.2 MIT https://github.com/socketio/socket.io-client.git
socket.io-parser 4.1.1 MIT https://github.com/socketio/socket.io-parser.git socket.io-parser 4.1.1 MIT https://github.com/socketio/socket.io-parser.git
@@ -521,7 +509,6 @@ text-segmentation 1.0.2
timsort 0.3.0 MIT https://github.com/mziccard/node-timsort.git timsort 0.3.0 MIT https://github.com/mziccard/node-timsort.git
tiny-emitter 2.1.0 MIT https://github.com/scottcorgan/tiny-emitter.git tiny-emitter 2.1.0 MIT https://github.com/scottcorgan/tiny-emitter.git
tiny-warning 1.0.3 MIT https://github.com/alexreardon/tiny-warning.git tiny-warning 1.0.3 MIT https://github.com/alexreardon/tiny-warning.git
tippy.js 6.3.5 MIT git+https://github.com/atomiks/tippyjs.git
to-fast-properties 2.0.0 MIT https://github.com/sindresorhus/to-fast-properties.git to-fast-properties 2.0.0 MIT https://github.com/sindresorhus/to-fast-properties.git
to-regex-range 5.0.1 MIT https://github.com/micromatch/to-regex-range.git to-regex-range 5.0.1 MIT https://github.com/micromatch/to-regex-range.git
trim-newlines 4.0.2 MIT https://github.com/sindresorhus/trim-newlines.git trim-newlines 4.0.2 MIT https://github.com/sindresorhus/trim-newlines.git
@@ -620,5 +607,5 @@ tslib 2.4.0
tslib 2.3.0 0BSD https://github.com/Microsoft/tslib.git tslib 2.3.0 0BSD https://github.com/Microsoft/tslib.git
type-fest 1.4.0 (MIT OR CC0-1.0) https://github.com/sindresorhus/type-fest.git type-fest 1.4.0 (MIT OR CC0-1.0) https://github.com/sindresorhus/type-fest.git
540 dependencies listed. 528 dependencies listed.

View File

@@ -21,6 +21,7 @@ Housekeeping
************ ************
| `Issue #5293 <https://github.com/pgadmin-org/pgadmin4/issues/5293>`_ - Ensure that the tooltips are consistent throughout the entire application. | `Issue #5293 <https://github.com/pgadmin-org/pgadmin4/issues/5293>`_ - Ensure that the tooltips are consistent throughout the entire application.
| `Issue #5357 <https://github.com/pgadmin-org/pgadmin4/issues/5357>`_ - Remove Python's 'Six' package completely.
Bug fixes Bug fixes
********* *********
@@ -33,4 +34,4 @@ Bug fixes
| `Issue #5261 <https://github.com/pgadmin-org/pgadmin4/issues/5261>`_ - Ensure that the search filter should be cleared when a new row is added to the user management. | `Issue #5261 <https://github.com/pgadmin-org/pgadmin4/issues/5261>`_ - Ensure that the search filter should be cleared when a new row is added to the user management.
| `Issue #5262 <https://github.com/pgadmin-org/pgadmin4/issues/5262>`_ - Ensure that the user management dialog should not allow the same email addresses with different letter casings when creating users. | `Issue #5262 <https://github.com/pgadmin-org/pgadmin4/issues/5262>`_ - Ensure that the user management dialog should not allow the same email addresses with different letter casings when creating users.
| `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty. | `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty.
| `Issue #5368 <https://github.com/pgadmin-org/pgadmin4/issues/5368>`_ - Fixed the issue while downloading the file from file manager. | `Issue #5368 <https://github.com/pgadmin-org/pgadmin4/issues/5368>`_ - Fixed the issue while downloading the file from the file manager.

View File

@@ -25,7 +25,6 @@ WTForms==3.*
passlib==1.* passlib==1.*
pytz==2021.* pytz==2021.*
simplejson==3.* simplejson==3.*
six==1.*
speaklater3==1.* speaklater3==1.*
sqlparse==0.* sqlparse==0.*
psutil==5.* psutil==5.*

View File

@@ -9,7 +9,6 @@
"""Implements Internal Authentication""" """Implements Internal Authentication"""
import six
from flask import current_app, flash from flask import current_app, flash
from flask_security import login_user from flask_security import login_user
from abc import abstractmethod, abstractproperty from abc import abstractmethod, abstractproperty
@@ -21,8 +20,7 @@ from pgadmin.utils.validation_utils import validate_email
from pgadmin.utils.constants import INTERNAL from pgadmin.utils.constants import INTERNAL
@six.add_metaclass(AuthSourceRegistry) class BaseAuthentication(object, metaclass=AuthSourceRegistry):
class BaseAuthentication(object):
DEFAULT_MSG = { DEFAULT_MSG = {
'USER_DOES_NOT_EXIST': gettext('Incorrect username or password.'), 'USER_DOES_NOT_EXIST': gettext('Incorrect username or password.'),

View File

@@ -9,7 +9,6 @@
"""External 2FA Authentication Registry.""" """External 2FA Authentication Registry."""
from abc import abstractmethod, abstractproperty from abc import abstractmethod, abstractproperty
import six
from typing import Union from typing import Union
import flask import flask
@@ -50,8 +49,7 @@ MultiFactorAuthRegistry = create_registry_metaclass(
) )
@six.add_metaclass(MultiFactorAuthRegistry) class BaseMFAuth(metaclass=MultiFactorAuthRegistry):
class BaseMFAuth():
""" """
Base Multi-Factor Authentication (MFA) class Base Multi-Factor Authentication (MFA) class
@@ -60,7 +58,8 @@ class BaseMFAuth():
available as a MFA method. available as a MFA method.
""" """
@abstractproperty @property
@abstractmethod
def name(self) -> str: def name(self) -> str:
""" """
Represents the short name for the authentiation method. It can be used Represents the short name for the authentiation method. It can be used
@@ -74,7 +73,8 @@ class BaseMFAuth():
""" """
pass pass
@abstractproperty @property
@abstractmethod
def label(self) -> str: def label(self) -> str:
""" """
Represents the user visible name for the authentiation method. It will Represents the user visible name for the authentiation method. It will

View File

@@ -18,7 +18,6 @@ from smtplib import SMTPConnectError, SMTPResponseException, \
from socket import error as SOCKETErrorException from socket import error as SOCKETErrorException
from urllib.request import urlopen from urllib.request import urlopen
import six
import time import time
from flask import current_app, render_template, url_for, make_response, \ from flask import current_app, render_template, url_for, make_response, \
flash, Response, request, after_this_request, redirect, session flash, Response, request, after_this_request, redirect, session
@@ -227,8 +226,7 @@ class BrowserModule(PgAdminModule):
blueprint = BrowserModule(MODULE_NAME, __name__) blueprint = BrowserModule(MODULE_NAME, __name__)
@six.add_metaclass(ABCMeta) class BrowserPluginModule(PgAdminModule, metaclass=ABCMeta):
class BrowserPluginModule(PgAdminModule):
""" """
Abstract base class for browser submodules. Abstract base class for browser submodules.
@@ -351,11 +349,13 @@ class BrowserPluginModule(PgAdminModule):
""" """
return [] return []
@abstractproperty @property
@abstractmethod
def node_type(self): def node_type(self):
pass pass
@abstractproperty @property
@abstractmethod
def script_load(self): def script_load(self):
""" """
This property defines, when to load this script. This property defines, when to load this script.

View File

@@ -9,8 +9,7 @@
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
import six from flask import render_template
from flask import url_for, render_template
from flask_babel import gettext from flask_babel import gettext
from pgadmin.browser import BrowserPluginModule from pgadmin.browser import BrowserPluginModule
from pgadmin.browser.utils import PGChildModule from pgadmin.browser.utils import PGChildModule
@@ -19,8 +18,7 @@ from pgadmin.utils.preferences import Preferences
from pgadmin.utils.constants import PGADMIN_NODE from pgadmin.utils.constants import PGADMIN_NODE
@six.add_metaclass(ABCMeta) class CollectionNodeModule(PgAdminModule, PGChildModule, metaclass=ABCMeta):
class CollectionNodeModule(PgAdminModule, PGChildModule):
""" """
Base class for collection node submodules. Base class for collection node submodules.
""" """

View File

@@ -12,7 +12,6 @@
import simplejson as json import simplejson as json
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
import six
from flask import request, jsonify, render_template from flask import request, jsonify, render_template
from flask_babel import gettext from flask_babel import gettext
from flask_security import current_user, login_required from flask_security import current_user, login_required
@@ -139,8 +138,7 @@ class ServerGroupMenuItem(MenuItem):
super(ServerGroupMenuItem, self).__init__(**kwargs) super(ServerGroupMenuItem, self).__init__(**kwargs)
@six.add_metaclass(ABCMeta) class ServerGroupPluginModule(BrowserPluginModule, metaclass=ABCMeta):
class ServerGroupPluginModule(BrowserPluginModule):
""" """
Base class for server group plugins. Base class for server group plugins.
""" """

View File

@@ -56,7 +56,8 @@ def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
class IProcessDesc(object, metaclass=ABCMeta): class IProcessDesc(object, metaclass=ABCMeta):
@abstractproperty @property
@abstractmethod
def message(self): def message(self):
pass pass

View File

@@ -8,9 +8,6 @@ import sys
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import config import config
import six
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import Any from typing import Any
import msal_extensions import msal_extensions
@@ -132,7 +129,7 @@ def _get_persistence(
' the cache unencrypted' ' the cache unencrypted'
" instead of raising this exception." " instead of raising this exception."
) )
six.raise_from(error, ex) raise error
return msal_extensions.FilePersistence(cache_file_path) return msal_extensions.FilePersistence(cache_file_path)
raise NotImplementedError("A persistent cache is not " raise NotImplementedError("A persistent cache is not "

View File

@@ -11,7 +11,6 @@
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from collections import OrderedDict from collections import OrderedDict
import six
from flask import render_template from flask import render_template
from flask_babel import gettext from flask_babel import gettext
from werkzeug.exceptions import InternalServerError from werkzeug.exceptions import InternalServerError
@@ -76,8 +75,7 @@ class ObjectRegistry(ABCMeta):
) )
@six.add_metaclass(ObjectRegistry) class BaseCommand(object, metaclass=ObjectRegistry):
class BaseCommand(object):
""" """
class BaseCommand class BaseCommand

View File

@@ -10,14 +10,10 @@
"""Implement the Base class for Driver and Connection""" """Implement the Base class for Driver and Connection"""
from abc import ABCMeta, abstractmethod, abstractproperty from abc import ABCMeta, abstractmethod, abstractproperty
import six
from .registry import DriverRegistry from .registry import DriverRegistry
@six.add_metaclass(DriverRegistry) class BaseDriver(object, metaclass=DriverRegistry):
class BaseDriver(object):
""" """
class BaseDriver(object): class BaseDriver(object):
@@ -50,11 +46,13 @@ class BaseDriver(object):
configuration. configuration.
""" """
@abstractproperty @property
@abstractmethod
def version(cls): def version(cls):
pass pass
@abstractproperty @property
@abstractmethod
def libpq_version(cls): def libpq_version(cls):
pass pass
@@ -71,8 +69,7 @@ class BaseDriver(object):
pass pass
@six.add_metaclass(ABCMeta) class BaseConnection(object, metaclass=ABCMeta):
class BaseConnection(object):
""" """
class BaseConnection(object) class BaseConnection(object)

View File

@@ -6,7 +6,6 @@
# This software is released under the PostgreSQL Licence # This software is released under the PostgreSQL Licence
# #
########################################################################## ##########################################################################
import six
from pgadmin.utils.dynamic_registry import create_registry_metaclass from pgadmin.utils.dynamic_registry import create_registry_metaclass
from .registry import TestModuleRegistry, TestNamedRegistry, TestNameBase from .registry import TestModuleRegistry, TestNamedRegistry, TestNameBase
from .test1 import TestModule1 from .test1 import TestModule1
@@ -86,8 +85,7 @@ def test_create_base_class():
'RegistryWithBaseClass', __package__, decorate_as_module=False 'RegistryWithBaseClass', __package__, decorate_as_module=False
) )
@six.add_metaclass(RegistryWithBaseClass) class TestBase(object, metaclass=RegistryWithBaseClass):
class TestBase(object):
pass pass
registry = RegistryWithBaseClass._registry registry = RegistryWithBaseClass._registry

View File

@@ -6,7 +6,6 @@
# This software is released under the PostgreSQL Licence # This software is released under the PostgreSQL Licence
# #
########################################################################## ##########################################################################
import six
from pgadmin.utils.dynamic_registry import create_registry_metaclass from pgadmin.utils.dynamic_registry import create_registry_metaclass
@@ -20,13 +19,11 @@ TestNamedRegistry = create_registry_metaclass(
) )
@six.add_metaclass(TestModuleRegistry) class TestModuleBase(object, metaclass=TestModuleRegistry):
class TestModuleBase(object):
pass pass
@six.add_metaclass(TestNamedRegistry) class TestNameBase(object, metaclass=TestNamedRegistry):
class TestNameBase(object):
pass pass

View File

@@ -12,7 +12,6 @@ import traceback
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from importlib import import_module from importlib import import_module
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
@@ -122,8 +121,7 @@ class TestsGeneratorRegistry(ABCMeta):
traceback.print_exc(file=sys.stderr) traceback.print_exc(file=sys.stderr)
@six.add_metaclass(TestsGeneratorRegistry) class BaseTestGenerator(unittest.TestCase, metaclass=TestsGeneratorRegistry):
class BaseTestGenerator(unittest.TestCase):
# Defining abstract method which will override by individual testcase. # Defining abstract method which will override by individual testcase.
def setUp(self): def setUp(self):