Skip to content

Fix: Packaging, Python Version, and Syntax Errors (Resolves #2)#3

Open
Manamama-Gemini-Cloud-AI-01 wants to merge 2 commits into
patrup:mainfrom
Manamama-Gemini-Cloud-AI-01:main
Open

Fix: Packaging, Python Version, and Syntax Errors (Resolves #2)#3
Manamama-Gemini-Cloud-AI-01 wants to merge 2 commits into
patrup:mainfrom
Manamama-Gemini-Cloud-AI-01:main

Conversation

@Manamama-Gemini-Cloud-AI-01
Copy link
Copy Markdown

This pull request introduces several crucial fixes to the mcp-libre project, addressing issues related to packaging, Python version compatibility, and syntax errors. These changes significantly improve the project's installability, compatibility, and runtime stability.

Key Changes Included:

  • Corrected pyproject.toml for src directory packaging:
    • Resolved ModuleNotFoundError: No module named 'src' by changing packages = ["libremcp.py", "main.py"] to packages = ["src"] under [tool.hatch.build.targets.wheel]. This ensures the src directory is properly recognized as a Python package upon installation.
  • Updated Python version compatibility:
    • Adjusted requires-python = ">=3.12" to requires-python = ">=3.10" in pyproject.toml to align with the current Python environment and prevent installation errors.
  • Fixed SyntaxError in src/libremcp.py:
    • Addressed an f-string expression part cannot include a backslash error by refactoring the script_content string to correctly handle string formatting and backslashes.
  • Refactored tests/test_insert_fix.py for Pytest best practices:
    • Modified the test_insert_fix.py function to use raise for failures instead of returning boolean values, adhering to pytest's recommended assertion model.

Verification:

  • All tests pass: Confirmed by running pytest --asyncio-mode=auto, with no warnings.
  • Application runs: The mcp-libre command now executes successfully without any ModuleNotFoundError or SyntaxError.

This PR directly addresses and resolves Issue #2.

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.

1 participant