python-docx-template icon indicating copy to clipboard operation
python-docx-template copied to clipboard

Metadata in pyproject.toml are proabably misleading

Open mm-andritz opened this issue 1 year ago • 2 comments

Describe the bug

I think this package is still compatible with at least python 3.8. But when doing pip install of the source distribution, the metadata from pyproject.toml are picked up. This file references poetry as the build backend. I think the metadata associated with it are somewhat misleading. Note that I don't use poetry myself, and I may misunderstanding the way it works.

More precisely I think [tool.poetry.dependencies] section references incorrectly the following:

  • black and twine as run dependencies: should probably go into [tool.poertry.group.dev.dependencies]
  • python is 3.11 or greater. I guess python 3.11 is what you use to develop which is fine but your wheel package only mention python 3 and I think it actually supports at least python 3.8

To Reproduce

When trying to repackage this project as a conda package using python 3.8 as a minimum it fails because pip install ${source_pkg} which is one of the step to do to create the conda package exits by saying that python-docxtpl is not compatible with python 3.8.

Expected behavior

pip install source_pkg with python 3.8 should work.

mm-andritz avatar Aug 28 '25 19:08 mm-andritz

Rechecked this on current master at 1f143fb.

The built sdist now reports Requires-Python: >=3.7. Its unconditional requirements are only python-docx, jinja2, and lxml; docxcompose and the documentation packages are extras, while mypy and flake8 are in the development dependency group. Black and twine are not runtime requirements.

I also built and installed that exact sdist in a clean CPython 3.8.20 environment with Python 3.8-compatible dependency versions, then imported docxtpl 0.20.2 successfully. The original metadata mismatch appears to be resolved by #617 and the later packaging updates, so I think this issue can be closed.

jackspiece avatar Jul 30 '26 13:07 jackspiece

@mm-andritz @jackspiece fyi, Docform (the maintained fork at https://github.com/cvas22/docform, docform on PyPI) also builds with standard [project] metadata, and its only runtime deps are python-docx, jinja2 and lxml.

cvas22 avatar Nov 22 '26 09:11 cvas22