You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecation warning: pkg_resources will be removed from setuptools in 2025 #605
I am using the docxcompose library, and I have encountered the following deprecation warning related to pkg_resources:
UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
This warning informs us that pkg_resources will be removed from setuptools after November 2025. As this library depends on pkg_resources, this could cause compatibility issues with future versions of Python and setuptools.
I also tested the current python-docx-template master subdocument path under -W error:
CPython 3.8.20 with docxcompose 1.4.1 and no setuptools package installed
CPython 3.12.13 with docxcompose 2.2.0
In both environments, importing CustomProperties, loading its XML template, and creating a subdocument with new_subdoc() passed. This issue can be closed as resolved upstream.
Activity
waketzheng commentedon Jul 22, 2025
Related 4teamwork/docxcompose#105
waketzheng commentedon Jul 22, 2025
Last commit of docxcompose is 3 years ago, I think it is time to remove this line
from
docxtpl/__init__.py, and move docxcompose to optional dependencies.svleeuwen commentedon Sep 22, 2025
I would also really like to see
docxcomposemoved to optional dependencies.Perhaps we can extract this to a separate PR so it's easier to merge?
Another argument for this is that docxcompose hasn't published any wheels (causing issues when installing
manylinuxreqs).waketzheng commentedon Sep 23, 2025
@svleeuwen done. #615
jackspiece commentedon Jul 30, 2026
I rechecked this against the current upstream releases. The original
pkg_resourcesproblem is resolved now.pkg_resourcesimport: https://github.com/4teamwork/docxcompose/blob/2.2.0/CHANGELOG.mdpkg_resources: https://github.com/4teamwork/docxcompose/blob/1.4.1/HISTORY.txtI also tested the current python-docx-template
mastersubdocument path under-W error:In both environments, importing
CustomProperties, loading its XML template, and creating a subdocument withnew_subdoc()passed. This issue can be closed as resolved upstream.