dinhanhx / dinhanhx/fastapi-docx

🏗️ Tech Debt: Windows-only (win32com) with no cross-platform fallback + pywin32 as hard dependency

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

The entire conversion pipeline depends on `win32com.client` (Microsoft Word COM automation), making this service **Windows-only**. However:

1. `pyproject.toml` lists `pywin32` as an unconditional dependency — will fail to install on Linux/macOS
2. The `converters.py` raises `NotImplementedError` at runtime on non-Windows (line 29), but the install itself already breaks
3. No Dockerfile or deployment guide — unclear how this is intended to be deployed

## File & Line

- `pyproject.toml` line 12: `"pywin32"` as hard dependency
- `converters.py` line 28-29: runtime platform check

## Suggested Fix

1. Make `pywin32` a conditional/optional dependency:
```toml
[project.optional-dependencies]
windows = ["pywin32"]
```
2. Consider adding LibreOffice-based conversion as a cross-platform fallback (e.g., `subprocess.run(['libreoffice', '--headless', '--convert-to', ...])`)
3. Add a `README` section or `Dockerfile` documenting the Windows requirement

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.