Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support python3.12&3.13 #887

Merged
merged 11 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
unittest:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: macos-13
name: Python ${{ matrix.python-version }} tests
steps:
Expand All @@ -27,7 +27,7 @@ jobs:
unittest-arm64:
strategy:
matrix:
python-version: ["3.8.10", "3.9.13", "3.10.11", "3.11.9"]
python-version: ["3.8.10", "3.9.13", "3.10.11", "3.11.9", "3.12.7"]
runs-on: macos-latest
name: Python ${{ matrix.python-version }} tests
steps:
Expand Down
2 changes: 1 addition & 1 deletion lyrebird/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def decorator(func):
'''

PYTHON_MIN_VERSION = (3, 8, 0)
PYTHON_MAX_VERSION = (3, 11, float('inf'))
PYTHON_MAX_VERSION = (3, 13, float('inf'))


'''
Expand Down
6 changes: 4 additions & 2 deletions lyrebird/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Run events handler and background task worker
"""
import os
import imp
import sys
import copy
import uuid
Expand Down Expand Up @@ -71,7 +70,10 @@ def import_func_module(path):
if pkg in sys.modules:
continue
sys.path.append(str(Path(path)/pkg))
imp.load_package(pkg, Path(path)/pkg)
spec = importlib.util.spec_from_file_location(pkg, str(Path(path)/pkg/'__init__.py'))
module = importlib.util.module_from_spec(spec)
sys.modules[pkg] = module
spec.loader.exec_module(module)


def import_func_from_file(filepath, func_name):
Expand Down
10 changes: 8 additions & 2 deletions lyrebird/plugins/plugin_loader.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import imp
import inspect
import traceback
from pathlib import Path
from collections import namedtuple

import pkg_resources
import setuptools
import importlib


from ..log import get_logger
from .plugin import Plugin
Expand Down Expand Up @@ -141,7 +142,12 @@ def load_from_path(plugin_path):
sys.modules.pop(pkg)
if pkg+'.manifest' in sys.modules:
sys.modules.pop(pkg+'.manifest')
imp.load_package(pkg, Path(plugin_path)/pkg)

spec = importlib.util.spec_from_file_location(pkg, str(Path(plugin_path)/pkg/'__init__.py'))
module = importlib.util.module_from_spec(spec)
sys.modules[pkg] = module
spec.loader.exec_module(module)

__import__(pkg+'.manifest')

# There can only one manifest in each plugin
Expand Down
2 changes: 1 addition & 1 deletion lyrebird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IVERSION = (3, 1, 2)
IVERSION = (3, 2, 0)
VERSION = ".".join(str(i) for i in IVERSION)
LYREBIRD = "Lyrebird " + VERSION
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ netifaces==0.11.0
jsonschema==4.17.0
Flask-Cors==4.0.0
redis==4.6.0
setuptools
sortedcontainers
31 changes: 22 additions & 9 deletions requirements.txt.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
aiohttp==3.8.3
aiohttp==3.9; python_version > "3.11"
urllib3==1.26.20; python_version > "3.11"
Werkzeug==3.1.3; python_version > "3.11"
yarl==1.9.4; python_version > "3.11"
Flask==3.1.0; python_version > "3.11"
frozenlist==1.5; python_version > "3.11"
itsdangerous==2.2.0; python_version > "3.11"
multidict==6.1.0; python_version > "3.11"
Pillow==11.0.0; python_version > "3.11"
setuptools==75; python_version > "3.11"

aiohttp==3.8.3; python_version <= "3.11"
urllib3==1.24.3; python_version <= "3.11"
Werkzeug==2.2.2; python_version <= "3.11"
yarl==1.8.1; python_version <= "3.11"
Flask==2.2.2; python_version <= "3.11"
frozenlist==1.3.1; python_version <= "3.11"
itsdangerous==2.1.2; python_version <= "3.11"
multidict==6.0.2; python_version <= "3.11"
Pillow==9.4.0; python_version <= "3.11"
setuptools==70; python_version <= "3.11"

aiosignal==1.2.0
aniso8601==9.0.1
async-timeout==4.0.2
Expand All @@ -11,21 +32,16 @@ chardet==3.0.4
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.1
Flask==2.2.2
Flask-RESTful==0.3.9
Flask-SocketIO==5.3.0
Flask-Cors==4.0.0
frozenlist==1.3.1
idna==2.8
importlib-metadata==5.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
jsonschema==4.17.0
MarkupSafe==2.1.1
multidict==6.0.2
netifaces==0.11.0
packaging==19.0
Pillow==9.4.0
portpicker==1.3.1
pycodestyle==2.9.1
pyparsing==3.0.9
Expand All @@ -39,8 +55,5 @@ six==1.16.0
soupsieve==2.3.2.post1
SQLAlchemy==1.3.22
toml==0.10.2
urllib3==1.24.3
Werkzeug==2.2.2
yarl==1.8.1
zipp==3.10.0
redis==4.6.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ def read_requirements(name):
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.7意思是不支持了吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,停止支持了

"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
Expand Down
Loading