mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Drop Python 3.8 support
This commit is contained in:
parent
ef2cf277c1
commit
4335fd7ce0
@ -235,9 +235,9 @@ def run():
|
|||||||
return
|
return
|
||||||
log.info("HTTP authentication is enabled with username '{}'".format(user))
|
log.info("HTTP authentication is enabled with username '{}'".format(user))
|
||||||
|
|
||||||
# we only support Python 3 version >= 3.8
|
# we only support Python 3 version >= 3.9
|
||||||
if sys.version_info < (3, 8, 0):
|
if sys.version_info < (3, 9, 0):
|
||||||
raise SystemExit("Python 3.8 or higher is required")
|
raise SystemExit("Python 3.9 or higher is required")
|
||||||
|
|
||||||
user_log.info("Running with Python {major}.{minor}.{micro} and has PID {pid}".format(major=sys.version_info[0], minor=sys.version_info[1],
|
user_log.info("Running with Python {major}.{minor}.{micro} and has PID {pid}".format(major=sys.version_info[0], minor=sys.version_info[1],
|
||||||
micro=sys.version_info[2], pid=os.getpid()))
|
micro=sys.version_info[2], pid=os.getpid()))
|
||||||
|
|||||||
@ -91,25 +91,16 @@ async def wait_for_process_termination(process, timeout=10):
|
|||||||
In theory this can be implemented by just:
|
In theory this can be implemented by just:
|
||||||
await asyncio.wait_for(self._iou_process.wait(), timeout=100)
|
await asyncio.wait_for(self._iou_process.wait(), timeout=100)
|
||||||
|
|
||||||
But it's broken before Python 3.4:
|
|
||||||
http://bugs.python.org/issue23140
|
|
||||||
|
|
||||||
:param process: An asyncio subprocess
|
:param process: An asyncio subprocess
|
||||||
:param timeout: Timeout in seconds
|
:param timeout: Timeout in seconds
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if sys.version_info >= (3, 5):
|
while timeout > 0:
|
||||||
try:
|
if process.returncode is not None:
|
||||||
await asyncio.wait_for(process.wait(), timeout=timeout)
|
|
||||||
except ProcessLookupError:
|
|
||||||
return
|
return
|
||||||
else:
|
await asyncio.sleep(0.1)
|
||||||
while timeout > 0:
|
timeout -= 0.1
|
||||||
if process.returncode is not None:
|
raise asyncio.TimeoutError()
|
||||||
return
|
|
||||||
await asyncio.sleep(0.1)
|
|
||||||
timeout -= 0.1
|
|
||||||
raise asyncio.TimeoutError()
|
|
||||||
|
|
||||||
|
|
||||||
async def _check_process(process, termination_callback):
|
async def _check_process(process, termination_callback):
|
||||||
|
|||||||
@ -40,10 +40,7 @@ class Pool():
|
|||||||
while len(self._tasks) > 0 or len(pending) > 0:
|
while len(self._tasks) > 0 or len(pending) > 0:
|
||||||
while len(self._tasks) > 0 and len(pending) < self._concurrency:
|
while len(self._tasks) > 0 and len(pending) < self._concurrency:
|
||||||
task, args, kwargs = self._tasks.pop(0)
|
task, args, kwargs = self._tasks.pop(0)
|
||||||
if sys.version_info >= (3, 7):
|
t = asyncio.create_task(task(*args, **kwargs))
|
||||||
t = asyncio.create_task(task(*args, **kwargs))
|
|
||||||
else:
|
|
||||||
t = asyncio.get_event_loop().create_task(task(*args, **kwargs))
|
|
||||||
pending.add(t)
|
pending.add(t)
|
||||||
(done, pending) = await asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED)
|
(done, pending) = await asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED)
|
||||||
for task in done:
|
for task in done:
|
||||||
|
|||||||
5
setup.py
5
setup.py
@ -21,8 +21,8 @@ from setuptools import setup, find_packages
|
|||||||
from setuptools.command.test import test as TestCommand
|
from setuptools.command.test import test as TestCommand
|
||||||
|
|
||||||
# we only support Python 3 version >= 3.8
|
# we only support Python 3 version >= 3.8
|
||||||
if len(sys.argv) >= 2 and sys.argv[1] == "install" and sys.version_info < (3, 8):
|
if len(sys.argv) >= 2 and sys.argv[1] == "install" and sys.version_info < (3, 9):
|
||||||
raise SystemExit("Python 3.8 or higher is required")
|
raise SystemExit("Python 3.9 or higher is required")
|
||||||
|
|
||||||
|
|
||||||
class PyTest(TestCommand):
|
class PyTest(TestCommand):
|
||||||
@ -78,7 +78,6 @@ setup(
|
|||||||
"Operating System :: Microsoft :: Windows",
|
"Operating System :: Microsoft :: Windows",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
"Programming Language :: Python :: 3.8",
|
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user