From 24c8227de376064ff879871132660fd67c675dc1 Mon Sep 17 00:00:00 2001 From: skelmis Date: Sat, 1 Mar 2025 12:11:13 +1300 Subject: [PATCH 1/5] fix: missing conversions to skelmis namespace in doc autodocs --- docs/api/dml.rst | 2 +- docs/api/document.rst | 6 +++--- docs/api/section.rst | 2 +- docs/api/settings.rst | 2 +- docs/api/shape.rst | 2 +- docs/api/shared.rst | 2 +- docs/api/style.rst | 6 +++--- docs/api/table.rst | 2 +- docs/api/text.rst | 18 +++++++++--------- docs/api/utility.rst | 6 +++--- docs/user/sections.rst | 4 ++-- src/skelmis/docx/document.py | 2 +- src/skelmis/docx/oxml/shared.py | 2 +- src/skelmis/docx/styles/__init__.py | 2 +- tests/dml/test_color.py | 2 +- tests/image/test_bmp.py | 2 +- tests/image/test_gif.py | 2 +- tests/image/test_helpers.py | 2 +- tests/image/test_image.py | 2 +- tests/image/test_jpeg.py | 10 +++++++--- tests/image/test_png.py | 6 ++++-- tests/image/test_tiff.py | 2 +- tests/opc/parts/test_coreprops.py | 2 +- tests/opc/test_coreprops.py | 2 +- tests/opc/test_package.py | 2 +- tests/opc/test_packuri.py | 2 +- tests/opc/test_part.py | 6 ++++-- tests/opc/test_phys_pkg.py | 2 +- tests/opc/test_pkgreader.py | 2 +- tests/opc/test_rel.py | 2 +- tests/oxml/parts/test_document.py | 2 +- tests/oxml/test_ns.py | 2 +- tests/oxml/test_styles.py | 2 +- tests/oxml/test_table.py | 2 +- tests/oxml/test_xmlchemy.py | 2 +- tests/oxml/text/test_hyperlink.py | 2 +- tests/oxml/text/test_run.py | 2 +- tests/parts/test_document.py | 2 +- tests/parts/test_hdrftr.py | 2 +- tests/parts/test_image.py | 2 +- tests/parts/test_numbering.py | 2 +- tests/parts/test_settings.py | 2 +- tests/parts/test_story.py | 2 +- tests/parts/test_styles.py | 2 +- tests/styles/test_latent.py | 2 +- tests/styles/test_style.py | 6 ++++-- tests/styles/test_styles.py | 6 ++++-- tests/test_api.py | 2 +- tests/test_blkcntnr.py | 2 +- tests/test_document.py | 2 +- tests/test_enum.py | 2 +- tests/test_package.py | 2 +- tests/test_section.py | 2 +- tests/test_settings.py | 2 +- tests/test_shape.py | 2 +- tests/test_shared.py | 2 +- tests/test_table.py | 2 +- tests/text/test_font.py | 2 +- tests/text/test_hyperlink.py | 4 ++-- tests/text/test_pagebreak.py | 4 ++-- tests/text/test_paragraph.py | 2 +- tests/text/test_parfmt.py | 2 +- tests/text/test_run.py | 2 +- tests/text/test_tabstops.py | 2 +- 64 files changed, 99 insertions(+), 87 deletions(-) diff --git a/docs/api/dml.rst b/docs/api/dml.rst index 79b31484..b680c255 100644 --- a/docs/api/dml.rst +++ b/docs/api/dml.rst @@ -11,6 +11,6 @@ contexts. |ColorFormat| objects --------------------- -.. autoclass:: docx.dml.color.ColorFormat() +.. autoclass:: skelmis.docx.dml.color.ColorFormat() :members: :undoc-members: diff --git a/docs/api/document.rst b/docs/api/document.rst index 42ec0211..0e72ca54 100644 --- a/docs/api/document.rst +++ b/docs/api/document.rst @@ -10,13 +10,13 @@ The main Document and related objects. |Document| constructor ---------------------- -.. autofunction:: docx.Document +.. autofunction:: skelmis.docx.Document |Document| objects ------------------ -.. autoclass:: docx.document.Document() +.. autoclass:: skelmis.docx.document.Document() :members: :exclude-members: styles_part @@ -44,7 +44,7 @@ values for the title, last_modified_by, revision, and modified properties. Client code should update properties like revision and last_modified_by if that behavior is desired. -.. currentmodule:: docx.opc.coreprops +.. currentmodule:: skelmis.docx.opc.coreprops .. class:: CoreProperties diff --git a/docs/api/section.rst b/docs/api/section.rst index e2d547c7..6639b4b7 100644 --- a/docs/api/section.rst +++ b/docs/api/section.rst @@ -11,7 +11,7 @@ Provides access to section properties such as margins and page orientation. |Sections| objects ------------------ -.. currentmodule:: docx.section +.. currentmodule:: skelmis.docx.section .. autoclass:: Sections :members: diff --git a/docs/api/settings.rst b/docs/api/settings.rst index 509b925b..94ca264e 100644 --- a/docs/api/settings.rst +++ b/docs/api/settings.rst @@ -4,7 +4,7 @@ Document |Settings| objects --------------------------- -.. currentmodule:: docx.settings +.. currentmodule:: skelmis.docx.settings .. autoclass:: Settings() :members: diff --git a/docs/api/shape.rst b/docs/api/shape.rst index 200b3497..d25241ef 100644 --- a/docs/api/shape.rst +++ b/docs/api/shape.rst @@ -4,7 +4,7 @@ Shape-related objects ===================== -.. currentmodule:: docx.shape +.. currentmodule:: skelmis.docx.shape |InlineShapes| objects diff --git a/docs/api/shared.rst b/docs/api/shared.rst index 161b8bac..ba1234d1 100644 --- a/docs/api/shared.rst +++ b/docs/api/shared.rst @@ -4,7 +4,7 @@ Shared classes ============== -.. currentmodule:: docx.shared +.. currentmodule:: skelmis.docx.shared Length objects diff --git a/docs/api/style.rst b/docs/api/style.rst index afee95c0..45f4187a 100644 --- a/docs/api/style.rst +++ b/docs/api/style.rst @@ -14,7 +14,7 @@ in the appropriate style. |Styles| objects ---------------- -.. currentmodule:: docx.styles.styles +.. currentmodule:: skelmis.docx.styles.styles .. autoclass:: Styles() :members: @@ -26,7 +26,7 @@ in the appropriate style. |BaseStyle| objects ------------------- -.. currentmodule:: docx.styles.style +.. currentmodule:: skelmis.docx.styles.style .. autoclass:: BaseStyle() :members: @@ -78,7 +78,7 @@ in the appropriate style. |LatentStyles| objects ---------------------- -.. currentmodule:: docx.styles.latent +.. currentmodule:: skelmis.docx.styles.latent .. autoclass:: LatentStyles() :members: diff --git a/docs/api/table.rst b/docs/api/table.rst index 6f27670f..9b2b613d 100644 --- a/docs/api/table.rst +++ b/docs/api/table.rst @@ -7,7 +7,7 @@ Table objects Table objects are constructed using the ``add_table()`` method on |Document|. -.. currentmodule:: docx.table +.. currentmodule:: skelmis.docx.table |Table| objects diff --git a/docs/api/text.rst b/docs/api/text.rst index f76e3ba3..fb8089ff 100644 --- a/docs/api/text.rst +++ b/docs/api/text.rst @@ -8,56 +8,56 @@ Text-related objects |Paragraph| objects ------------------- -.. autoclass:: docx.text.paragraph.Paragraph() +.. autoclass:: skelmis.docx.text.paragraph.Paragraph() :members: |ParagraphFormat| objects ------------------------- -.. autoclass:: docx.text.parfmt.ParagraphFormat() +.. autoclass:: skelmis.docx.text.parfmt.ParagraphFormat() :members: |Hyperlink| objects ------------------- -.. autoclass:: docx.text.hyperlink.Hyperlink() +.. autoclass:: skelmis.docx.text.hyperlink.Hyperlink() :members: |Run| objects ------------- -.. autoclass:: docx.text.run.Run() +.. autoclass:: skelmis.docx.text.run.Run() :members: |Font| objects -------------- -.. autoclass:: docx.text.run.Font() +.. autoclass:: skelmis.docx.text.run.Font() :members: |RenderedPageBreak| objects --------------------------- -.. autoclass:: docx.text.pagebreak.RenderedPageBreak() +.. autoclass:: skelmis.docx.text.pagebreak.RenderedPageBreak() :members: |TabStop| objects ----------------- -.. autoclass:: docx.text.tabstops.TabStop() +.. autoclass:: skelmis.docx.text.tabstops.TabStop() :members: |TabStops| objects ------------------ -.. autoclass:: docx.text.tabstops.TabStops() +.. autoclass:: skelmis.docx.text.tabstops.TabStops() :members: clear_all - .. automethod:: docx.text.tabstops.TabStops.add_tab_stop(position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES) + .. automethod:: skelmis.docx.text.tabstops.TabStops.add_tab_stop(position, alignment=WD_TAB_ALIGNMENT.LEFT, leader=WD_TAB_LEADER.SPACES) diff --git a/docs/api/utility.rst b/docs/api/utility.rst index 0cec6092..bb1f8399 100644 --- a/docs/api/utility.rst +++ b/docs/api/utility.rst @@ -9,8 +9,8 @@ Utility objects Docx2pdf -------- -.. autofunction:: docx.utility.document_to_pdf +.. autofunction:: skelmis.docx.utility.document_to_pdf -.. autofunction:: docx.utility.export_libre_macro +.. autofunction:: skelmis.docx.utility.export_libre_macro -.. autofunction:: docx.utility.update_toc +.. autofunction:: skelmis.docx.utility.update_toc diff --git a/docs/user/sections.rst b/docs/user/sections.rst index 5d52f997..623e0dd5 100644 --- a/docs/user/sections.rst +++ b/docs/user/sections.rst @@ -45,7 +45,7 @@ possibility using a ``len()`` check or ``try`` block to avoid an uncaught Adding a new section -------------------- -.. currentmodule:: docx.api +.. currentmodule:: skelmis.docx.api The :meth:`Document.add_section` method allows a new section to be started at the end of the document. Paragraphs and tables added after calling this method @@ -62,7 +62,7 @@ will appear in the new section:: Section properties ------------------ -.. currentmodule:: docx.section +.. currentmodule:: skelmis.docx.section The |Section| object has eleven properties that allow page layout settings to be discovered and specified. diff --git a/src/skelmis/docx/document.py b/src/skelmis/docx/document.py index 5b8bf28a..fd56b89d 100644 --- a/src/skelmis/docx/document.py +++ b/src/skelmis/docx/document.py @@ -48,7 +48,7 @@ def configure_styles_for_numbered_lists(self): then you should override this method with your own styling choices as these are shipped 'as is' and are generally good enough. """ - STYP = docx.enum.style.WD_STYLE_TYPE + STYP = skelmis.docx.enum.style.WD_STYLE_TYPE num_xml = self.part.numbering_part.element next_abstract_id = max([J.abstractNumId for J in num_xml.abstractNum_lst]) + 1 l = num_xml._new_abstractNum() diff --git a/src/skelmis/docx/oxml/shared.py b/src/skelmis/docx/oxml/shared.py index 05253e31..42191390 100644 --- a/src/skelmis/docx/oxml/shared.py +++ b/src/skelmis/docx/oxml/shared.py @@ -1,4 +1,4 @@ -"""Objects shared by modules in the docx.oxml subpackage.""" +"""Objects shared by modules in the skelmis.docx.oxml subpackage.""" from __future__ import annotations diff --git a/src/skelmis/docx/styles/__init__.py b/src/skelmis/docx/styles/__init__.py index 6358baf3..633057f7 100644 --- a/src/skelmis/docx/styles/__init__.py +++ b/src/skelmis/docx/styles/__init__.py @@ -1,4 +1,4 @@ -"""Sub-package module for docx.styles sub-package.""" +"""Sub-package module for skelmis.docx.styles sub-package.""" from __future__ import annotations diff --git a/tests/dml/test_color.py b/tests/dml/test_color.py index 65c49e3d..225a2164 100644 --- a/tests/dml/test_color.py +++ b/tests/dml/test_color.py @@ -1,4 +1,4 @@ -"""Test suite for docx.dml.color module.""" +"""Test suite for skelmis.docx.dml.color module.""" import pytest diff --git a/tests/image/test_bmp.py b/tests/image/test_bmp.py index 8572462b..eca5bcfb 100644 --- a/tests/image/test_bmp.py +++ b/tests/image/test_bmp.py @@ -1,4 +1,4 @@ -"""Test suite for docx.image.bmp module.""" +"""Test suite for skelmis.docx.image.bmp module.""" import io diff --git a/tests/image/test_gif.py b/tests/image/test_gif.py index 02f6d97f..ee12eed2 100644 --- a/tests/image/test_gif.py +++ b/tests/image/test_gif.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.image.gif module.""" +"""Unit test suite for skelmis.docx.image.gif module.""" import io diff --git a/tests/image/test_helpers.py b/tests/image/test_helpers.py index 2fbfb60d..878341de 100644 --- a/tests/image/test_helpers.py +++ b/tests/image/test_helpers.py @@ -1,4 +1,4 @@ -"""Test suite for docx.image.helpers module.""" +"""Test suite for skelmis.docx.image.helpers module.""" import io diff --git a/tests/image/test_image.py b/tests/image/test_image.py index a158d72b..6db8db05 100644 --- a/tests/image/test_image.py +++ b/tests/image/test_image.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.image package""" +"""Unit test suite for skelmis.docx.image package""" import io diff --git a/tests/image/test_jpeg.py b/tests/image/test_jpeg.py index f37fb1a4..8c28163c 100644 --- a/tests/image/test_jpeg.py +++ b/tests/image/test_jpeg.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.image.jpeg module""" +"""Unit test suite for skelmis.docx.image.jpeg module""" import io @@ -346,7 +346,9 @@ def _App1Marker__init_(self, request): def get_tiff_fixture(self, request, substream_, Tiff_, tiff_): bytes_ = b"xfillerxMM\x00*\x00\x00\x00\x42" stream_reader = StreamReader(io.BytesIO(bytes_), BIG_ENDIAN) - BytesIO_ = class_mock(request, "skelmis.docx.image.jpeg.io.BytesIO", return_value=substream_) + BytesIO_ = class_mock( + request, "skelmis.docx.image.jpeg.io.BytesIO", return_value=substream_ + ) offset, segment_length, segment_bytes = 0, 16, bytes_[8:] return ( stream_reader, @@ -622,7 +624,9 @@ def stream_(self, request): @pytest.fixture def StreamReader_(self, request, stream_reader_): - return class_mock(request, "skelmis.docx.image.jpeg.StreamReader", return_value=stream_reader_) + return class_mock( + request, "skelmis.docx.image.jpeg.StreamReader", return_value=stream_reader_ + ) @pytest.fixture def stream_reader_(self, request): diff --git a/tests/image/test_png.py b/tests/image/test_png.py index 20defc74..a47a957a 100644 --- a/tests/image/test_png.py +++ b/tests/image/test_png.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.image.png module.""" +"""Unit test suite for skelmis.docx.image.png module.""" import io @@ -271,7 +271,9 @@ def chunk_2_(self, request): @pytest.fixture def _ChunkFactory_(self, request, chunk_lst_): - return function_mock(request, "skelmis.docx.image.png._ChunkFactory", side_effect=chunk_lst_) + return function_mock( + request, "skelmis.docx.image.png._ChunkFactory", side_effect=chunk_lst_ + ) @pytest.fixture def chunk_lst_(self, chunk_, chunk_2_): diff --git a/tests/image/test_tiff.py b/tests/image/test_tiff.py index 0ab735bb..d585d47d 100644 --- a/tests/image/test_tiff.py +++ b/tests/image/test_tiff.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.image.tiff module""" +"""Unit test suite for skelmis.docx.image.tiff module""" import io diff --git a/tests/opc/parts/test_coreprops.py b/tests/opc/parts/test_coreprops.py index db411ca0..d1dcbd69 100644 --- a/tests/opc/parts/test_coreprops.py +++ b/tests/opc/parts/test_coreprops.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.opc.parts.coreprops module.""" +"""Unit test suite for the skelmis.docx.opc.parts.coreprops module.""" from __future__ import annotations diff --git a/tests/opc/test_coreprops.py b/tests/opc/test_coreprops.py index 9ef24a73..4af8d38c 100644 --- a/tests/opc/test_coreprops.py +++ b/tests/opc/test_coreprops.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit test suite for the docx.opc.coreprops module.""" +"""Unit test suite for the skelmis.docx.opc.coreprops module.""" from __future__ import annotations diff --git a/tests/opc/test_package.py b/tests/opc/test_package.py index efc133ec..ae4b18e9 100644 --- a/tests/opc/test_package.py +++ b/tests/opc/test_package.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit test suite for docx.opc.package module""" +"""Unit test suite for skelmis.docx.opc.package module""" from __future__ import annotations diff --git a/tests/opc/test_packuri.py b/tests/opc/test_packuri.py index e0271237..d10890f3 100644 --- a/tests/opc/test_packuri.py +++ b/tests/opc/test_packuri.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.opc.packuri module.""" +"""Test suite for the skelmis.docx.opc.packuri module.""" import pytest diff --git a/tests/opc/test_part.py b/tests/opc/test_part.py index f3dcd09e..75008e35 100644 --- a/tests/opc/test_part.py +++ b/tests/opc/test_part.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit test suite for docx.opc.part module""" +"""Unit test suite for skelmis.docx.opc.part module""" from __future__ import annotations @@ -239,7 +239,9 @@ def blob_2_(self, request): @pytest.fixture def cls_method_fn_(self, request, cls_selector_fn_): - return function_mock(request, "skelmis.docx.opc.part.cls_method_fn", return_value=cls_selector_fn_) + return function_mock( + request, "skelmis.docx.opc.part.cls_method_fn", return_value=cls_selector_fn_ + ) @pytest.fixture def cls_selector_fixture( diff --git a/tests/opc/test_phys_pkg.py b/tests/opc/test_phys_pkg.py index b7d90a41..2c1bf236 100644 --- a/tests/opc/test_phys_pkg.py +++ b/tests/opc/test_phys_pkg.py @@ -1,4 +1,4 @@ -"""Test suite for docx.opc.phys_pkg module.""" +"""Test suite for skelmis.docx.opc.phys_pkg module.""" import hashlib import io diff --git a/tests/opc/test_pkgreader.py b/tests/opc/test_pkgreader.py index 0d5bc959..941a5fb3 100644 --- a/tests/opc/test_pkgreader.py +++ b/tests/opc/test_pkgreader.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.opc.pkgreader module.""" +"""Unit test suite for skelmis.docx.opc.pkgreader module.""" import pytest diff --git a/tests/opc/test_rel.py b/tests/opc/test_rel.py index 1dc7e7c5..9ea250a2 100644 --- a/tests/opc/test_rel.py +++ b/tests/opc/test_rel.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit test suite for the docx.opc.rel module.""" +"""Unit test suite for the skelmis.docx.opc.rel module.""" import pytest diff --git a/tests/oxml/parts/test_document.py b/tests/oxml/parts/test_document.py index 90b58767..83dddf8e 100644 --- a/tests/oxml/parts/test_document.py +++ b/tests/oxml/parts/test_document.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.oxml.parts module.""" +"""Test suite for the skelmis.docx.oxml.parts module.""" import pytest diff --git a/tests/oxml/test_ns.py b/tests/oxml/test_ns.py index 9b87cb17..5d967c3e 100644 --- a/tests/oxml/test_ns.py +++ b/tests/oxml/test_ns.py @@ -1,4 +1,4 @@ -"""Test suite for docx.oxml.ns.""" +"""Test suite for skelmis.docx.oxml.ns.""" import pytest diff --git a/tests/oxml/test_styles.py b/tests/oxml/test_styles.py index 7cbc3459..91dd6319 100644 --- a/tests/oxml/test_styles.py +++ b/tests/oxml/test_styles.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.oxml.styles module.""" +"""Test suite for the skelmis.docx.oxml.styles module.""" import pytest diff --git a/tests/oxml/test_table.py b/tests/oxml/test_table.py index 7a85588f..cda077ec 100644 --- a/tests/oxml/test_table.py +++ b/tests/oxml/test_table.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Test suite for the docx.oxml.text module.""" +"""Test suite for the skelmis.docx.oxml.text module.""" from __future__ import annotations diff --git a/tests/oxml/test_xmlchemy.py b/tests/oxml/test_xmlchemy.py index 091373d9..da4a80a2 100644 --- a/tests/oxml/test_xmlchemy.py +++ b/tests/oxml/test_xmlchemy.py @@ -1,4 +1,4 @@ -"""Test suite for docx.oxml.xmlchemy.""" +"""Test suite for skelmis.docx.oxml.xmlchemy.""" import pytest diff --git a/tests/oxml/text/test_hyperlink.py b/tests/oxml/text/test_hyperlink.py index 926aa7a8..dd31fb1a 100644 --- a/tests/oxml/text/test_hyperlink.py +++ b/tests/oxml/text/test_hyperlink.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.oxml.text.hyperlink module.""" +"""Test suite for the skelmis.docx.oxml.text.hyperlink module.""" from typing import cast diff --git a/tests/oxml/text/test_run.py b/tests/oxml/text/test_run.py index e2a0ee00..63b9c2fd 100644 --- a/tests/oxml/text/test_run.py +++ b/tests/oxml/text/test_run.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.oxml.text.run module.""" +"""Test suite for the skelmis.docx.oxml.text.run module.""" from typing import cast diff --git a/tests/parts/test_document.py b/tests/parts/test_document.py index 816a1a30..b19af0b3 100644 --- a/tests/parts/test_document.py +++ b/tests/parts/test_document.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.parts.document module.""" +"""Unit test suite for the skelmis.docx.parts.document module.""" import pytest diff --git a/tests/parts/test_hdrftr.py b/tests/parts/test_hdrftr.py index 2f78fd91..d226b8c3 100644 --- a/tests/parts/test_hdrftr.py +++ b/tests/parts/test_hdrftr.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.parts.hdrftr module.""" +"""Unit test suite for the skelmis.docx.parts.hdrftr module.""" import pytest diff --git a/tests/parts/test_image.py b/tests/parts/test_image.py index 0ee9fe39..d5df09f6 100644 --- a/tests/parts/test_image.py +++ b/tests/parts/test_image.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.parts.image module.""" +"""Unit test suite for skelmis.docx.parts.image module.""" import pytest diff --git a/tests/parts/test_numbering.py b/tests/parts/test_numbering.py index 8db72553..e3755dec 100644 --- a/tests/parts/test_numbering.py +++ b/tests/parts/test_numbering.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.parts.numbering module.""" +"""Test suite for the skelmis.docx.parts.numbering module.""" import pytest diff --git a/tests/parts/test_settings.py b/tests/parts/test_settings.py index 47a5694f..2b8a77ca 100644 --- a/tests/parts/test_settings.py +++ b/tests/parts/test_settings.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.parts.settings module""" +"""Unit test suite for the skelmis.docx.parts.settings module""" import pytest diff --git a/tests/parts/test_story.py b/tests/parts/test_story.py index fef98b02..fbcd86d1 100644 --- a/tests/parts/test_story.py +++ b/tests/parts/test_story.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.parts.story module.""" +"""Unit test suite for the skelmis.docx.parts.story module.""" import pytest diff --git a/tests/parts/test_styles.py b/tests/parts/test_styles.py index 26e44cd6..358443bd 100644 --- a/tests/parts/test_styles.py +++ b/tests/parts/test_styles.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.parts.styles module.""" +"""Test suite for the skelmis.docx.parts.styles module.""" import pytest diff --git a/tests/styles/test_latent.py b/tests/styles/test_latent.py index 70562f8c..13f81cf7 100644 --- a/tests/styles/test_latent.py +++ b/tests/styles/test_latent.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.styles.latent module.""" +"""Unit test suite for the skelmis.docx.styles.latent module.""" import pytest diff --git a/tests/styles/test_style.py b/tests/styles/test_style.py index 4c21f1ec..6a39c0b6 100644 --- a/tests/styles/test_style.py +++ b/tests/styles/test_style.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.styles.style module.""" +"""Test suite for the skelmis.docx.styles.style module.""" import pytest @@ -75,7 +75,9 @@ def character_style_(self, request): @pytest.fixture def _TableStyle_(self, request, table_style_): - return class_mock(request, "skelmis.docx.styles.style._TableStyle", return_value=table_style_) + return class_mock( + request, "skelmis.docx.styles.style._TableStyle", return_value=table_style_ + ) @pytest.fixture def table_style_(self, request): diff --git a/tests/styles/test_styles.py b/tests/styles/test_styles.py index 7eb64046..bbca6857 100644 --- a/tests/styles/test_styles.py +++ b/tests/styles/test_styles.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.styles.styles module.""" +"""Unit test suite for the skelmis.docx.styles.styles module.""" import pytest @@ -378,7 +378,9 @@ def _get_style_id_from_style_(self, request): @pytest.fixture def LatentStyles_(self, request, latent_styles_): - return class_mock(request, "skelmis.docx.styles.styles.LatentStyles", return_value=latent_styles_) + return class_mock( + request, "skelmis.docx.styles.styles.LatentStyles", return_value=latent_styles_ + ) @pytest.fixture def latent_styles_(self, request): diff --git a/tests/test_api.py b/tests/test_api.py index 03802553..7a0358e0 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.api module.""" +"""Test suite for the skelmis.docx.api module.""" import pytest diff --git a/tests/test_blkcntnr.py b/tests/test_blkcntnr.py index 0ddc4976..007558ff 100644 --- a/tests/test_blkcntnr.py +++ b/tests/test_blkcntnr.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.blkcntnr (block item container) module.""" +"""Test suite for the skelmis.docx.blkcntnr (block item container) module.""" import pytest diff --git a/tests/test_document.py b/tests/test_document.py index 81515a2c..7baa9ef3 100644 --- a/tests/test_document.py +++ b/tests/test_document.py @@ -1,7 +1,7 @@ # pyright: reportPrivateUsage=false # pyright: reportUnknownMemberType=false -"""Unit test suite for the docx.document module.""" +"""Unit test suite for the skelmis.docx.document module.""" from __future__ import annotations diff --git a/tests/test_enum.py b/tests/test_enum.py index d33a163d..a4db732b 100644 --- a/tests/test_enum.py +++ b/tests/test_enum.py @@ -1,4 +1,4 @@ -"""Test suite for docx.enum module, focused on base classes. +"""Test suite for skelmis.docx.enum module, focused on base classes. Configured a little differently because of the meta-programming, the two enumeration classes at the top constitute the entire fixture and the tests themselves just make diff --git a/tests/test_package.py b/tests/test_package.py index 2cc332a4..f3f44d8a 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -1,4 +1,4 @@ -"""Unit test suite for docx.package module.""" +"""Unit test suite for skelmis.docx.package module.""" import pytest diff --git a/tests/test_section.py b/tests/test_section.py index f5d74a8a..0a6ba021 100644 --- a/tests/test_section.py +++ b/tests/test_section.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit test suite for the docx.section module.""" +"""Unit test suite for the skelmis.docx.section module.""" from __future__ import annotations diff --git a/tests/test_settings.py b/tests/test_settings.py index adebd7ca..22d92cce 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.settings module.""" +"""Unit test suite for the skelmis.docx.settings module.""" import pytest diff --git a/tests/test_shape.py b/tests/test_shape.py index 4bba9389..dc66de49 100644 --- a/tests/test_shape.py +++ b/tests/test_shape.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.shape module.""" +"""Test suite for the skelmis.docx.shape module.""" import pytest diff --git a/tests/test_shared.py b/tests/test_shared.py index 3f6d10fb..5ad655b8 100644 --- a/tests/test_shared.py +++ b/tests/test_shared.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.shared module.""" +"""Test suite for the skelmis.docx.shared module.""" import pytest diff --git a/tests/test_table.py b/tests/test_table.py index 0f48bac5..65c115a9 100644 --- a/tests/test_table.py +++ b/tests/test_table.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Test suite for the docx.table module.""" +"""Test suite for the skelmis.docx.table module.""" from __future__ import annotations diff --git a/tests/text/test_font.py b/tests/text/test_font.py index 52a1d486..58c14dbb 100644 --- a/tests/text/test_font.py +++ b/tests/text/test_font.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Test suite for the docx.text.run module.""" +"""Test suite for the skelmis.docx.text.run module.""" from __future__ import annotations diff --git a/tests/text/test_hyperlink.py b/tests/text/test_hyperlink.py index a6cba80e..7aaf821f 100644 --- a/tests/text/test_hyperlink.py +++ b/tests/text/test_hyperlink.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.text.hyperlink module.""" +"""Test suite for the skelmis.docx.text.hyperlink module.""" from typing import cast @@ -15,7 +15,7 @@ class DescribeHyperlink: - """Unit-test suite for the docx.text.hyperlink.Hyperlink object.""" + """Unit-test suite for the skelmis.docx.text.hyperlink.Hyperlink object.""" @pytest.mark.parametrize( ("hlink_cxml", "expected_value"), diff --git a/tests/text/test_pagebreak.py b/tests/text/test_pagebreak.py index 58e961a4..c3b3c4dd 100644 --- a/tests/text/test_pagebreak.py +++ b/tests/text/test_pagebreak.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Unit-test suite for the docx.text.pagebreak module.""" +"""Unit-test suite for the skelmis.docx.text.pagebreak module.""" from typing import cast @@ -14,7 +14,7 @@ class DescribeRenderedPageBreak: - """Unit-test suite for the docx.text.pagebreak.RenderedPageBreak object.""" + """Unit-test suite for the skelmis.docx.text.pagebreak.RenderedPageBreak object.""" def it_raises_on_preceding_fragment_when_page_break_is_not_first_in_paragrah( self, fake_parent: t.ProvidesStoryPart diff --git a/tests/text/test_paragraph.py b/tests/text/test_paragraph.py index 619de1e1..11098484 100644 --- a/tests/text/test_paragraph.py +++ b/tests/text/test_paragraph.py @@ -1,4 +1,4 @@ -"""Unit test suite for the docx.text.paragraph module.""" +"""Unit test suite for the skelmis.docx.text.paragraph module.""" from typing import List, cast diff --git a/tests/text/test_parfmt.py b/tests/text/test_parfmt.py index ca9011b8..7670dda9 100644 --- a/tests/text/test_parfmt.py +++ b/tests/text/test_parfmt.py @@ -1,4 +1,4 @@ -"""Test suite for docx.text.parfmt module, containing the ParagraphFormat object.""" +"""Test suite for skelmis.docx.text.parfmt module, containing the ParagraphFormat object.""" import pytest diff --git a/tests/text/test_run.py b/tests/text/test_run.py index 1e54765e..c8ab7680 100644 --- a/tests/text/test_run.py +++ b/tests/text/test_run.py @@ -1,6 +1,6 @@ # pyright: reportPrivateUsage=false -"""Test suite for the docx.text.run module.""" +"""Test suite for the skelmis.docx.text.run module.""" from __future__ import annotations diff --git a/tests/text/test_tabstops.py b/tests/text/test_tabstops.py index 3f70c630..34c54a7f 100644 --- a/tests/text/test_tabstops.py +++ b/tests/text/test_tabstops.py @@ -1,4 +1,4 @@ -"""Test suite for the docx.text.tabstops module.""" +"""Test suite for the skelmis.docx.text.tabstops module.""" import pytest From a8c560dd6d558e38908aaeb11de999f0cdb345b3 Mon Sep 17 00:00:00 2001 From: skelmis Date: Sat, 1 Mar 2025 12:16:47 +1300 Subject: [PATCH 2/5] feat: update HISTORY.rst --- HISTORY.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 0dab17d8..346fc8fb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,21 @@ Release History --------------- +2.0.0 (2025-02-16) +++++++++++++++++++ + +- Move to private `skelmis` namespace to reduce collision issues. `PR here ` + +1.2.X -> 1.6.X +++++++++++++++ + +- Supporting multiple numbered lists within a document (`1 `, `2 `) +- Supporting TOC updates within the package without the need to open the document manually (`1 `, `2 `) +- Supporting floating images within documents (`1 `) +- Supporting the ability to transform word documents into PDF's (`1 `) +- Horizontal rules + paragraph bounding boxes / borders (`1 `, `2 `) +- External hyperlinks (`1 `) + 1.1.2 (2024-05-01) ++++++++++++++++++ From 143d04ad11988cffaed2908427a6c47f3af5bbae Mon Sep 17 00:00:00 2001 From: skelmis Date: Sat, 1 Mar 2025 12:18:40 +1300 Subject: [PATCH 3/5] chore: bump version --- pyproject.toml | 8 ++++---- src/skelmis/docx/__init__.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ee5949b..bac622c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,15 @@ [tool.poetry] name = "skelmis-docx" -version = "2.0.0" +version = "2.1.0" description = "Create, read, and update Microsoft Word .docx files." authors = ["Skelmis "] license = "MIT" readme = "README.md" packages = [{include = "skelmis/docx", from="src"}] -[project.urls] -Homepage = "https://github.com/skelmis/python-docx" -Documentation = "https://skelmis-docx.readthedocs.io/en/latest/" +#[project.urls] +#Homepage = "https://github.com/skelmis/python-docx" +#Documentation = "https://skelmis-docx.readthedocs.io/en/latest/" [tool.poetry.dependencies] python = "^3.10" diff --git a/src/skelmis/docx/__init__.py b/src/skelmis/docx/__init__.py index 493a592c..5ce07f6c 100644 --- a/src/skelmis/docx/__init__.py +++ b/src/skelmis/docx/__init__.py @@ -13,7 +13,7 @@ if TYPE_CHECKING: from skelmis.docx.opc.part import Part -__version__ = "1.6.2" +__version__ = "2.1.0" __all__ = ["Document"] From 47fe3b40ce4933a722d67ea6230d8623ca036d67 Mon Sep 17 00:00:00 2001 From: skelmis Date: Sat, 1 Mar 2025 12:19:58 +1300 Subject: [PATCH 4/5] doc: update HISTORY.rst --- HISTORY.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 346fc8fb..7509d567 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ Release History --------------- +2.1.0 (2025-03-01) +++++++++++++++++++ + +- Fix items not being fully moved to new namespace + 2.0.0 (2025-02-16) ++++++++++++++++++ From cfe95db28c0e73cd78a84052017635633416f977 Mon Sep 17 00:00:00 2001 From: skelmis Date: Sat, 1 Mar 2025 12:25:31 +1300 Subject: [PATCH 5/5] chore: update black to latest version --- pyproject.toml | 2 +- src/skelmis/docx/oxml/table.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bac622c6..05e7c1b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ pyparsing = "^3.1.2" pytest = "^8.3.2" pytest-coverage = "^0.0" pytest-xdist = "^3.6.1" -black = "^24.8.0" +black = "^24.10.0" [tool.poetry.group.docs.dependencies] sphinx = "^8.0.2" diff --git a/src/skelmis/docx/oxml/table.py b/src/skelmis/docx/oxml/table.py index cec85a33..36ae7f53 100644 --- a/src/skelmis/docx/oxml/table.py +++ b/src/skelmis/docx/oxml/table.py @@ -4,7 +4,11 @@ from typing import TYPE_CHECKING, Callable, cast -from skelmis.docx.enum.table import WD_CELL_VERTICAL_ALIGNMENT, WD_ROW_HEIGHT_RULE, WD_TABLE_DIRECTION +from skelmis.docx.enum.table import ( + WD_CELL_VERTICAL_ALIGNMENT, + WD_ROW_HEIGHT_RULE, + WD_TABLE_DIRECTION, +) from skelmis.docx.exceptions import InvalidSpanError from skelmis.docx.oxml.ns import nsdecls, qn from skelmis.docx.oxml.parser import parse_xml