Skip to content

fix: add typing module for python 3.13 #1046

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

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Conversation

christyjacob4
Copy link
Member

What does this PR do?

In Python 3.13, list is now treated strictly as a built-in function, not a generic type hint. Python 3.13 introduces stricter type enforcement, causing conflicts when list[str] is used without from typing import List. Hence we get this error

Traceback (most recent call last):
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/bin/mcp-server-appwrite", line 4, in <module>
    from mcp_server_appwrite.__main__ import main
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/src/mcp_server_appwrite/__init__.py", line 1, in <module>
    from . import server
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/src/mcp_server_appwrite/server.py", line 11, in <module>
    from appwrite.services.databases import Databases
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/lib/python3.13/site-packages/appwrite/services/databases.py", line 8, in <module>
    class Databases(Service):
    ...<1196 lines>...
            }, api_params)
  File "/Users/christyjacob/opensource/christyjacob4/mcp-server-appwrite/.venv/lib/python3.13/site-packages/appwrite/services/databases.py", line 108, in Databases
    def list_collections(self, database_id: str, queries: list[str] = None, search: str = None):
                                                          ~~~~^^^^^
TypeError: 'function' object is not subscriptable

Hence we use the List that offers computability from Python 3.5+ to 3.13

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@christyjacob4 christyjacob4 merged commit 2518f24 into master Mar 10, 2025
37 checks passed
@christyjacob4 christyjacob4 deleted the add-python-types branch March 10, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants