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
8 changes: 8 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

1.4.1.post0+emmv
------------------

- Migrated build system to PEP 517/621.
- Added pyproject.toml with modern metadata.
- Declared dynamic readme using setuptools to combine README.rst and HISTORY.txt.
- Removed legacy setup.py-based build path to avoid deprecation warnings.


1.4.1 (unreleased)
------------------
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
*docxcompose* is a Python library for concatenating/appending Microsoft
Word (.docx) files.

This fork adds the PR 112, Fixed DeprecationWarning on pkg_import, by
@numshub
and modernizes the build system for Python >= 3.8.


Example usage
-------------
Expand Down
6 changes: 3 additions & 3 deletions docxcompose/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from lxml.etree import QName
from six import binary_type
from six import text_type
import pkg_resources
import importlib.resources as importlib_resources
import re


Expand Down Expand Up @@ -108,8 +108,8 @@ def __init__(self, doc):
self._element = parse_xml(part.blob)

def _part_template(self):
return pkg_resources.resource_string(
'docxcompose', 'templates/custom.xml')
ref = importlib_resources.files('docxcompose').joinpath('templates/custom.xml')
return ref.read_bytes()

def _update_part(self):
if self.part is None:
Expand Down
55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "docxcompose"
version = "1.4.1.post0+emmv" # PEP 440-valid
description = "Compose .docx documents"
requires-python = ">=3.8"
license = { text = "MIT License" }

authors = [
{ name = "Thomas Buchberger", email = "t.buchberger@4teamwork.ch" },
]
maintainers = [
{ name = "Emmanuel Viennet" }
]

keywords = ["Python", "DOCX", "Word", "OOXML"]

classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

dependencies = [
"lxml",
"python-docx>=0.8.8",
"six",
"Babel", # (same as 'babel'; keep if upstream uses it)
]

[project.optional-dependencies]
test = ["pytest"]

[project.scripts]
docxcompose = "docxcompose.command:main"

[project.urls]
Homepage = "https://github.com/emmanuelito/docxcompose"
Repository = "https://github.com/emmanuelito/docxcompose"


# declare readme dynamically via setuptools
[tool.setuptools.dynamic]
readme = { file = ["README.rst", "HISTORY.txt"], content-type = "text/x-rst" }
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.