Fix py_docx import error: use setuptools + PYTHONPATH
This commit is contained in:
@@ -46,6 +46,9 @@ RUN pip install --upgrade pip && pip install .
|
||||
# Copy source
|
||||
COPY src/py_docx ./src/py_docx
|
||||
|
||||
# Ensure py_docx is importable
|
||||
ENV PYTHONPATH="/app/src:${PYTHONPATH}"
|
||||
|
||||
# Create runtime dirs
|
||||
RUN mkdir -p /templates /out /tmp/py-docx-mcp
|
||||
|
||||
|
||||
+6
-4
@@ -1,6 +1,6 @@
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
requires = ["setuptools>=61.0"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "py-docx-mcp"
|
||||
@@ -15,10 +15,12 @@ dependencies = [
|
||||
"html5lib>=1.1",
|
||||
"regex>=2024.0.0",
|
||||
"aiofiles>=24.0.0",
|
||||
"uvicorn>=0.24.0",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
py-docx-mcp = "py_docx.server:main"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/py_docx"]
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
include = ["py_docx*"]
|
||||
|
||||
Reference in New Issue
Block a user