diff --git a/docxcompose/properties.py b/docxcompose/properties.py index aa8cd2d..53709bf 100644 --- a/docxcompose/properties.py +++ b/docxcompose/properties.py @@ -11,11 +11,11 @@ from docxcompose.utils import NS from docxcompose.utils import word_to_python_date_format from docxcompose.utils import xpath +from importlib import resources from lxml.etree import FunctionNamespace from lxml.etree import QName from six import binary_type from six import text_type -import pkg_resources import re @@ -108,8 +108,11 @@ def __init__(self, doc): self._element = parse_xml(part.blob) def _part_template(self): - return pkg_resources.resource_string( - 'docxcompose', 'templates/custom.xml') + return ( + resources.files('docxcompose') + .joinpath('templates/custom.xml') + .read_bytes() + ) def _update_part(self): if self.part is None: diff --git a/setup.py b/setup.py index 1d7d53c..e50f85e 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,6 @@ # Get more from https://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ "Programming Language :: Python", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", @@ -31,10 +30,10 @@ packages=find_packages(exclude=['ez_setup']), include_package_data=True, zip_safe=True, + python_requires=">=3.9", install_requires=[ 'lxml', 'python-docx >= 0.8.8', - 'setuptools', 'six', 'babel', ], diff --git a/tox.ini b/tox.ini index bc93ad0..6add372 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py36 +envlist = py39 [testenv] deps = .[tests]