From 1f1d81eb47027fa31ef07a7b84d6c872e83c4450 Mon Sep 17 00:00:00 2001 From: Reimar Bauer Date: Mon, 30 Mar 2026 16:59:36 +0200 Subject: [PATCH 1/2] remove eventlet --- mslib/mscolab/sockets_manager.py | 1 + tests/_test_msui/test_wms_control.py | 5 +++-- tests/fixtures.py | 23 +++++++++++------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/mslib/mscolab/sockets_manager.py b/mslib/mscolab/sockets_manager.py index 79dd15a5b..be7201e44 100644 --- a/mslib/mscolab/sockets_manager.py +++ b/mslib/mscolab/sockets_manager.py @@ -37,6 +37,7 @@ from mslib.mscolab.app import APP socketio = SocketIO(logger=APP.config['SOCKETIO_LOGGER'], engineio_logger=APP.config['ENGINEIO_LOGGER'], + async_mode='threading', cors_allowed_origins=("*" if not hasattr(APP, "CORS_ORIGINS") or "*" in APP.config['CORS_ORIGINS'] else APP.config['CORS_ORIGINS'])) diff --git a/tests/_test_msui/test_wms_control.py b/tests/_test_msui/test_wms_control.py index 219964c04..2208e5a5e 100644 --- a/tests/_test_msui/test_wms_control.py +++ b/tests/_test_msui/test_wms_control.py @@ -30,7 +30,7 @@ import pytest import hashlib import urllib -import eventlet +import socket from PyQt5 import QtCore, QtTest from mslib.msui import flighttrack as ft from mslib.utils.service_manager import WMSServiceManager @@ -105,7 +105,8 @@ def test_no_server(self, qtbot): assert that a message box informs about server troubles """ # get a free port which we haven't used - sock = eventlet.listen((self.host, 0)) + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.bind((self.host, 0)) port = sock.getsockname()[1] sock.close() with mock.patch("PyQt5.QtWidgets.QMessageBox.critical") as mock_critical: diff --git a/tests/fixtures.py b/tests/fixtures.py index b8b249bdc..38764f56a 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -30,8 +30,7 @@ import urllib import socketio import mslib.mswms.mswms -import eventlet -import eventlet.wsgi +from werkzeug.serving import make_server from PyQt5 import QtWidgets from contextlib import contextmanager @@ -125,7 +124,7 @@ def mscolab_session_server(mscolab_session_app, mscolab_session_managers): This fixture should not be used in tests. Instead use :func:`mscolab_server`, which handles per-test cleanup as well. """ - with _running_eventlet_server(mscolab_session_app) as url: + with _running_server(mscolab_session_app) as url: # Wait until the Flask-SocketIO server is ready for connections sio = socketio.Client() sio.connect(url, retry=True, wait_timeout=60) @@ -186,23 +185,23 @@ def mswms_server(mswms_app): :returns: The URL where the server is running. """ - with _running_eventlet_server(mswms_app) as url: + with _running_server(mswms_app) as url: yield url -def _start_eventlet_server(host, port_queue, app): +def _start_server(host, port_queue, app): """ - Starts the Eventlet server and sends the chosen port back to the parent process. + Starts a werkzeug server and sends the chosen port back to the parent process. """ - sock = eventlet.listen((host, 0)) - port = sock.getsockname()[1] + srv = make_server(host, 0, app, threaded=True) + port = srv.server_address[1] port_queue.put(port) - eventlet.wsgi.server(sock, app, log_output=False) + srv.serve_forever() @contextmanager -def _running_eventlet_server(app): - """Context manager that starts the app in an eventlet server and returns its URL.""" +def _running_server(app): + """Context manager that starts the app in a werkzeug server and returns its URL.""" scheme = "http" host = "127.0.0.1" @@ -213,7 +212,7 @@ def _running_eventlet_server(app): # We are using a queue to retrieve the port selected in the child process. port_queue = ctx.Queue() - process = ctx.Process(target=_start_eventlet_server, args=(host, port_queue, app), daemon=True) + process = ctx.Process(target=_start_server, args=(host, port_queue, app), daemon=True) try: process.start() # Retrieve the port from the queue From b792f5c7c519956bccb40aed17144a4ac002d8f5 Mon Sep 17 00:00:00 2001 From: Reimar Bauer Date: Mon, 30 Mar 2026 17:03:40 +0200 Subject: [PATCH 2/2] pixi files update --- pixi.lock | 17 ----------------- pixi.toml | 1 - 2 files changed, 18 deletions(-) diff --git a/pixi.lock b/pixi.lock index a459953ea..c43f4cf55 100644 --- a/pixi.lock +++ b/pixi.lock @@ -2239,7 +2239,6 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.3.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.3.0-hd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/esmf-8.9.1-nompi_h8d4c64c_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/eventlet-0.40.4-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/execnet-2.1.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/fastkml-1.4.0-pyhd8ed1ab_0.conda @@ -2594,7 +2593,6 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.3.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.3.0-hd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/esmf-8.9.1-nompi_heddb8e4_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/eventlet-0.40.4-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/execnet-2.1.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/fastkml-1.4.0-pyhd8ed1ab_0.conda @@ -2900,7 +2898,6 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/elementpath-4.8.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/email-validator-2.3.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/email_validator-2.3.0-hd8ed1ab_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/eventlet-0.40.4-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/execnet-2.1.2-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/fastkml-1.4.0-pyhd8ed1ab_0.conda @@ -6768,20 +6765,6 @@ packages: purls: [] size: 24085535 timestamp: 1767777453164 -- conda: https://conda.anaconda.org/conda-forge/noarch/eventlet-0.40.4-pyhcf101f3_0.conda - sha256: 0f5c83df057c0dbb8dfd992350c5335be79ff96c3b8dc2f679cd46d65ed182eb - md5: d449200abb424292e69354fb21598836 - depends: - - python >=3.10 - - greenlet >=1.0 - - dnspython >=1.15.0 - - python - license: MIT - license_family: MIT - purls: - - pkg:pypi/eventlet?source=hash-mapping - size: 325789 - timestamp: 1764167180184 - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda sha256: ee6cf346d017d954255bbcbdb424cddea4d14e4ed7e9813e429db1d795d01144 md5: 8e662bd460bda79b1ea39194e3c4c9ab diff --git a/pixi.toml b/pixi.toml index 604b7c265..76c27c2da 100644 --- a/pixi.toml +++ b/pixi.toml @@ -91,7 +91,6 @@ geopy = "*" codespell = "*" coveralls = "*" dnspython = ">=2.0.0, <2.3.0" -eventlet = ">0.30.2" flake8 = "*" flake8-builtins = "*" gsl = "==2.7.0"