Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docxcompose/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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',
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py36
envlist = py39

[testenv]
deps = .[tests]
Expand Down