Conversation
…upport Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
|
@copilot why tests are failing in python2 and not in python3? |
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
The Python 2 tests were failing due to a MIME type detection issue. The specific failing test "Show file type" expected Root cause: Python 2.7's Fix applied: I added explicit MIME type mappings for common Microsoft Office extensions (.docx, .xlsx, .pptx, .doc, .xls, .ppt) as a fallback when The fix is in commit d031e6a and should resolve the failing test while maintaining backward compatibility. |
This PR modernizes the CI configuration to properly support testing on both Python 2.7 and Python 3.11 as requested, with Python 2.7 running in a Docker container for better reliability and consistency. Additionally, it fixes a cross-version compatibility issue with MIME type detection for Microsoft Office documents.
Changes Made
GitHub Actions Workflow (
.github/workflows/python-app.yml)test-python3): Usesubuntu-latestwithactions/setup-python@v4test-python2): Usesubuntu-latestwithcontainer: python:2.7-slimas specifiedPackage Metadata (
setup.py)MIME Type Detection Fix (
qreu/email.py)mimetypesmodule in the Docker container lacks some modern MIME type mappings, causing.docxfiles to be detected asapplication/octet-streaminstead of the correctapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentBenefits
python:2.7-slimDocker container ensures consistent Python 2.7.18 environmentubuntu-latestfor both jobs as requestedVerification
python:2.7-slimconfirmed available with Python 2.7.18The CI workflow is now ready to reliably test the codebase on both Python versions with the requested configuration.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.