mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-21 18:32:23 +03:00
fix: drop Python 3.10 and add Python 3.15 support
This commit is contained in:
parent
83d5bf6835
commit
811b45f863
2
.github/workflows/testing.yml
vendored
2
.github/workflows/testing.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|||||||
@ -28,11 +28,8 @@ from typing import Any
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
|
||||||
from asyncio import timeout as async_timeout
|
|
||||||
else:
|
|
||||||
from async_timeout import timeout as async_timeout
|
|
||||||
|
|
||||||
|
from asyncio import timeout as async_timeout
|
||||||
from gns3server.utils import parse_version
|
from gns3server.utils import parse_version
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@ -671,11 +671,7 @@ class BaseNode:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# keep forwarding websocket data in both direction
|
# keep forwarding websocket data in both direction
|
||||||
if sys.version_info >= (3, 11, 0):
|
aws = [asyncio.create_task(ws_forward(telnet_writer)), asyncio.create_task(telnet_forward(telnet_reader))]
|
||||||
# Starting with Python 3.11, passing coroutine objects to wait() directly is forbidden.
|
|
||||||
aws = [asyncio.create_task(ws_forward(telnet_writer)), asyncio.create_task(telnet_forward(telnet_reader))]
|
|
||||||
else:
|
|
||||||
aws = [ws_forward(telnet_writer), telnet_forward(telnet_reader)]
|
|
||||||
|
|
||||||
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
||||||
for task in done:
|
for task in done:
|
||||||
@ -762,11 +758,7 @@ class BaseNode:
|
|||||||
log.warning(f"Exception while forwarding VNC data to WebSocket: {e!r}")
|
log.warning(f"Exception while forwarding VNC data to WebSocket: {e!r}")
|
||||||
|
|
||||||
# Keep forwarding WebSocket data in both directions
|
# Keep forwarding WebSocket data in both directions
|
||||||
if sys.version_info >= (3, 11, 0):
|
aws = [asyncio.create_task(ws_forward(vnc_writer)), asyncio.create_task(vnc_forward(vnc_reader))]
|
||||||
# Starting with Python 3.11, passing coroutine objects to wait() directly is forbidden.
|
|
||||||
aws = [asyncio.create_task(ws_forward(vnc_writer)), asyncio.create_task(vnc_forward(vnc_reader))]
|
|
||||||
else:
|
|
||||||
aws = [ws_forward(vnc_writer), vnc_forward(vnc_reader)]
|
|
||||||
|
|
||||||
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
||||||
for task in done:
|
for task in done:
|
||||||
|
|||||||
@ -25,10 +25,7 @@ import sys
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
from asyncio import timeout as asynctimeout
|
||||||
from asyncio import timeout as asynctimeout
|
|
||||||
else:
|
|
||||||
from async_timeout import timeout as asynctimeout
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|||||||
@ -255,9 +255,9 @@ class Server:
|
|||||||
else:
|
else:
|
||||||
log.info(f"Compute authentication is enabled with username '{config.Server.compute_username}'")
|
log.info(f"Compute authentication is enabled with username '{config.Server.compute_username}'")
|
||||||
|
|
||||||
# we only support Python 3 version >= 3.9
|
# we only support Python 3 version >= 3.11
|
||||||
if sys.version_info < (3, 9, 0):
|
if sys.version_info < (3, 11, 0):
|
||||||
raise SystemExit("Python 3.9 or higher is required")
|
raise SystemExit("Python 3.11 or higher is required")
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
f"Running with Python {sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} and has PID {os.getpid()}"
|
f"Running with Python {sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} and has PID {os.getpid()}"
|
||||||
|
|||||||
@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "gns3-server"
|
name = "gns3-server"
|
||||||
description = "GNS3 graphical interface for the GNS3 server."
|
description = "GNS3 server (controller and compute) for GNS3 network simulator"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Jeremy Grossmann", email = "developers@gns3.com" }
|
{ name = "Jeremy Grossmann", email = "developers@gns3.com" }
|
||||||
]
|
]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.11"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Environment :: Console",
|
"Environment :: Console",
|
||||||
@ -21,10 +21,11 @@ classifiers = [
|
|||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Operating System :: POSIX :: Linux",
|
"Operating System :: POSIX :: Linux",
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
"Programming Language :: Python :: 3.10",
|
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
"Programming Language :: Python :: 3.13",
|
"Programming Language :: Python :: 3.13",
|
||||||
|
"Programming Language :: Python :: 3.14",
|
||||||
|
"Programming Language :: Python :: 3.15",
|
||||||
"Programming Language :: Python :: Implementation :: CPython"
|
"Programming Language :: Python :: Implementation :: CPython"
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ packages = ["gns3server"]
|
|||||||
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py310"
|
target-version = "py311"
|
||||||
line-length = 120
|
line-length = 120
|
||||||
extend-exclude = [
|
extend-exclude = [
|
||||||
"*.md",
|
"*.md",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user