Skip to content

Commit 4bf5f75

Browse files
committed
Bump to 2.0.2: Python 3.8 compatibility and multi-version testing
- Lower requires-python to >=3.8; add typing_extensions dependency - Add from __future__ import annotations to doc.py - Switch typing.Self to typing_extensions.Self in doc.py - Expand CI matrix to 3.8, 3.10, 3.12, 3.13; split lint and test jobs - Add tox.ini and make tox target for local multi-version testing
1 parent 7f32499 commit 4bf5f75

6 files changed

Lines changed: 60 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@ on:
77
branches: [master]
88

99
jobs:
10-
test:
10+
lint:
1111
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: ["3.12", "3.13"]
15-
1612
steps:
1713
- uses: actions/checkout@v6
1814

19-
- name: Set up Python ${{ matrix.python-version }}
15+
- name: Set up Python 3.12
2016
uses: actions/setup-python@v6
2117
with:
22-
python-version: ${{ matrix.python-version }}
18+
python-version: "3.12"
2319

2420
- name: Install cfb (not yet on PyPI)
2521
run: pip install git+https://github.com/rembish/cfb.git
@@ -36,10 +32,31 @@ jobs:
3632
- name: Type check (mypy)
3733
run: mypy miette
3834

35+
test:
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
python-version: ["3.8", "3.10", "3.12", "3.13"]
40+
41+
steps:
42+
- uses: actions/checkout@v6
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v6
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Install cfb (not yet on PyPI)
50+
run: pip install git+https://github.com/rembish/cfb.git
51+
52+
- name: Install dependencies
53+
run: pip install -e ".[dev]"
54+
3955
- name: Run tests
4056
run: pytest --cov=miette --cov-report=xml
4157

4258
- name: Upload coverage
59+
if: matrix.python-version == '3.12'
4360
uses: codecov/codecov-action@v5
4461
with:
4562
files: coverage.xml

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.0.2 (2026-02-18)
4+
5+
- Lower `requires-python` to `>=3.8`; add `typing_extensions` runtime dependency
6+
- Add `from __future__ import annotations` to `doc.py`
7+
- Switch `from typing import Self` to `from typing_extensions import Self` in `doc.py`
8+
- Expand CI matrix to Python 3.8, 3.10, 3.12, 3.13; split lint and test jobs
9+
- Add `tox.ini` and `make tox` target for local multi-version testing
10+
311
## 2.0.1 (2026-02-18)
412

513
- Modernise test suite: autouse `suppress_warnings` with `catch_warnings()` + yield, `reader` fixture with proper teardown via context manager

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ VENV := .venv
22
PYTHON := $(VENV)/bin/python
33
PIP := $(VENV)/bin/pip
44

5-
.PHONY: help install lint format typecheck test pre-commit clean
5+
.PHONY: help install lint format typecheck test tox pre-commit clean
66

77
help:
88
@echo "Usage: make <target>"
@@ -12,6 +12,7 @@ help:
1212
@echo " format run black"
1313
@echo " typecheck run mypy"
1414
@echo " test run pytest with coverage"
15+
@echo " tox run tests across py38, py310, py312"
1516
@echo " pre-commit install pre-commit hooks"
1617
@echo " clean remove build artifacts and caches"
1718

@@ -37,6 +38,9 @@ typecheck: $(VENV)/bin/activate
3738
test: $(VENV)/bin/activate
3839
$(VENV)/bin/pytest --cov=miette --cov-report=term-missing
3940

41+
tox: $(VENV)/bin/activate
42+
$(VENV)/bin/tox
43+
4044
pre-commit: $(VENV)/bin/activate
4145
$(VENV)/bin/pre-commit install
4246

miette/doc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
"""Microsoft Word Document (.doc) reader — extracts plain text."""
22

3+
from __future__ import annotations
4+
35
from functools import cached_property
46
from pathlib import Path
57
from struct import unpack
6-
from typing import Self
78

89
from cfb import CfbIO
910
from cfb.directory.entry import SEEK_CUR, SEEK_END, SEEK_SET, Entry
11+
from typing_extensions import Self
1012

1113
from miette.exceptions import MietteFormatError
1214

pyproject.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "miette"
7-
version = "2.0.1"
7+
version = "2.0.2"
88
description = "Miette is a light-weight Microsoft Office documents reader"
99
readme = "README.md"
1010
license = { text = "BSD-2-Clause" }
1111
authors = [{ name = "Alex Rembish", email = "alex@rembish.org" }]
12-
requires-python = ">=3.12"
12+
requires-python = ">=3.8"
1313
classifiers = [
1414
"Development Status :: 3 - Alpha",
1515
"Intended Audience :: Developers",
1616
"License :: OSI Approved :: BSD License",
1717
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
1822
"Programming Language :: Python :: 3.12",
1923
"Programming Language :: Python :: 3.13",
2024
"Topic :: Software Development :: Libraries",
2125
"Topic :: Software Development :: Libraries :: Python Modules",
2226
"Topic :: Text Processing",
2327
]
24-
dependencies = ["cfb"]
28+
dependencies = ["cfb", "typing_extensions"]
2529

2630
[project.urls]
2731
Homepage = "https://github.com/rembish/Miette"
@@ -34,6 +38,7 @@ dev = [
3438
"ruff>=0.4",
3539
"mypy>=1.10",
3640
"pre-commit>=3",
41+
"tox>=4",
3742
]
3843

3944
[tool.setuptools.packages.find]
@@ -45,17 +50,17 @@ include = ["miette*"]
4550

4651
[tool.black]
4752
line-length = 88
48-
target-version = ["py312"]
53+
target-version = ["py38"]
4954

5055
[tool.ruff]
5156
line-length = 88
52-
target-version = "py312"
57+
target-version = "py38"
5358

5459
[tool.ruff.lint]
5560
select = ["E", "F", "W", "I", "N", "UP", "B", "C4", "SIM", "RUF"]
5661

5762
[tool.mypy]
58-
python_version = "3.12"
63+
python_version = "3.8"
5964
strict = true
6065
ignore_missing_imports = true
6166

tox.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tox]
2+
envlist = py38, py310, py312
3+
isolated_build = true
4+
5+
[testenv]
6+
# cfb is not on PyPI yet — install from the sibling repo checkout
7+
deps = -e {toxinidir}/../cfb
8+
extras = dev
9+
commands = pytest {posargs}

0 commit comments

Comments
 (0)