Update SQLAlchemy, Flask, Flask-SQLAlchemy, and other packages to current versions. #5901

- Update Flask, Flask-SQLAlchemy, Flask-Babel, Flask-Security-Too, Flask-SocketIO, pytz, psutil, SQLAlchemy, bcrypt, cryptography, eventlet, Authlib, requests python packages
- Remove pinned dnspython, Werkzeug packages from requirements.txt
This commit is contained in:
Aditya Toshniwal
2023-03-15 11:57:16 +05:30
committed by GitHub
parent 294282c7ca
commit 292d76b39e
21 changed files with 176 additions and 202 deletions

View File

@@ -40,10 +40,6 @@ if (3, 10) > sys.version_info > (3, 8) and os.name == 'posix':
# This was causing issue in psycopg3
from eventlet import hubs
hubs.use_hub("poll")
# Ref: https://github.com/miguelgrinberg/python-socketio/issues/567
# Resolve BigAnimal API issue
import selectors
selectors.DefaultSelector = selectors.PollSelector
import config
import setup
@@ -101,7 +97,6 @@ if not os.path.isfile(config.SQLITE_PATH):
# it can be imported
##########################################################################
app = create_app()
app.debug = False
app.config['sessions'] = dict()
if setup_db_required:
@@ -163,22 +158,6 @@ def main():
setattr(sys, _name,
open(os.devnull, 'r' if _name == 'stdin' else 'w'))
# Build Javascript files when DEBUG
if config.DEBUG:
from pgadmin.utils.javascript.javascript_bundler import \
JavascriptBundler, JsState
app.debug = True
javascript_bundler = JavascriptBundler()
javascript_bundler.bundle()
if javascript_bundler.report() == JsState.NONE:
app.logger.error(
"Unable to generate javascript.\n"
"To run the app ensure that yarn install command runs "
"successfully"
)
raise RuntimeError("No generated javascript, aborting")
# Output a startup message if we're not under the runtime and startup.
# If we're under WSGI, we don't need to worry about this
if not app.PGADMIN_RUNTIME:
@@ -213,19 +192,19 @@ def main():
app.run(
host=config.DEFAULT_SERVER,
port=config.EFFECTIVE_SERVER_PORT,
debug=config.DEBUG,
use_reloader=(
(not app.PGADMIN_RUNTIME) and app.debug and
(not app.PGADMIN_RUNTIME) and
os.environ.get("WERKZEUG_RUN_MAIN") is not None
),
threaded=config.THREADED_MODE
)
else:
# Can use cheroot instead of flask dev server when not in debug
# 10 is default thread count in CherootServer
# num_threads = 10 if config.THREADED_MODE else 1
try:
socketio.run(
app,
debug=config.DEBUG,
allow_unsafe_werkzeug=True,
host=config.DEFAULT_SERVER,
port=config.EFFECTIVE_SERVER_PORT,
)