Skip to content

Commit f8c67e7

Browse files
authored
Merge pull request #9 from MHoroszowski/feature/customxml
feat: customXml support (1.2.0); supersedes #7 and #8
2 parents 14ee64c + 1b261dd commit f8c67e7

71 files changed

Lines changed: 4632 additions & 177 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,47 @@
11
name: ci
22

3+
# Runs on every push to a branch in this repo and on every pull request
4+
# targeting master. Tags push the same code through publish.yml separately.
5+
36
on:
4-
pull_request:
5-
branches: [ master ]
67
push:
78
branches:
89
- master
910
- develop
11+
- "release/**"
12+
- "feature/**"
13+
- "ci/**"
14+
pull_request:
15+
branches:
16+
- master
17+
workflow_dispatch:
1018

1119
permissions:
12-
contents: write
20+
contents: read
1321

1422
jobs:
23+
lint:
24+
name: Lint (ruff)
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
- name: Install ruff
33+
run: python -m pip install --upgrade ruff
34+
- name: ruff check
35+
run: ruff check src tests
36+
- name: ruff format check
37+
run: ruff format --check src tests
38+
continue-on-error: true # advisory until format pass is run repo-wide
1539

16-
build:
40+
test:
41+
name: Test (Python ${{ matrix.python-version }})
1742
runs-on: ubuntu-latest
1843
strategy:
44+
fail-fast: false
1945
matrix:
2046
python-version: ["3.9", "3.10", "3.11", "3.12"]
2147
steps:
@@ -26,11 +52,35 @@ jobs:
2652
python-version: ${{ matrix.python-version }}
2753
- name: Display Python version
2854
run: python -c "import sys; print(sys.version)"
29-
- name: Install test dependencies
55+
- name: Install package and test deps
3056
run: |
31-
pip install .
32-
pip install -r requirements-test.txt
33-
- name: Test with pytest
34-
run: pytest --cov=pptx --cov-report term-missing tests
35-
- name: Acceptance tests with behave
57+
python -m pip install --upgrade pip
58+
python -m pip install -e .
59+
python -m pip install -r requirements-test.txt
60+
- name: Unit + integration tests (pytest)
61+
run: pytest --cov=pptx --cov-report=term-missing tests
62+
- name: Acceptance tests (behave)
3663
run: behave --stop
64+
65+
build-check:
66+
name: Build sdist and wheel (smoke)
67+
runs-on: ubuntu-latest
68+
needs: test
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Set up Python
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: "3.12"
75+
- name: Install build tooling
76+
run: python -m pip install --upgrade build twine
77+
- name: Build distributions
78+
run: python -m build
79+
- name: Verify metadata renders
80+
run: python -m twine check dist/*
81+
- name: Upload build artifacts
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: dist-${{ github.sha }}
85+
path: dist/
86+
retention-days: 7

.github/workflows/publish.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: publish
2+
3+
# Builds and publishes python-pptx-extended to PyPI using PyPI Trusted
4+
# Publishing (OIDC). No long-lived API token is stored in repo secrets — the
5+
# workflow's identity is verified by PyPI against the configured Trusted
6+
# Publisher (see one-time setup in the PR description).
7+
#
8+
# Triggers:
9+
# - GitHub Release published (recommended path: cut a release in the GH UI)
10+
# - Manual workflow_dispatch (override / re-run)
11+
#
12+
# Tag pushes alone do not trigger this; create a Release pointing at the tag.
13+
14+
on:
15+
release:
16+
types: [published]
17+
workflow_dispatch:
18+
19+
jobs:
20+
build:
21+
name: Build sdist and wheel
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
- name: Install build tooling
30+
run: python -m pip install --upgrade build
31+
- name: Build distributions
32+
run: python -m build
33+
- name: Verify metadata renders
34+
run: |
35+
python -m pip install --upgrade twine
36+
python -m twine check dist/*
37+
- name: Upload build artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
43+
publish-pypi:
44+
name: Publish to PyPI
45+
needs: build
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: pypi
49+
url: https://pypi.org/project/python-pptx-extended/
50+
permissions:
51+
id-token: write
52+
steps:
53+
- name: Download build artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: dist
57+
path: dist/
58+
- name: Publish to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1

HISTORY.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,42 @@
33
Release History
44
---------------
55

6+
1.2.0 (2026-05-05)
7+
++++++++++++++++++
8+
9+
Adds first-class support for OOXML customXml — the mechanism Office.js,
10+
SharePoint, and VSTO add-ins use to embed structured application data in
11+
``.pptx`` files. See ``docs/user/custom-xml.rst`` for the user guide and
12+
``docs/dev/analysis/customxml.rst`` for the OOXML analysis.
13+
14+
- feature: ``Presentation.custom_properties`` — Mapping wrapper over
15+
``/docProps/custom.xml`` (Custom Document Properties; visible in
16+
PowerPoint's *File → Properties → Advanced* UI). Type-dispatched
17+
``__setitem__`` plus explicit ``set_string`` / ``set_int`` / ``set_float`` /
18+
``set_bool`` / ``set_datetime`` setters when Python type inference does the
19+
wrong thing.
20+
- feature: ``Presentation.custom_xml_parts`` — Sequence wrapper over the
21+
package's customXml data parts. ``add(xml, *, name=, datastoreItem_id=,
22+
schema_refs=, scope=)`` supports both presentation-scoped (Office.js
23+
default) and package-scoped (VSTO / SharePoint) topologies. Lookup via
24+
index, partname tail, ``by_guid(...)``, or ``by_name(...)``.
25+
- feature: ``CustomXmlParts.add_string_blob(name, content, mime_hint=,
26+
encoding=)`` — convenience for the common "embed a string verbatim and
27+
read it back" case (e.g. round-trip a markdown source document).
28+
- feature: round-trip safety with files written by other tools — PPTX files
29+
containing customXml parts authored by SharePoint, Office.js, or VSTO load
30+
and save without losing their content.
31+
32+
1.1.0 (2026-05-01)
33+
++++++++++++++++++
34+
35+
- Fork of python-pptx 1.0.2 published as ``python-pptx-extended``.
36+
- feature: full shadow effect API on ``ShadowFormat``
37+
- feature: bullet and numbered list paragraph formatting
38+
- feature: per-edge table cell borders
39+
- feature: ``cap_style`` and ``join_style`` properties on ``LineFormat``
40+
- feature: line-end shape types
41+
642
1.0.2 (2024-08-07)
743
++++++++++++++++++
844

0 commit comments

Comments
 (0)