Skip to content
Merged
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
64 changes: 30 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install ruff
run: python -m pip install --upgrade ruff
enable-cache: true
# ---uv tool run auto-installs on first invocation; no separate install step needed---
- name: ruff check
run: ruff check src tests
run: uv tool run ruff check src tests
- name: ruff format check
run: ruff format --check src tests
run: uv tool run ruff format --check src tests

typecheck:
name: Typecheck (pyright strict — public API)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install package and pyright
run: |
python -m pip install --upgrade pip pyright
python -m pip install -e .
enable-cache: true
- name: Set up Python
run: uv python install 3.12
- name: Sync dev dependencies
run: uv sync --extra dev
# ---public-API surface: pptx/__init__.py is the literal entrypoint
# ---resolved by `from pptx import Presentation`, plus the modules
# ---it pulls in (api, presentation, util, exc, types).
Expand All @@ -57,8 +56,8 @@ jobs:
# ---oxml.simpletypes); those are tracked as future work, not this gate.
- name: pyright (public-API entry points)
run: |
pyright src/pptx/__init__.py src/pptx/api.py src/pptx/presentation.py \
src/pptx/util.py src/pptx/exc.py src/pptx/types.py
uv run pyright src/pptx/__init__.py src/pptx/api.py src/pptx/presentation.py \
src/pptx/util.py src/pptx/exc.py src/pptx/types.py

test:
name: Test (Python ${{ matrix.python-version }})
Expand All @@ -69,38 +68,35 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Sync test dependencies
run: uv sync --extra test --python ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install package and test deps
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements-test.txt
run: uv run python -c "import sys; print(sys.version)"
- name: Unit + integration tests (pytest)
run: pytest --cov=pptx --cov-report=term-missing tests
run: uv run pytest --cov=pptx --cov-report=term-missing tests
- name: Acceptance tests (behave)
run: behave --stop
run: uv run behave --stop

build-check:
name: Build sdist and wheel (smoke)
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install build tooling
run: python -m pip install --upgrade build twine
enable-cache: true
- name: Build distributions
run: python -m build
run: uv build
- name: Verify metadata renders
run: python -m twine check dist/*
run: uv tool run --from twine twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install build tooling
run: python -m pip install --upgrade build
enable-cache: true
- name: Build distributions
run: python -m build
run: uv build
- name: Verify metadata renders
run: |
python -m pip install --upgrade twine
python -m twine check dist/*
run: uv tool run --from twine twine check dist/*
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.cache
.coverage
/.tox/
/.venv/
/src/*.egg-info
*.pyc
/dist/
Expand All @@ -11,3 +12,5 @@ _scratch/
/spec/gen_spec/spec*.db
tags
/tests/debug.py
/uat/
/AGENTS.md
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ license = { text = "MIT" }
readme = "README.rst"
requires-python = ">=3.9"

# -- Optional dependency groups, installable as `pip install python-pptx-extended[test]`
# -- or via uv as `uv sync --extra test`. The legacy requirements*.txt files were
# -- removed in the uv migration (see HISTORY.rst); the same package sets live here.
[project.optional-dependencies]
test = [
"behave>=1.2.5",
"pyparsing>=2.0.1,<3",
"pytest>=2.5",
"pytest-cov",
"pytest-xdist",
]
dev = [
"build",
"pyright",
"ruff",
"twine",
]
docs = [
"Sphinx==1.8.6",
"Jinja2==2.11.3",
"MarkupSafe==0.23",
"alabaster<0.7.14",
]

[project.urls]
Changelog = "https://github.com/MHoroszowski/python-pptx/blob/master/HISTORY.rst"
Documentation = "https://python-pptx.readthedocs.io/en/latest/"
Expand Down
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements-docs.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements-test.txt

This file was deleted.

8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

9 changes: 0 additions & 9 deletions tox.ini

This file was deleted.

Loading
Loading