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

2) Replace deprecated @abstractproperty with @property, @abstractmethod.
pull/5372/head
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/
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
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.
@ -39,7 +39,6 @@ WTForms 3.0.1
passlib 1.7.4 BSD https://passlib.readthedocs.io
pytz 2021.3 MIT http://pythonhosted.org/pytz
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
sqlparse 0.4.2 BSD-3-Clause https://github.com/andialbrecht/sqlparse
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
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
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/
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
@ -72,7 +71,7 @@ azure-identity 1.9.0
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.
45 dependencies listed.
44 dependencies listed.
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.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
@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/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
@ -169,7 +167,6 @@ Name Version
@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
@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/json-schema 7.0.9 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-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
alertifyjs 1.7.1 MIT git@github.com:MohammadYounes/AlertifyJS.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
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
babelify 10.0.0 MIT https://github.com/babel/babelify.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
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
@ -366,7 +356,6 @@ lodash.noop 2.3.0
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
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
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
@ -385,7 +374,7 @@ ml-array-rescale 1.3.6
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
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
nanoid 3.3.2 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.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-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 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
@ -499,7 +488,6 @@ select2 4.0.13
shallowequal 1.1.0 MIT https://github.com/dashed/shallowequal.git
shim-loader 1.0.1 MIT https://github.com/zinserjan/shim-loader
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
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
@ -521,7 +509,6 @@ text-segmentation 1.0.2
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-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-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
@ -620,5 +607,5 @@ tslib 2.4.0
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
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 #5357 <https://github.com/pgadmin-org/pgadmin4/issues/5357>`_ - Remove Python's 'Six' package completely.
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 #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 #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.*
pytz==2021.*
simplejson==3.*
six==1.*
speaklater3==1.*
sqlparse==0.*
psutil==5.*

View File

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

View File

@ -9,7 +9,6 @@
"""External 2FA Authentication Registry."""
from abc import abstractmethod, abstractproperty
import six
from typing import Union
import flask
@ -50,8 +49,7 @@ MultiFactorAuthRegistry = create_registry_metaclass(
)
@six.add_metaclass(MultiFactorAuthRegistry)
class BaseMFAuth():
class BaseMFAuth(metaclass=MultiFactorAuthRegistry):
"""
Base Multi-Factor Authentication (MFA) class
@ -60,7 +58,8 @@ class BaseMFAuth():
available as a MFA method.
"""
@abstractproperty
@property
@abstractmethod
def name(self) -> str:
"""
Represents the short name for the authentiation method. It can be used
@ -74,7 +73,8 @@ class BaseMFAuth():
"""
pass
@abstractproperty
@property
@abstractmethod
def label(self) -> str:
"""
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 urllib.request import urlopen
import six
import time
from flask import current_app, render_template, url_for, make_response, \
flash, Response, request, after_this_request, redirect, session
@ -227,8 +226,7 @@ class BrowserModule(PgAdminModule):
blueprint = BrowserModule(MODULE_NAME, __name__)
@six.add_metaclass(ABCMeta)
class BrowserPluginModule(PgAdminModule):
class BrowserPluginModule(PgAdminModule, metaclass=ABCMeta):
"""
Abstract base class for browser submodules.
@ -351,11 +349,13 @@ class BrowserPluginModule(PgAdminModule):
"""
return []
@abstractproperty
@property
@abstractmethod
def node_type(self):
pass
@abstractproperty
@property
@abstractmethod
def script_load(self):
"""
This property defines, when to load this script.

View File

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

View File

@ -12,7 +12,6 @@
import simplejson as json
from abc import ABCMeta, abstractmethod
import six
from flask import request, jsonify, render_template
from flask_babel import gettext
from flask_security import current_user, login_required
@ -139,8 +138,7 @@ class ServerGroupMenuItem(MenuItem):
super(ServerGroupMenuItem, self).__init__(**kwargs)
@six.add_metaclass(ABCMeta)
class ServerGroupPluginModule(BrowserPluginModule):
class ServerGroupPluginModule(BrowserPluginModule, metaclass=ABCMeta):
"""
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):
@abstractproperty
@property
@abstractmethod
def message(self):
pass

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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