diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3a8122e..1480843 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout source @@ -38,7 +38,7 @@ jobs: needs: [tests-linux] strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout source @@ -63,7 +63,7 @@ jobs: needs: [tests-linux] strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - name: Checkout source diff --git a/docs/docs/release_notes.md b/docs/docs/release_notes.md index b40d6be..e6c0bac 100644 --- a/docs/docs/release_notes.md +++ b/docs/docs/release_notes.md @@ -1,3 +1,6 @@ +### 4.3.2 +- Support `Python 3.13` + ### 4.3.0 - Support `Jinja2 Template Engine` diff --git a/panther/__init__.py b/panther/__init__.py index f2122dd..ffd8c71 100644 --- a/panther/__init__.py +++ b/panther/__init__.py @@ -1,6 +1,6 @@ from panther.main import Panther # noqa: F401 -__version__ = '4.3.1' +__version__ = '4.3.2' def version(): diff --git a/panther/db/queries/base_queries.py b/panther/db/queries/base_queries.py index 4bdb44a..c89abd1 100644 --- a/panther/db/queries/base_queries.py +++ b/panther/db/queries/base_queries.py @@ -28,7 +28,7 @@ def _merge(cls, *args, is_mongo: bool = False) -> dict: def _clean_error_message(cls, validation_error: ValidationError, is_updating: bool = False) -> str: error = ', '.join( '{field}="{error}"'.format( - field='.'.join(loc for loc in e['loc']), + field='.'.join(str(loc) for loc in e['loc']), error=e['msg'] ) for e in validation_error.errors() diff --git a/panther/serializer.py b/panther/serializer.py index d6fae02..1e2ab1e 100644 --- a/panther/serializer.py +++ b/panther/serializer.py @@ -39,7 +39,7 @@ def __new__( # 4. Create a serializer return create_model( - __model_name=cls_name, + cls_name, __module__=namespace['__module__'], __validators__=namespace, __base__=(cls.model_serializer, BaseModel), diff --git a/setup.py b/setup.py index 0d88801..3e61b9a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ import re +import sys from setuptools import setup @@ -12,6 +13,17 @@ def panther_version() -> str: with open('README.md', encoding='utf-8') as file: DESCRIPTION = file.read() +INSTALL_REQUIRES = [ + 'pantherdb~=2.1.0', + 'pydantic~=2.8.2', + 'rich~=13.7.1', + 'uvicorn~=0.27.1', + 'pytz~=2024.1', + 'Jinja2~=3.1', +] +if sys.version_info <= (3, 12): + INSTALL_REQUIRES.append('httptools~=0.6.1') + EXTRAS_REQUIRE = { 'full': [ 'redis==5.0.1', @@ -32,7 +44,7 @@ def panther_version() -> str: author='Ali RajabNezhad', author_email='alirn76@yahoo.com', url='https://github.com/alirn76/panther', - description='Fast & Friendly, Web Framework For Building Async APIs', + description='Fast & Friendly, Web Framework For Building Async APIs', long_description=DESCRIPTION, long_description_content_type='text/markdown', include_package_data=True, @@ -42,6 +54,7 @@ def panther_version() -> str: 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], entry_points={ 'console_scripts': ['panther=panther.cli.main:start'], @@ -49,14 +62,6 @@ def panther_version() -> str: package_data={ 'panther': ['cli/*'], }, - install_requires=[ - 'httptools~=0.6.1', - 'pantherdb~=2.1.0', - 'pydantic~=2.7.4', - 'rich~=13.7.1', - 'uvicorn~=0.27.1', - 'pytz~=2024.1', - 'Jinja2~=3.1', - ], + install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE, )