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