Drop Python 3.8

This commit is contained in:
grossmj 2024-12-30 15:36:40 +07:00
parent 8b57fbaa0a
commit 5269d4386c
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7
5 changed files with 11 additions and 22 deletions

View File

@ -18,7 +18,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: ["ubuntu-latest"] os: ["ubuntu-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
#include: #include:
# only test with Python 3.10 on Windows # only test with Python 3.10 on Windows
# - os: windows-latest # - os: windows-latest

View File

@ -267,9 +267,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.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")
log.info( log.info(
"Running with Python {major}.{minor}.{micro} and has PID {pid}".format( "Running with Python {major}.{minor}.{micro} and has PID {pid}".format(

View File

@ -97,18 +97,10 @@ async def wait_for_process_termination(process, timeout=10):
:param timeout: Timeout in seconds :param timeout: Timeout in seconds
""" """
if sys.version_info >= (3, 5): try:
try: await asyncio.wait_for(process.wait(), timeout=timeout)
await asyncio.wait_for(process.wait(), timeout=timeout) except ProcessLookupError:
except ProcessLookupError: return
return
else:
while timeout > 0:
if process.returncode is not None:
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):

View File

@ -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:

View File

@ -10,7 +10,7 @@ authors = [
{ name = "Jeremy Grossmann", email = "developers@gns3.com" } { name = "Jeremy Grossmann", email = "developers@gns3.com" }
] ]
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.9"
classifiers = [ classifiers = [
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Environment :: Console", "Environment :: Console",
@ -21,11 +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.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",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython" "Programming Language :: Python :: Implementation :: CPython"
] ]